xsp-4.2/0000775000175000017500000000000012627055650007204 500000000000000xsp-4.2/ChangeLog0000664000175000017500000033003512627046413010677 000000000000002010-03-31 Marek Habersack * man/xsp.1.in: updated documentation of the --nonstop option. Fixes bug #585295 2010-03-18 Marek Habersack * src/Mono.WebServer.FastCgi/StandardSocket.cs: check in a safe manner if a socket is connected. 2010-02-26 Marek Habersack * tools/asp_state/asp-state4.exe.config: modifed to load types from System.Web 4.0.0 * src/Mono.WebServer/InitialWorkerRequest.cs: do not decode paths before passing them to GetSafePath. Fixes bug #581594 2010-02-16 Marek Habersack * src/Mono.WebServer.Apache/ModMonoRequest.cs: FillBuffer makes sure that the MemoryStream is properly reset before filling it from the network. Fixes bug #580086 2010-01-18 Marek Habersack * src/Mono.WebServer.XSP/AssemblyInfo.cs.in: updated copyright years * src/Mono.WebServer.XSP/main.cs: better looking copyright message * configure.in: changed version number to 2.7 * src/Mono.WebServer/XSPWorkerRequest.cs, src/Mono.WebServer/InitialWorkerRequest.cs: correctly handle \r\n on buffer/packet boundary. Fixes bug #569363. Patch from Tobias Polley , thanks! 2009-12-17 Marek Habersack * src/Mono.WebServer.FastCgi/StandardSocket.cs: Close () makes sure both socket endpoints data is flushed. Patch from Tiaan Geldenhuys , thanks! 2009-12-02 Marek Habersack * configure.in, scripts/Makefile.am, src/Mono.WebServer.Apache/Makefile.am, src/Mono.WebServer.FastCgi/Makefile.am, src/Mono.WebServer.XSP/Makefile.am, src/Mono.WebServer/AssemblyInfo4.cs.in, src/Mono.WebServer/Makefile.am, src/Mono.WebServer/xsp-4.pc.in, tools/asp_state/Makefile.am, tools/asp_state/asp-state4.exe.config, tools/dbsessmgr/Makefile.am, tools/dbsessmgr/dbsessmgr4.exe.config: added support for compiling .NET 4.0 versions of the assemblies and tools. 2009-11-23 Marek Habersack * src/Mono.WebServer.FastCgi/Request.cs: better parsing for parameter data. New internal property ApplicationHost * src/Mono.WebServer.FastCgi/ApplicationHost.cs: added support for mapping virtual paths, so that ASP.NET MVC sites work correctly when hosted under Mono's FastCGI server. * src/Mono.WebServer.FastCgi/WorkerRequest.cs: GetPathInfo returns an empty string if the PATH_INFO environment variable is missing. All of the above from patches submitted by Tiaan Geldenhuys , thanks! 2009-11-19 Marek Habersack * src/Mono.WebServer.FastCgi/Server.cs: prevent connection and resource leaking by catching unhandled exceptions. * src/Mono.WebServer.FastCgi/Logger.cs: Close() catches ObjectDisposedException in case writer is already disposed. The above patches were contributed by Tiaan , thanks! 2009-11-17 Marek Habersack * src/Mono.WebServer.FastCgi/NameValuePair.cs: fix for incorrect encoding of string lengths greater than 127 bytes. Patch from Tiaan , thanks! 2009-09-21 Marek Habersack * src/Mono.WebServer/MonoWorkerRequest.cs: added support for protecting hidden files/directories (with the Hidden attribute on Windows, starting with a dot on Unix) * src/Mono.WebServer.XSP/main.cs, src/Mono.WebServer.Apache/main.cs: added new option, --no-hidden, which turns off hidden file/directory protection. * man/xsp.1.in: added documentation for the new --no-hidden option. 2009-09-15 Marek Habersack * src/Mono.WebServer.XSP/main.cs: sleep after catching ThreadAbortException in RealMain, before exiting. 2009-08-21 Marek Habersack * test/2.0/treeview/treeview.aspx: use http://go-mono.com/status/images/se.gif instead of http://mono.ximian.com/class-status/mono-HEAD-vs-fx-2/cm/se.gif. Fixes bug #479736 2009-08-20 Marek Habersack * test/1.1/asp.net/browsercaps.aspx: sort the output in MS.NET compatible way. Fixes bug #514155. Patch from Robert Jordan , thanks! 2009-08-13 Marek Habersack * src/Mono.WebServer/XSPWorkerRequest.cs: if the Content-Length request header is present, make sure not more than the number of bytes specified in it is returned to the caller (GetPreloadedEntityBody). Fixes bug #530858 2009-06-08 Kornél Pál * src/Mono.WebServer.FastCgi/Request.cs (ParseParameterData): Fast test for directory with no trailing slash. Avoid testing last component twice. There is no need to call GetFullPath on the physical path info. 2009-06-06 Kornél Pál * src/Mono.WebServer.FastCgi/Request.cs (ParseParameterData): More closely resemble Apache and PHP behavior provides better support for non-existent files, takes a fast path when there is no path info and tests earlier for Apache variables. 2009-06-02 Kornél Pál * autogen.sh, configure.in: Set EOL style to Unix to fix cygwin build. * src/Mono.WebServer.FastCgi/Responder.cs (Process): Properly set status code when no application is found. * src/Mono.WebServer.FastCgi/Request.cs (ParseParameterData): Use a simple reverse scan of path components until the first existing file and allow non-existent files. 2009-04-10 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: the libc function signatures were wrong. * src/Mono.WebServer/BaseApplicationHost.cs: call ResetAbort if we get an unexpected ThreadAbortException. * src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs: * src/Mono.WebServer.Apache/ModMonoRequest.cs: * src/Mono.WebServer.Apache/Makefile.am: * src/Mono.WebServer.Apache/Worker.cs: add new SendResponseFromMemory overloads that will write directly to mod_mono without copying (linux only). 2009-04-09 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWebSource.cs: re-add the 2 parameter ctor. Compatibility with existing apps was broken. 2009-04-02 Gonzalo Paniagua Javier * configure.in: * test/2.0/gridview/Makefile.am: * test/2.0/Makefile.am: gridview sample was not being installed. * src/Mono.WebServer.XSP/main.cs: * src/Mono.WebServer.Apache/main.cs: when running in single-app mode, corretly handle application restarts. * src/Mono.WebServer.Apache/WebSource.cs: remove unused variable. 2009-03-25 Marek Habersack * src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs: made GetServerVariable public and a bit safer. * src/Mono.WebServer.Apache/ApplicationHost.cs: do not use broker here, ModMonoWorkerRequest can do it for us if need be. Fixes bug #488630 2009-03-25 Rolf Bjarne Kvinge * src/Mono.WebServer/XSPWorkerRequest.cs: if send fails with EINTR, try to send again instead of throwing an exception. 2009-03-21 Marek Habersack * src/Mono.WebServer/ApplicationServer.cs: added an overload for the Start method which takes an exception as an argument. This exception, if not null, will be sent to the client on the first connection attempt. * src/Mono.WebServer.XSP/main.cs: read AppSettings in the constructor of a new ApplicationSettings class, to isolate errors. 2009-03-13 Gonzalo Paniagua Javier * src/Mono.WebServer.Apache/main.cs: fix error when --master is passed. Bug #481597 fixed. 2009-03-09 Marek Habersack * src/Mono.WebServer/XSPWorker.cs, XSPWebSource.cs, XSPApplicationHost.cs: XSP can now bind to IPv6 addresses. Patch from Pascal Fresnay , thanks! Fixes bug #479878 2009-03-03 Marek Habersack * src/Mono.WebServer.Apache/ModMonoRequest.cs: removed a ShouldClientBlock () check from GetClientBlock (). Fixes bug #481370 2009-02-27 Gonzalo Paniagua Javier * src/Mono.WebServer.XSP/main.cs: * src/Mono.WebServer.FastCgi/main.cs: * src/Mono.WebServer.Apache/main.cs: do not sent the Trace output to the Console by default. 2009-02-25 Gonzalo Paniagua Javier * src/Mono.WebServer.XSP/main.cs: changes needed to run the Accept thread in the ASP.NET appdomain when there is a single application configured. * src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs: avoid the lock in RequestBroker for single applications. Implemented GetHeadersSent(). * src/Mono.WebServer.Apache/RequestBroker.cs: implemented GetHeadersSent (). * src/Mono.WebServer.Apache/WebSource.cs: propagate the single_app setting. * src/Mono.WebServer.Apache/ApplicationHost.cs: for single_app, pass the instance of ModMonoWorker to the worker request. * src/Mono.WebServer.Apache/ModMonoRequest.cs: reduced number of writes. Implemented GetHeadersSent (). * src/Mono.WebServer.Apache/main.cs: changes needed to run the Accept thread in the ASP.NET appdomain when there is a single application configured. * src/Mono.WebServer.Apache/Worker.cs: don't register/unregister the request for single application. Implemented GetHeadersSent (). * src/Mono.WebServer/VPathToHost.cs: for multiple application, set the request broker of the application host to one main appdomain. * src/Mono.WebServer/XSPWebSource.cs: propagate the single_app setting. * src/Mono.WebServer/ApplicationServer.cs: allow setting application host and broker. For single application, set the request broker of the application host to one created in the ASP.NET application domain. GetApplicationForPath just returns the registered application without checking the parameters. All these yadaa, yadaa can be summarized in: * Avoid remoting through the cross appdomain channel when there is only one ASP.NET application registered (single_app). * Avoid locking in RequestBroker for single_app. * Implement GetHeadersSent. * Reduced number of writes to mod_mono. 2009-01-30 Marek Habersack * src/Mono.WebServer/Paths.cs: path info with a dot is valid. Fixes bug #470662 2009-01-29 Marek Habersack * src/Mono.WebServer/Makefile.am (EXTRA_DIST): added $(monowebserver2_sources) 2009-01-27 Marek Habersack * src/Mono.WebServer/SearchPattern.cs: made the class reusable and removed the check for invalid characters, it doesn't make sense for virtual paths. * src/Mono.WebServer/ReaderWriterLockSlim.cs: made the class internal. * src/Mono.WebServer/BaseApplicationHost.cs: gotten rid of matched paths cache (and two locks with them). Regexps are no longer used to match handlers, we now use SearchPattern (copied from System.dll) instead. 2009-01-23 Marek Habersack * src/Mono.WebServer/ApplicationServer.cs: if fullPath passed to AddApplication doesn't end with a directory separator character, append it to the path. Fixes bug #463483. Patch from Chuck McCrobie , thanks! * src/Mono.WebServer/ReaderWriterLockSlim.cs, src/Mono.WebServer/LockRecursionException.cs, src/Mono.WebServer/LockRecursionPolicy.cs: added to avoid having to link with System.Core * src/Mono.WebServer/Makefile.am (monowebserver_sources): added SearchPattern.cs * src/Mono.WebServer/SearchPattern.cs: added * src/Mono.WebServer/BaseApplicationHost.cs: use ReaderWriterLockSlim for handlersCacheLock. 2009-01-22 Marek Habersack * src/Mono.WebServer/Paths.cs: VirtualPathProvider.FileExists is called with an absolute uri. 2009-01-16 Gonzalo Paniagua Javier * src/Mono.WebServer.Apache/RequestReader.cs: * src/Mono.WebServer.Apache/ModMonoRequest.cs: remove unused ctors. 2009-01-08 Marek Habersack * configure.in: added the --with-runtime option to make it possible to specify a different runtime to be used with xsp than the first one found in the path. If --with-runtime is not specified and ${prefix}/bin/mono exists, then it is used as the runtime for compiled xsp 2008-12-29 Miguel de Icaza * src/Mono.WebServer/XSPWorker.cs: Exception to assist in debuggin reusable versions of Mono.WebServer. 2008-12-23 Gonzalo Paniagua Javier * src/Mono.WebServer.Apache/Worker.cs: don't display the exception if it's caused by a client-side close. Bug #462045 fixed. 2008-12-16 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: ignore catch-all handler entries in PathMatches. Fixes bug #459270 2008-12-12 Marek Habersack * packaging/opensuse/xsp.spec: rpm now creates the /var/run/xsp2/ directory and chowns it to wwwrun.www * packaging/opensuse/xsp2.init: modified the script to properly start the xsp process. * man/xsp.1.in: added documentation for --pidfile * src/Mono.WebServer.XSP/main.cs: added a --pidfile option which tells xsp to write its PID to the specified path. 2008-12-01 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: check if the key exists in the handlers cache after acquiring the lock and update it instead of adding. 2008-11-28 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: add locking to avoid races when two requests are being created at the same time. 2008-11-27 Marek Habersack * src/Mono.WebServer/IApplicationHost.cs: added new method - IsHttpHandler which checks whether the passed URI matches a HTTP handler definition. Fixes bug #448522 * src/Mono.WebServer/BaseApplicationHost.cs: implemented the new IApplicationHost method - IsHttpHandler (2.0+ only - need to figure out how to portably do the same for 1.1). Fixes bug #448522 * src/Mono.WebServer/Paths.cs: GetPathsFromUri now checks not only whether a path physically exists, but also whether it's a handler or a virtual file (on 2.0+). Fixes bug #448522 * src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs, src/Mono.WebServer/XSPWorkerRequest.cs: Paths.GetPathsFromUri now accepts two more arguments. 2008-10-03 Juraj Skripsky * src/Mono.WebServer/BaseRequestBroker.cs: Reverted part of the last commit. Use a pre-allocated buffer only when the size matches as it will be transferred across appdomain boundaries in full length. 2008-10-03 Juraj Skripsky * src/Mono.WebServer/BaseRequestBroker.cs: Actually use the allocated request buffers. Make the size of a request buffer equal INPUT_BUFFER_SIZE in System.Web.HttpRequest, so that it is used for requests >= 32kb as well (e.g. uploads of big files). Fixes bug #431675. 2008-10-01 Miguel de Icaza * Fix the scripts, my previous commit was untested, and some scripts ended up not pointing to the right place (xsp was trying to call 2.0/xsp.exe instead of 2.0/xsp2.exe and xsp1 was trying to call 1.0/xsp1.exe instead of 1.0/xsp.exe). Fixes #431121 2008-09-21 Miguel de Icaza * scripts/Makefile.am ($(tool_scripts)): Follow the naming pattern used in Mono 2.0. By default the `script' is a 2.0 script, `script1' is the 1.0 script, and `script2' is the 2.0 script. 2008-07-29 Marek Habersack * test/1.1/webcontrols/dbpage1.aspx: do not rely on the OnTextChanged to fire the Filter_Changed handler method. Doing that makes the sample miss situations when the user clicks Submit several times in a row without changing the filters - the result of this is that no table is show in the output. Filter_Changed is fired as the OnClick handler of the Submit button. Fixes bug #381972. Should the filter fail to return any results, an appropriate information is shown. 2008-07-14 Marek Habersack * src/Mono.WebServer.Apache/ModMonoRequest.cs: fill the buffer when reading the client block. Fixes bug #408723 2008-07-11 Marek Habersack * src/Mono.WebServer.Apache/Worker.cs: RequestReader is created with the client socket as parameter now. * src/Mono.WebServer.Apache/Mono.WebServer.Apache.sources: reflect changes in file names. * src/Mono.WebServer.Apache/ModMonoRequest.cs: renamed from Request.cs. Use Dictionary for caches for 2.0. Instead of using NetworkStream (which would invoke socket receive/send for every call to read/write an item) now using MemoryStreams which are paired with BinaryReaders. Data read/written from/to the client socket is put directly in the MemoryStreams. Protocol changes to sync with mod_mono changes (protocol version 9). * src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs: renamed from WorkerRequest.cs * src/Mono.WebServer.Apache/RequestReader.cs: added - moved the RequestReader public class to here from WorkerRequest.cs 2008-04-25 Marek Habersack * src/Mono.WebServer.Apache/WorkerRequest.cs: do not append the default index to the request path if a directory is requested. Fixes bug #324204 2008-03-19 Marek Habersack * src/Mono.WebServer.Apache/main.cs: Fix a CWL format typo, which causes the apache backend to fail when --port is used. Fixes bug #372220. Patch contributed by Daniel Cohen , thanks a lot! 2008-02-26 Kornél Pál * src/Mono.WebServer/XSPWorkerRequest.cs: Add a Date header because that's the responsibility of the web server rather than ASP.NET. Fixes bug #363404. 2008-02-08 Marek Habersack * test/Web.sitemap: /1.1/asp.net/transfer2.aspx removed from the tree - it is not supposed to be accessed directly. * test/1.1/asp.net/codebehind1.aspx: do not use automatic even wireup. Fixes bug #359783 2008-02-03 Pedro Martínez Juliá * ChangeLog: Convert to UTF8 and change my old email with the new. 2008-02-03 Pedro Martínez Juliá * man: Add new generated manual page to svn:ignore. 2008-01-30 Robert Jordan * src/Mono.WebServer.FastCgi/main.cs (Main): Replace Console.WriteLines with Logger.Write. Always log to console during Main (). Handle UnmagedSocket's exceptions gracefully. Fixes #350779. 2008-01-28 Wade Berrier * configure.in: version bump -> 1.9 2008-01-25 Marek Habersack * test/1.1/webcontrols/Makefile.am (EXTRA_DIST): include the .sqlite files in the generated tarball, so that the build system doesn't need to have sqlite installed. 2008-01-19 Joshua Tauberer * src/Mono.WebServer/BaseRequestBroker.cs: Read: Check the request ID is valid inside the lock. 2007-12-12 Marek Habersack * test/1.1/handlers/monodoc.ashx: fix the rendering of links. Apparently, firefox lowercases the leading X: sequence in links like 'N:System' and that, in turn, causes Monodoc to fail to parse the link properly. Code stolen from the monodoc version of monodoc.ashx. 2007-12-08 Marek Habersack * test/1.1/asp.net/Makefile.am (testfiles): added transfer{1,2}.aspx and serial.aspx * test/Web.sitemap: remove the .ascx controls from the menu. 2007-12-04 Marek Habersack * src/Mono.WebServer/ApplicationServer.cs: added a new property, Port, to report the actual port ApplicationServer is listening on * src/Mono.WebServer.XSP/main.cs: accept an extra parameter to attach XSP to a random port. The actual port is printed to the console instead of the configured one, as it was done before. 2007-11-21 Marek Habersack * Added several index.aspx files to avoid 404 errors on accessing directories. 2007-11-20 Marek Habersack * test/1.1/customcontrol/tabcontrol.aspx: explain how adding links works. * test/1.1/webcontrols/Makefile.am: generate the .sqlite files when needed. Fixes make dist. * test/1.1/webcontrols/web_linkbutton.aspx: make the sample work. Clicking 'Remove this link' actually does something now. Same for the 'Click me!' button. * All the samples are using common look now. A common header has been added to provide consistent look and sample navigation. 1.1 mode uses a poor man's implementation of the 2.0 SiteMap reader, to be able to read the samples map from the Web.sitemap file. * The test suite for 1.1 MUST now be ran from the directory into which 'make install' put the samples - it requires the SiteMapReader_1.1.dll to be present. If a user runs the test suite from the source directory (or from one missing the required components) a page explaining the steps to get it working is shown. The 2.0 profile isn't subject to this requirement, as it will run most samples from the source direcory. * The 1.1/webcontrols/dbpage*.aspx samples now use Sqlite databases installed along with the test suite. The databases are generated by the dbpage_test_setup.exe utility found in the same directory where the samples are. 2007-11-20 Juraj Skripsky * test/1.1/webcontrols/web_comparevalidator.aspx: add test page for the CompareValidator control. 2007-11-08 Wade Berrier * configure.in: version bump -> 1.2.6 2007-11-07 Marek Habersack * packaging/opensuse/xsp2.init, packaging/opensuse/Makefile.am, packaging/opensuse/xsp2.logrotate, tools/mono-asp-apps/Makefile.am, packaging/opensuse/sysconfig.xsp2, packaging/opensuse/xsp.spec, packaging/Makefile.am: added 2007-11-03 Marek Habersack * test/1.1/webcontrols/dbpage1.aspx, test/1.1/webcontrols/dbpage2.aspx: Account for missing database provider assemblies. 2007-11-02 Thomas Wiest * test/1.1/customcontrol/tabcontrol2.aspx: * test/1.1/html/htmlimage.aspx: * test/1.1/html/htmlinputimage.aspx: * test/1.1/webcontrols/web_hyperlink.aspx: * test/1.1/webcontrols/web_adrotator.xml: Changed http://www.ximian.com/images/index/button-top.gif to http://www.mono-project.com/files/8/8d/Mono-gorilla-aqua.100px.png 2007-10-30 Marek Habersack * man/Makefile.am (EXTRA_DIST): added mono-asp-apps.1.in (CLEANFILES): added mono-asp-apps.1 2007-10-30 Marek Habersack * configure.in: added man/mono-asp-apps.1 to the list of generated files. * man/mono-asp-apps.1.in: added 2007-10-30 Marek Habersack * tools/mono-asp-apps/README: added 2007-10-30 Marek Habersack * tools/mono-asp-apps/mono-asp-apps: added 2007-10-29 Robert Jordan * src/Mono.WebServer.FastCgi/WorkerRequest.cs: Implement IsSecure (). * src/Mono.WebServer.FastCgi/Server.cs: Use Type.IsAssignableFrom (). 2007-10-28 Robert Jordan * src/Mono.WebServer.FastCgi/ConfigurationManager.*: Implement an additional configuration source: environment. * src/Mono.WebServer.FastCgi/Request.cs: Take directory index (default documents) into account. 2007-10-28 Robert Jordan * src/Mono.WebServer.FastCgi/Request.cs: Compute PATH_INFO, PATH_TRANSLATED, SCRIPT_NAME, SCRIPT_FILENAME when running under Apache. 2007-10-26 Wade Berrier * configure.in: * src/AssemblyInfoModMono.cs.in: * src/AssemblyInfo.cs.in: * tools/asp_state/AssemblyInfo.cs.in: * tools/dbsessmgr/AssemblyInfo.cs.in: Split VERSION to VERSION and XSP_VERSION in order to allow svn revision in VERSION and still satisfy mcs's numbering scheme (recently changed to match csc) Didn't replace VERSION, because we need the tarball version to not have periods in the revision name. 2007-10-24 Marek Habersack * src/Mono.WebServer/XSPWorkerRequest.cs: gracefully handle exceptions in the constructor, by closing the connection when Exception happens. 2007-10-22 Robert Jordan * man/*: Generate fastcgi-mono-server(1). * doc/*: Temporarily fix for `make distcheck'. * src/Mono.WebServer.FastCgi/Makefile.am: Cleanups. 2007-10-22 Robert Jordan * src/*/*.am : Fix `make distcheck'. 2007-10-22 Robert Jordan * src/Mono.WebServer.FastCgi/Request.cs: Reverted temporary hack for mod_fastcgi. * src/Mono.WebServer.FastCgi/ConfigurationManager.cs: The XML default settings have less precedence. 2007-10-22 Robert Jordan * src/Mono.WebServer.Apache/Mono.WebServer.Apache.sources: Create. * src/Mono.WebServer.Apache/SecurityConfiguration.cs: Get rid of MODMONO. 2007-10-22 Robert Jordan * src/Makefile.am: FastCGI -> FastCgi. * src/Mono.WebServer.FastCgi/Makefile.am: * src/Mono.WebServer.FastCgi/*.sources: * src/Mono.WebServer.FastCgi/AssemblyInfo.cs.in: Create. * src/Mono.WebServer.FastCgi/ConfigurationManager.xml: Add some default values to be able to get rid of the exe.config file. Comment out the automapping settings. * src/Mono.WebServer.FastCgi/ConfigurationManager.cs: Implement ImportSettings (). Support for default settings specified in ConfigurationManaged.xml. * src/Mono.WebServer.FastCgi/main.cs: * src/Mono.WebServer.FastCgi/Responder.cs: Take the ApplicationManager out of the build until its automapping issues are fixed. * src/Mono.WebServer.FastCgi/server.cs: Rename to main.cs 2007-10-22 Robert Jordan * src/Mono.WebServer.FastCgi: Import Brian's files from his google repository. Flatten hierarchies to adhere to mono's standards. Disintegrate the Mono.FastCgi assembly. 2007-10-22 Robert Jordan * configure.in, scripts/Makefile.am: Reflect changes. * src/Makefile.am: Reflect changes. * src/Mono.WebServer.Apache/main.cs: Remove XSP-related code. * src/Mono.WebServer.XSP/main.cs: Remove ModMono-related code. * src/Mono.WebServer.Apache/Makefile.am: Create from .Makefile.am. * src/Mono.WebServer.XSP/Makefile.am: Create from Makefile.am. * src/server.cs: Copy as main.cs to Mono.WebServer.Apache and Mono.WebServer.XSP * src/ecurity.cs: Move to Mono.WebServer.XSP/SecurityConfiguration.cs * src/ModMono*.cs: Move to Mono.WebServer.Apache. * src/Mono.WebServer.Apache: Create. * src/Mono.WebServer.FastCgi: Create. * src/Mono.WebServer.XSP: Create. 2007-10-03 Juraj Skripsky * src/ModMonoRequest.cs: put the ModMonoConfig struct in charge to tracking its property "Changed". 2007-10-03 Marek Habersack * src/ModMonoRequestBroker.cs,src/ModMonoWorker.cs: added a method to support configuration of output buffering in mod_mono * src/ModMonoRequest.cs: added support for new mod_mono communication protocol, SET_CONFIGURATION. Configuration of mod_mono is updated before write commands, if necessary. Currently it supports only configuring the output buffering (based on the value of HttpResponse.BufferOutput) Bumped protocol version to 8 * src/ModMonoWorkerRequest.cs: added a method which updates the mod_mono/apache configuration if necessary. 2007-10-02 Marek Habersack * src/ModMonoRequest.cs: make the protocol mismatch error message more informative. 2007-09-21 Marek Habersack * src/ModMonoRequest.cs: use UTF8 when sending strings to Apache. Fixes bug #325448 2007-09-18 Daniel Nauck * src/server.cs: add a UnhandledExceptionEventHandler to handle an exception that is not handled by the application domain. 2007-08-18 Josh Tauberer * src/Mono.WebServer/BaseRequestBroker.cs: Correct a mistake in my previous patch: checking for wrap-around on requests_served counter, since we bitmask it 0x7FFF, wrap-around occurs at 0x8000. 2007-08-16 Wade Berrier * configure.in: version bump -> 1.2.5 2007-08-14 Marek Habersack * src/Mono.WebServer/XSPWorker.cs: do not rethrow an exception that might occur on write, write an error message to the console and close our end of the connection instead. Fixes bug #81699. * src/ModMonoWorkerRequest.cs: ReadEntityBody makes sure the number of bytes to copy is > 0 and that the read buffer is not null. 2007-08-09 Marek Habersack * src/ModMonoWorkerRequest.cs, src/Mono.WebServer/XSPWorkerRequest.cs: do not fail if default index files configuration cannot be retrieved. Based on patch from Juraj Skripsky , thanks! Fixes bug #82379. * src/ModMonoWorker.cs: move request unregister call from the finally block to the catch block. This is to avoid unregistering the request while it is still being processed by the HttpRuntime (asynchronously). Patch from Joshua Tauberer , thanks! 2007-08-08 Marek Habersack * src/Mono.WebServer/MonoWorkerRequest.cs: don't use the SendResponseFromFile (IntPtr, long, long) overload from the SendResponseFromFile (string, long, long) one - prevents double close of the file handle. * src/Mono.WebServer/ApplicationServer.cs: leave only the implementation of the ApplicationServer class here, the other classes are moved to own files, below. * src/Mono.WebServer/Paths.cs: new file, moved Paths class implementation here. * src/Mono.WebServer/HttpErrors.cs: new file, moved HttpErrors class implementation here. * src/Mono.WebServer/VPathToHost.cs: new file, moved VPathToHost class implementation here. * src/Mono.WebServer/XSPApplicationHost.cs: leave only the implementation of the XSPApplicationHost here, the other classes are moved to own files, below. * src/Mono.WebServer/XSPWorker.cs: new file, moved XSPWorker class implementation here. * src/Mono.WebServer/XSPWebSource.cs: new file, moved XSPWebSource class implementation here. * src/Mono.WebServer/XSPRequestBroker.cs: new file, moved XSPRequestBroker class implementation here. * src/Mono.WebServer/Makefile.am (monowebserver_sources): added new source files. * src/ModMonoApplicationHost.cs: leave only the implementation of the ModMonoApplicationHost class here, the other classes are moved to own files, below. * src/ModMonoWorker.cs: new file, moved ModMonoWorker class implementation here. * src/ModMonoWebSource.cs: new file, moved ModMonoWebSource class implementation here. * src/ModMonoRequestBroker.cs: new file, moved ModMonoRequestBroker class implementation here. * src/Makefile.am (modmono_only): added new source files. 2007-08-07 Marek Habersack * src/Mono.WebServer/BaseRequestBroker.cs: applied patch by Joshua Tauberer (with minor changes) proposed in bug #82057. The change turns request id into a compound of the unique request id in the upper 16 bits and the index into request array in the lower 16 bits. * src/Mono.WebServer/BaseApplicationHost.cs: fixed documentation. 2007-08-06 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: added some more documentation. * src/Mono.WebServer/BaseRequestBroker.cs: call the UnregisterRequest handlers before freeing the request data. 2007-07-17 Marek Habersack * src/ModMonoApplicationHost.cs: it's somewhat better to unregister an event handler when it's not needed. 2007-07-16 Marek Habersack * src/Mono.WebServer/BaseRequestBroker.cs: added an event fired when the request has just been unregistered. * src/ModMonoApplicationHost.cs: add an event handler for the UnregisterRequest event in the request broker to make sure that the same request is never unregistered twice. 2007-07-09 Wade Berrier * configure.in: * docs/Makefile.am: empty file so that this dir gets included so we can build from a tarball 2007-06-22 Marek Habersack * src/Mono.WebServer/MonoWorkerRequest.cs: docs from Brian Nickel. * src/Mono.WebServer/IWebSource.cs: more docs from Brian Nickel. * src/Mono.WebServer/IApplicationHost.cs: more docs from Brian Nickel. * src/Mono.WebServer/Makefile.am (MCSFLAGS): extract xml docs. * src/Mono.WebServer/BaseRequestBroker.cs: add some documentation and avoid reallocating request buffers. Patch from Brian Nickel , thanks! * src/Mono.WebServer/BaseApplicationHost.cs: do not assume that requestBroker is not null and that it is BaseRequestBroker. Modified patch from Brian Nickel , thanks! 2007-06-20 Marek Habersack * src/ModMonoRequest.cs: added support for virtual hosts (ServerAlias) Patch from Juraj Skripsky , thanks! Closes bug #81878. * src/ModMonoApplicationHost.cs: as above 2007-06-15 Marek Habersack * src/Mono.WebServer/ApplicationServer.cs: do not skip checking the path when vhost is '*'. Patch from Brian Nickel , thanks! 2007-05-06 Wade Berrier * tools/asp_state/Makefile.am: * tools/dbsessmgr/Makefile.am: Split DATA and SCRIPTS for .exe and .exe.config so that .config doesn't have the execute bit set (otherwise, causes warning in suse's rpmlint) 2007-05-04 Marek Habersack * src/Mono.WebServer/MonoWorkerRequest.cs: avoid possible NOR. 2007-04-24 Marek Habersack * src/Mono.WebServer/BaseApplicationHost.cs: put the worker's ProcessRequest in try/catch in order to handle uncaught exceptions more gracefully. * src/Mono.WebServer/MonoWorkerRequest.cs: more robust exception handling. We no longer leave the connection open and the browser spinning after an early exception (e.g. configuration exception while reading the top-level web.config file) ocurred. 2007-04-19 Wade Berrier * configure.in: version bump -> 1.2.4 2007-04-13 Marek Habersack * src/Mono.WebServer/BaseRequestBroker.cs: replace old code that used hashtables to store request data with arrays. Array is also used to acquire a unique request id. Previously the code used GetHashCode() to do that, incorrectly assuming that the return value from the method is unique. This caused frequent race conditions and crashes. The new code uses arrays sized at 200 slots initially - this means it can handle up to 200 _concurrent_ requests before it needs to resize the arrays. * src/Mono.WebServer/XSPApplicationHost.cs: make sure worker is not null before attempting to use it. * src/ModMonoApplicationHost.cs: make sure worker is not null before attempting to use it. 2007-03-30 Marek Habersack * src/Mono.WebServer/Tracing.cs: added a utility class to help in tracing. * src/server.cs: move a line of common code out of ifdefs * src/Mono.WebServer/Makefile.am (MCSFLAGS): support tracing if enabled. (monowebserver_sources): added Tracing.cs * src/Makefile.am (MCSFLAGS): support tracing if enabled * configure.in: add a parameter to enable conditional tracing. Define TRACE together with WEBTRACE. 2007-03-29 Miguel de Icaza * src/ModMonoApplicationHost.cs: Do not try to call Close on a null stream (Stream can become null inside InnerRun) and this makes debugging with gdb harder. 2007-03-28 Miguel de Icaza * src/ModMonoRequest.cs: Only compute the data once. (GetClientBlock): if we get a -1, return the -1 to the client, do not try to call Read. 2007-03-29 Marek Habersack * src/ModMonoApplicationHost.cs: make sure request id is reset to -1 after we have unregistered it. 2007-03-02 Wade Berrier * configure.in: * src/Mono.WebServer/xsp-2.pc.in: * src/Mono.WebServer/xsp.pc.in: Use VERSION from configure.in in the .pc files (they were always 0.1 and 0.2 before, but this isn't useful since the files are xsp and xsp-2) 2007-01-25 Wade Berrier * configure.in: version bump -> 1.2.3 2007-01-05 Marek Habersack * src/Mono.WebServer/XSPWorkerRequest.cs: use the configured header encoding when outputting the headers. * src/Mono.WebServer/MonoWorkerRequest.cs: implement support for response header encoding. 2006-12-23 Gonzalo Paniagua Javier * src/Mono.WebServer/ApplicationServer.cs: set the server as stopped early on to prevent a possible nullref. Closes bug #80230. 2006-11-17 Wade Berrier * configure.in: version bump -> 1.2.1 2006-11-16 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: close the connection if there's an error reading the headers (including assembly loading exceptions due to a bad installation). * src/ModMonoApplicationHost.cs: kill the warning that everyone is worried about. 2006-09-11 Gonzalo Paniagua Javier * src/Mono.WebServer/ApplicationServer.cs: don't run BeginAccept when the server has been stopped. Fixes bug #79361. 2006-09-03 Sebastien Pouliot * src/Mono.WebServer/XSPApplicationHost.cs: Read from the stream, not the socket as the socket data is encrypted when using SSL. Fix from Jean-Francois Burdet. 2006-08-23 Wade Berrier * configure.in: * src/Makefile.am: * src/Mono.WebServer/Makefile.am: Add GACUTIL_FLAGS to make gac root dir package friendly (Relative to DESTDIR) 2006-08-16 Gonzalo Paniagua Javier * configure.in: * src/mono.snk: * src/AssemblyInfo.cs.in: * src/Makefile.am: * src/Mono.WebServer/xsp-2.pc.in: * src/Mono.WebServer/xsp.pc.in: * src/Mono.WebServer/AssemblyInfo2.cs.in: * src/Mono.WebServer/AssemblyInfo.cs.in: * src/Mono.WebServer/Makefile.am: * src/AssemblyInfoModMono.cs.in: * src/mono.pub: * scripts/Makefile.am: xsp, xsp2, Mono.WebServer and Mono.WebServer2 are installed in the GAC now to avoid problems with the upcoming patch in the runtime. 2006-08-16 Gonzalo Paniagua Javier * src/Mono.WebServer/MonoWorkerRequest.cs: * src/Mono.WebServer/XSPApplicationHost.cs: * src/ModMonoApplicationHost.cs: display unexpected errors in ProcessRequest from the root domain, as it will help pinpoint deployment errors once the upcoming patch modifies the way assemblies are loaded in newly created domains. 2006-08-03 Sebastien Pouliot * src/Makefile.am: Add a reference to Mono.Security.dll for mod-mono-server.exe * src/ModMonoWorkerRequest.cs: Add support for client certificate validation using Apache and/or Mono. * src/ModMonoApplicationHost.cs: Add PEM (Privacy Enhanced Mail) base64 decoding for certificates and set the proper variables so HttpClientCertificate can be used with mod_mono. * src/Mono.WebServer/MonoWorkerRequest.cs: Add support for special SSL variables (moved from XSPWorkerRequest.cs). * src/Mono.WebServer/XSPWorkerRequest.cs: Removed support for special SSL variables (now shared in MonoWorkerRequest.cs). 2006-07-20 Gonzalo Paniagua Javier * src/ModMonoApplicationHost.cs: don't prepend the file:// scheme, as it's currently breaking mod-mono-server 2.0. 2006-06-14 Gonzalo Paniagua Javier * src/Mono.WebServer/ApplicationServer.cs: when stopping the server, reset the 'started' variable. Fixes bug #78621. 2006-06-01 Gonzalo Paniagua Javier * tools/asp_state/asp-state.exe.config: * tools/asp_state/asp-state2.exe.config: use FQDN. 2006-05-10 Gonzalo Paniagua Javier * src/server.cs: * src/Mono.WebServer/XSPWorkerRequest.cs: * src/Mono.WebServer/BaseRequestBroker.cs: * src/Mono.WebServer/ApplicationServer.cs: * src/Mono.WebServer/XSPApplicationHost.cs: * src/Mono.WebServer/InitialWorkerRequest.cs: * src/Mono.WebServer/LingeringNetworkStream.cs: * src/Mono.WebServer/IWebSource.cs: * src/ModMonoApplicationHost.cs: accepting a connection and the initial read are now done asynchronously. SocketPool class and that Select are over now and xsp/mod-mono-server behave much better when getting many simultaneous connections. 2006-04-25 Gonzalo Paniagua Javier * src/Mono.WebServer/MonoWorkerRequest.cs: remove all the duplicated slashes and don't do an extra Replace on non-windows. 2006-04-06 Gonzalo Paniagua Javier * src/server.cs: make the hash different when the last argument is an option (like a port number). Fixes bug #78034. Thanks to Hubert Fongarnand. 2006-03-05 Robert Jordan * tools/dbsessmgr/dbsessmgr.cs: * tools/dbsessmgr/dbsessmgr.exe.config: * man/dbsessmgr.1.in: make SQL statements and parameters provider independent/configurable. Fixes bug #77698. 2006-01-25 Chris Toshok * src/Mono.WebServer/Makefile.am: define NET_2_0 in the Mono.WebServer2.dll case. * src/Mono.WebServer/XSPWorkerRequest.cs: use ConfigurationManager in 2.0. * src/Makefile.am: define NET_2_0 in the xsp2.exe/mod-moon-server2.exe cases. * src/server.cs (AppSettings): use ConfigurationManager in 2.0, and isolate the ifdef here so everywhere else we can just use "AppSettings". (Main): s/ConfigurationSettings.AppSettings/AppSettings/ * src/ModMonoWorkerRequest.cs: use ConfigurationManager in 2.0 >>>>>>> .r59119 2005-12-27 Gonzalo Paniagua Javier * src/ModMonoRequest.cs: use UTF8 instead of the default encoding. Fixes bug #77074. 2005-11-02 Gonzalo Paniagua Javier * src/ModMonoWorkerRequest.cs: don't append the index file name after the path in presence of path_info. Fixes bug #76604. 2005-11-02 Gonzalo Paniagua Javier * src/ModMonoWorkerRequest.cs: * src/ModMonoRequest.cs: * src/server.cs: * src/Mono.WebServer/ApplicationServer.cs: * src/ModMonoApplicationHost.cs: added support for dynamically created ASP.NET applications. * man/xsp.1.in: documented the --master option. 2005-10-21 Gonzalo Paniagua Javier * src/ModMonoWorkerRequest.cs: * src/ModMonoRequest.cs: server variables are now read when getting the initial data. * src/Makefile.am: don't show warning 618. * src/Mono.WebServer/Makefile.am: Modified file. * src/ModMonoApplicationHost.cs: s/Mono.Posix/Mono.Unix/ 2005-10-11 Gonzalo Paniagua Javier * src/ModMonoRequest.cs: all the server variables are now written at once from mod_mono. 2005-09-29 Sebastien Pouliot * src/server.cs: Added *all* new options in --help. * man/xsp.1.in: Fixed typo. 2005-09-29 Sebastien Pouliot * src/Makefile.am: Added security.cs to the build. * src/server.cs: Removed security configuration from the source. Added new options for client certificates and pkcs#12 support. * src/security.cs: New. Keep all security configuration in a single place. Added support (and logic) to support certificates and keys inside PKCS#12 files. * src/Mono.WebServer/XSPApplicationHost.cs: Add support for mandatory client certificates. * man/xsp.1.in: Updated man page with the new options for client side certificates and pkcs#12 files support. 2005-09-26 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: when the connection is secure, use the regular stream. 2005-09-19 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: return 0 when trying to read the entity body from a GET/HEAD request. * src/Mono.WebServer/XSPApplicationHost.cs: * src/ModMonoApplicationHost.cs: moved Run into InnerRun. MS was throwing a TypeLoadException before running the method and we didn't catch that one, so the connection wasn't being closed. 2005-09-19 Gonzalo Paniagua Javier * src/ModMonoRequest.cs: when reading a string from mod_mono, handle short reads. From a patch by Mathias Herberts. 2005-09-19 Gonzalo Paniagua Javier * src/ModMonoRequest.cs: avoid 500 response when the body was actually sent. Patch by dean@brettle.com that fixes bug #76124. 2005-09-07 Gonzalo Paniagua Javier * src/Mono.WebServer/MonoWorkerRequest.cs: * src/Mono.WebServer/XSPWorkerRequest.cs: * src/Mono.WebServer/XSPApplicationHost.cs: added support for client certificates. Patch by Sebastien Pouliot. 2005-09-05 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: sendfile() might need to be called more than once for big files (tried with a 1GiB one). Fixes bug #75926. 2005-09-01 Gonzalo Paniagua Javier * src/ModMonoRequest.cs: write all the headers at once. 2005-08-28 Gonzalo Paniagua Javier * src/ModMonoWorkerRequest.cs: pretend the client is HTTP/1.0 so that System.Web does not tries to send chunked content. Apache will take care of that. If the Flush is final, call CloseConnection. Implemented sendfile support * src/ModMonoRequest.cs: added SEND_FILE command an increased version number. * src/Mono.WebServer/MonoWorkerRequest.cs: use the IntPtr version of SendResponseFromFile if no override is available. * src/Mono.WebServer/XSPWorkerRequest.cs: removed TODO. * src/ModMonoApplicationHost.cs: SendFile support. 2005-08-26 Gonzalo Paniagua Javier * src/Mono.WebServer/MonoWorkerRequest.cs: default encoding will be latin1. * src/Mono.WebServer/XSPWorkerRequest.cs: if we're running on linux, use send, setsockopt and sendfile from libc. No more buffering done but for the headers. Use TCP_CORK. Use sendfile() for SendResponseFromFile when possible. * src/Mono.WebServer/ApplicationServer.cs: catch a possible error. * src/Mono.WebServer/XSPApplicationHost.cs: pass the socket handle to the worker request. * src/Mono.WebServer/InitialWorkerRequest.cs: work directly on the input buffer instead of calling ReadByte(). * src/Mono.WebServer/Makefile.am: add -unsafe flag. 2005-08-26 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: if we get a 0, don't pretend we read up to 'size'. * src/Mono.WebServer/XSPApplicationHost.cs: returning 0 in Read is fine. 2005-08-26 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: if we get a -1 when reading the request, the client closed or there was an error. For a 0 we just return what we have so far. 2005-07-26 Gonzalo Paniagua Javier * configure.in: * src/Makefile.am: * src/Mono.WebServer/xsp-2.pc.in: * src/Mono.WebServer/xsp.pc.in: * src/Mono.WebServer/key.snk: * src/Mono.WebServer/AssemblyInfo2.cs.in: * src/Mono.WebServer/AssemblyInfo.cs.in: * src/Mono.WebServer/Makefile.am: * scripts/Makefile.am: bye bye gacutil, welcome "Application Deployment Guidelines". 2005-06-22 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPApplicationHost.cs: if reading from the socket returns 0 bytes, signal it returning a -1 in Read. 2005-06-17:2 Rafael Teixeira * test/button-vb.aspx: small typo correction 2005-06-17 Rafael Teixeira * tools/asp_state/asp_state.cs: find configuration filename to match the executable name and path plus ".config", that fix not finding the oldnamed "asp_state.exe.config" what make it work for asp-state2.exe, besides it was looking for the configuration file in the current dir, not the dir containing the executable. Also for first timers like me be a bit more verbose and don't start if some command line arguments are passed (I tried a asp-state --help and got baffled). 2005-06-11 Gonzalo Paniagua Javier * src/Mono.WebServer/BaseRequestBroker.cs: keep a cache of the buffers passed through remoting instead of creating a new one in all the cases. 2005-06-11 Gonzalo Paniagua Javier * src/Mono.WebServer/XSPWorkerRequest.cs: platform check. 2005-06-10 Gonzalo Paniagua Javier * src/Mono.WebServer/LingeringNetworkStream.cs: really keep lingering for 30s. 2005-06-05 Ben Maurer * configure.in: handle gacutil more correctly :-) 2005-06-02 Ben Maurer * src/Mono.WebServer/Makefile.am: Handle gacutil and destdir correctly. * configure.in: GACUTIL flags 2005-06-01 Gonzalo Paniagua Javier * configure.in: * src/Mono.WebServer/AssemblyInfo.cs: renamed into... * src/Mono.WebServer/AssemblyInfo.cs.in: ...this. * src/Mono.WebServer/Makefile.am: don't use -keyfile, as csc does not support it. Now 'distcheck' passes and the build works on windows. 2005-06-01 Gonzalo Paniagua Javier * src/XSPApplicationHost.cs: Removed file. * src/InitialWorkerRequest.cs: Removed file. * src/XSPWorkerRequest.cs: Removed file. * src/Makefile.am: Modified file. * src/Mono.WebServer/Makefile.am: moved some 'meat' to Mono.WebServer. xsp.exe is now just 'server.cs' + classes in Mono.WebServer. 2005-05-31 Raja R Harinath Fix 'make distcheck'. * src/Mono.WebServer/Makefile.am (EXTRA_DIST): Add key.snk. (Mono.WebServer.dll): Pass /keyfile: option. * src/Mono.WebServer/AssemblyInfo.cs (AssemblyKeyFile): Disable. 2005-05-30 Gonzalo Paniagua Javier * configure.in: * server/MonoWorkerRequest.cs: * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: * server/Tracing.cs: * server/BaseRequestBroker.cs: * server/ApplicationServer.cs: * server/BaseApplicationHost.cs: * server/LingeringNetworkStream.cs: * server/Makefile.am: * server/IWebSource.cs: * server/Mono.WebServer: * server/Mono.WebServer/AssemblyInfo.cs: * server/Mono.WebServer/Makefile.am: * server/IApplicationHost.cs: * server/Mono.WebServer/*: moved Mono.WebServer.dll files into a new directory. 2005-05-16 Gonzalo Paniagua Javier * configure.in: HEAD is now 1.1.x * server/AssemblyInfoModMono.cs.in: * server/XSPApplicationHost.cs: * server/InitialWorkerRequest.cs: * server/AssemblyInfo.cs.in: * server/Makefile.am: * server/server.cs: this is now Mono.WebServer.dll. xsp.exe is there just to pass the options to the new assembly. Most of the patch by Brian Ritchie. 2005-05-08 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: call the EndOfSend notification when the request is told to be ended. 2005-05-07 Ben Maurer * configure.in: put the full path to mono in RUNTIME * */Makefile.am: s.$libdir.$prefix/lib, since that's what mono uses. Also, for scripts, use RUNTIME rather than just `mono'. 2005-05-07 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: implemented IsClientConnected. * server/ModMonoRequest.cs: added IsConnected and increased version number. * server/BaseRequestBroker.cs: * server/ModMonoApplicationHost.cs: Close the current connection before stopping the server when a shutdown request is received. * server/XSPApplicationHost.cs: * server/IWebSource.cs: IsConnected is now part if IWorker interface. 2005-05-03 Ben Maurer * configure.in: 1.0.9 2005-04-27 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: * server/ModMonoRequest.cs: Default -> DefaultInvariant. Also don't send a FLUSH command to mod_mono, as it's ignored. 2005-04-20 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: * server/XSPApplicationHost.cs: fix warnings and ensure we call Close if an error happens when writing to the stream. 2005-04-19 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: we can set a few server variables here. * server/ApplicationServer.cs: remove the socket from the active list on timeout so that we don't attempt to use it and delay the error. 2005-04-01 Gonzalo Paniagua Javier * server/ApplicationServer.cs: use a foreground thread to stop the server instead of one from the threadpool. Patch from Rob Lyon that fixes bug #73357. 2005-03-18 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: the lockfile is to be removed even for TCP sockets. Also return immediately if the module wants us to die. * server/ApplicationServer.cs: call Dispose on the web source so that removing the lockfile and the unix socket is done asap. * server/XSPApplicationHost.cs: added empty Dispose(). * server/IWebSource.cs: IWebSource inherits from IDisposable now. This fixes bug #73619. 2005-03-18 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: prevent empty lines before the actual request from causing an error. Fixes bug #73048. 2005-03-05 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: don't print the exception to apache logs so that connection probing does not polute them. 2005-03-05 Gonzalo Paniagua Javier * server/ApplicationServer.cs: prevent premature stop from mod_mono from not doing the clean up. Patch from Rob Lyon. 2005-03-05 Gonzalo Paniagua Javier * server/server.cs: fix lockfile name generation. Patch by Mike Lasky. Closes bug #73234. 2005-03-02 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: ensure we close the stream to the mod_mono socket after Decline, NotFound and in Close. Thanks to Mike Lasky for spotting the bug. 2005-02-24 Gonzalo Paniagua Javier * configure.in: mktemp failed on *BSD. 2005-02-20 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: * server/ModMonoTCPWebSource.cs: * server/server.cs: use a FileStream as a lock to prevent running more than one mod-mono-server with the same arguments. 2005-02-20 Gonzalo Paniagua Javier * Released 1.0.6 2005-02-11 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: override IsSecure and implement it. Part of the fix for bug #71680. 2005-02-11 Gonzalo Paniagua Javier * configure.in: detect if gmcs actually works. Patch by Robert Jordan. 2005-02-08 Raja R Harinath * test/2.0/treeview/Makefile.am (install-data-hook,uninstall-hook): Support $(DESTDIR). 2005-02-04 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: now they use a common method to get the pathinfo and pathinfo works with apache too. * server/ModMonoRequest.cs: when there's a version mismatch, print it everywhere so that it gets to apache logs. * server/ApplicationServer.cs: new Paths class containing a method for getting the path and pathinfo from an uri. * server/InitialWorkerRequest.cs: no pathinfo computation here. * server/XSPApplicationHost.cs: removed pathinfo parameter. * server/Makefile.am: xsp2.exe was being installed to xsp directory !? 2005-02-01 Gonzalo Paniagua Javier * server/ApplicationServer.cs: added BadRequest () to HttpErrors. * server/XSPApplicationHost.cs: if there's a failure reading the request, write back a 400 error to the client. Patch by Russ Young. 2005-01-26 Lluis Sanchez Gual * configure.in: Added masterpages test directory. * test/2.0/masterpages: New master page tests. * test/2.0/menu/menu1.aspx: Updated. 2005-01-21 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: if the headers have not been sent and someone closes the connection, don't try to reuse it. Discovered thanks to buggy user code. 2005-01-20 Gonzalo Paniagua Javier * server/ApplicationServer.cs: locks in SocketPool. Fixes bug #70388. 2005-01-20 Gonzalo Paniagua Javier * configure.in: * server/Makefile.am: don't build mod-mono-server if compiling with csc. 2005-01-20 Lluis Sanchez Gual * configure.in: Added new test makefiles. 2005-01-20 Lluis Sanchez Gual * server/InitialWorkerRequest.cs: Fix parsing of PathInfo. 2005-01-19 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: when Content-Length is set only allow sending that amount of bytes in the body. Fixes bug #71092. 2005-01-13 Raja R Harinath * server/MonoWorkerRequest.cs: Update to compile with the stricter name-resolution of MCS. 2004-12-21 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: * server/XSPApplicationHost.cs: * server/LingeringNetworkStream.cs: the connection is now closed if we get an error writing to the socket. 2004-12-15 Raja R Harinath * server/Makefile.am (CLEANFILES): Clean up *.exe and *.mdb. * tools/dbsessmgr/Makefile.am (EXTRA_DIST): Add dbsessmgr2.exe.config. (CLEANFILES): Clean up *.exe and *.mdb. * tools/asp_state/Makefile.am (EXTRA_DIST): Add asp-state2.exe.config. (CLEANFILES): Clean up *.exe and *.mdb. * scripts/Makefile.am (CLEANFILES): Fix typos. Clean up all the scripts. 2004-12-13 Gonzalo Paniagua Javier * configure.in: * server/Makefile.am: if gmcs is available, build xsp2.exe and mod-mono-server2.exe using the 2.0 assemblies. 2004-12-11 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: first remove the socket, then close it. Seems like the GetHashCode method returns a different value after the socket is closed. Fixes bug #70449. 2004-12-10 Raja R Harinath * doc/Makefile.am (mod-mono-server.1): Fix non-srcdir build. * scripts/Makefile.am ($(bin_SCRIPTS)): Likewise. * server/Makefile.am (xsp_only): Remove AssemblyInfo.cs.in. (xsp_build_sources): Add AssemblyInfo.cs. (modmono_only): Remove AssemblyInfoModMono.cs.in. (modmono_build_sources): Add AssemblyInfoModMono.cs. (EXTRA_DIST): Add AssemblyInfo.cs.in and AssemblyInfoModMono.cs.in. (xsp.exe, mod-mono-server.exe): Remove GNU-makeism. 2004-12-10 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: don't print IOExceptions caused by socket read/write errors and don't send back a 500 error on IOExceptions or error reading request line. Fixes bug #70391. 2004-12-07 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: if we don't have a Content-Length, force closing the connection. 2004-12-02 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: this typo prevented the underlying sys.web from knowing the real http version used. If you've seen stack traces showing ChunkStream when running *xsp*, that's over now. 2004-11-24 Alp Toker * server/XSPApplicationHost.cs: remove slash. 2004-11-24 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: * server/ModMonoRequest.cs: * server/BaseRequestBroker.cs: * server/AssemblyInfoModMono.cs.in: * server/ModMonoApplicationHost.cs: * server/ApplicationServer.cs: * server/InitialWorkerRequest.cs: * server/BaseApplicationHost.cs: * server/XSPApplicationHost.cs: * server/ModMonoTCPWebSource.cs: * server/AssemblyInfo.cs.in: * server/LingeringNetworkStream.cs: * server/server.cs: * server/IWebSource.cs: * server/IApplicationHost.cs: * COPYING: relicensed under MIT style license. 2004-11-24 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: max. line length for headers is now 8kB. * server/ApplicationServer.cs: don't Exit in Stop(). Call the new AppHost.Unload instead of just AppDomain.Unload, as that does not seem to trigger the Application_End event under MS runtime. Fixes bug #68709. * server/BaseApplicationHost.cs: new method Unload() that calls HttpRuntime.UnloadAppDomain for the current application. * server/InitialWorkerRequest.cs: maximum length for the request line is now 8kB. * server/IApplicationHost.cs: added Unload() to the interface. 2004-11-21 Gonzalo Paniagua Javier * test/global.asax: added code here. * doc/xsp.1.in: added information on --terminate and for .webapp files. * test/sample.webapp: aded * server/ApplicationServer.cs: don't bail out if the directory given in --appconfigdir does not exist. If the no exists and is 'false', don't set up that application. 2004-11-21 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: support for --terminate. Ensure that no one else is listening on the same unix socket. * server/ModMonoTCPWebSource.cs: support for --terminate. * server/server.cs: added --terminate option to mod-mono-server. You can use it to gracefully terminate a running mod-mono-server. 2004-11-12 Gonzalo Paniagua Javier * configure.in: remove MKDIR_P * server/InitialWorkerRequest.cs: don't print the exception if the stream is not reused. * autogen.sh: aclocal goes first. 2004-11-11 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: if the client is HTTP/1.1 or sends a keep-alive connection header, we keep the connection opened for 15 seconds waiting for more requests. * server/ApplicationServer.cs: Modified file. * server/InitialWorkerRequest.cs: throw a different exception if something fails reading the request line. * server/XSPApplicationHost.cs: Don't print errors due to socket read timeout. Handle keep-alive connections. 2004-11-02 Gonzalo Paniagua Javier * server/ApplicationServer.cs: workaround a bug in MS socket Select implementation. * server/server.cs: undo workaround for bug #65533. 2004-10-29 Gonzalo Paniagua Javier * Released 1.0.4. 2004-10-29 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: redirect on directories that are not the root virtual directory when the path does not end in '/'. Fixes bug #68082. 2004-10-17 Ben Maurer * server/MonoWorkerRequest.cs (MapPath): avoid the concat here. 2004-10-14 Gonzalo Paniagua Javier * server/ApplicationServer.cs: set the accepted socket to Blocking. 2004-10-03 Ben Maurer * server/ApplicationServer.cs: use UtcNow 2004-09-30 Gonzalo Paniagua Javier * test/web_regularexpressionvalidator.aspx: improved example. Patch by Tomasz Rybak. 2004-09-29 Ben Maurer * server/LingeringNetworkStream.cs: make the byte [] buffer static here. It is not of consequence what we write to the buffer so we may as well cache it. * server/XSPWorkerRequest.cs: Avoid String.Format related stuff, just append to the stringbuilder. 2004-09-28 Ben Maurer * server/XSPApplicationHost.cs: rather than pass an ip addr across appdomains as a string, pass it as a long. this avoids the cost of making it into a string, and related allocations. 2004-09-28 Gonzalo Paniagua Javier * server/ApplicationServer.cs: application server never dies. * test/web_table2.aspx: added missing runat attributes. 2004-09-24 Gonzalo Paniagua Javier * configure.in: 1.0.2.99 * server/ApplicationServer.cs: allow unloading applications. Fixed warnings. * server/BaseApplicationHost.cs: when the domain is unloaded, tell the application server we don't exist any more. * server/BaseRequestBroker.cs: added some sanity checks. * server/IApplicationHost.cs: added Server to the interface. * server/ModMonoRequest.cs: * server/ModMonoWorkerRequest.cs: * server/ModMonoApplicationHost.cs: if apache is stopping, tell the application server to finish everything off. * server/XSPWorkerRequest.cs: * server/XSPApplicationHost.cs: fixed warnings. * server/server.cs: if running interactive, unload all applications before exiting. 2004-09-12 Gonzalo Paniagua Javier * server/ApplicationServer.cs: make the server socket non-blocking and ignore any exception on Accept. 2004-09-12 Ben Maurer * server/server.cs: allow for clean exit (workaround) * server/XSPWorkerRequest.cs: avoid a remoting call. cache MemoryStreams * InitialWorkerRequest.cs: cache byte [] buffers. 2004-09-04 Gonzalo Paniagua Javier * configure.in: added AM_MKDIR_P to make automake 1.8 happier. 2004-08-31 Gonzalo Paniagua Javier * server/ApplicationServer.cs: don't set the socket timeout for mod-mono-server. Apache should take care of that. * server/BaseApplicationHost.cs: * server/BaseRequestBroker.cs: * server/ModMonoApplicationHost.cs: unregister the request in EndOfRequest event because under heavy load HttpRuntime.ProcessRequest might return immediately and queue the request for later processing. * server/XSPApplicationHost.cs: unregister the request when redirecting * server/MonoWorkerRequest.cs: * server/ModMonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: RequestId is now part of MonoWorkerRequest interface. 2004-08-17 Gonzalo Paniagua Javier * server/ApplicationServer.cs: ignore exceptions when setting socket options as there are systems that don't support them. Fixes bug #63031. 2004-08-04 Gonzalo Paniagua Javier * nunit-tests/standalone/Makefile.am: * tools/nunitasp/source/NUnitAspTest/Makefile.am: fix distcheck on a clean system and remove warnings. 2004-08-04 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: GetRequestHeader is case insensitive now. Thanks to Jan Jaros. 2004-08-02 Gonzalo Paniagua Javier * Makefile.am: * configure.in: * nunit-tests/standalone/Makefile.am: * scripts/.cvsignore: * scripts/Makefile.am: * scripts/script.in: * server/Makefile.am: * tools/asp_state/Makefile.am: * tools/dbsessmgr/Makefile.am: * tools/nunitasp/source/NUnitAsp/Makefile.am: * tools/nunitasp/source/NUnitAspTest/Makefile.am: added xsp and mod-mono-server scripts, remove .mdb files when cleaning. 2004-07-30 Gonzalo Paniagua Javier * server/ApplicationServer.cs: fix host matching in presence of *. Closes bug #61275. * server/ModMonoWorkerRequest.cs: don't duplicate the slash when setting a default file name that we know is not present. 2004-07-29 Gonzalo Paniagua Javier * configure.in: 1.0.1. * server/ApplicationServer.cs: don't timeout in Select when we only have the listener socket. Use real times for timeout. 2004-07-28 Gonzalo Paniagua Javier * server/ApplicationServer.cs: increased the backlog for listen, set accepted sockets read/write timeout to 15s and handle timeouts when reading request data before submitting the work item to the threadpool. * server/XSPApplicationHost.cs: don't write a 500 error response if we got an IOException when reading from the network stream. * server/XSPWorkerRequest.cs: if there's an IOException when reading the headers, just rethrow it. 2004-07-19 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: don't write the 50x error response to the stream. Just closing works and doesn't drive mod_mono crazy. 2004-07-14 Gonzalo Paniagua Javier * test/Makefile.am: * test/chunked.ashx: the output of this handler should be chunked for 1.1 clients and 1.0 clients that send the Accept-Encoding to 'chunked'. 2004-07-13 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: * server/ModMonoRequest.cs: * server/ModMonoWorkerRequest.cs: when we can't find a suitable application, return NOT_FOUND to mod_mono. 2004-07-10 Gonzalo Paniagua Javier * server/Makefile.am: added ModMonoTCPWebSource. * server/ModMonoApplicationHost.cs: in ModMonoWebSource, CreateSocket is now virtual and the .ctor receives the file name as parameter. * server/ModMonoRequest.cs: prevent absurd string sizes if the socket is not in a expected state. * server/ModMonoTCPWebSource.cs: supports mod_mono communication over a TCP socket. * server/XSPApplicationHost.cs: XSPWebSource .ctor receives address and port as parameters. * server/server.cs: updated help, handle address and port in mod-mono-server. Choose TCP or unix socket IWebSource depending on the arguments. 2004-07-09 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: made the headers Hashtable case insensitive. 2004-07-08 Gonzalo Paniagua Javier * server/BaseRequestBroker.cs: Modified file. * server/ModMonoRequest.cs: more data cached on first read. * server/ModMonoWorkerRequest.cs: use Buffer.BlockCopy instead of Array.Copy. 2004-07-07 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: remove the unix socket file when finishing. * test/Makefile.am: added missing files. * test/mono-xsp.css: * test/index.aspx: reduced size of the generated page. 2004-07-07 Gonzalo Paniagua Javier * server/ModMonoApplicationHost.cs: * server/ModMonoWorkerRequest.cs: * server/ModMonoRequest.cs: removed unused method/options and the ack sent back after writing something. Unified setting status code and message into 1 single command. 2004-06-30 Gonzalo Paniagua Javier * Released 1.0. 2004-06-24 Gonzalo Paniagua Javier * configure.in: 0.15.99. * server/ApplicationServer.cs: added method in VPathToHost that tells if we're trying /xxx where xxx is a directory (ie, we need to redirec). * server/InitialWorkerRequest.cs: don't remove trailing '/' in GetSafePath (). * server/XSPApplicationHost.cs: handle redirects and fixed nullref. Closes bug #60478. * ChangeLog: style. * server/ModMonoApplicationHost.cs: splitted long lines. * server/MonoWorkerRequest.cs: style. 2004-06-20 Lluis Sanchez Gual * IApplicationHost.cs: Added RequestBroker property to IApplicationHost. The application host will query for information through this object, which lives in the main domain. * Makefile.am: Added new files. * ModMonoRequest.cs: Added position parameter in SendResponseFromMemory, so we can send partially filled buffers. GetClientBlock(): Some checks that where done in ModMonoWorkerRequest have been moved here. We can avoid two cross-app domain calls in this way. Merged SetStatusCode and SetStatusLine into SetStatusCodeLine. We avoid another cross-app domain call. * ModMonoWorkerRequest.cs: Renamed to ModMonoWorkerRequest, to make things more understandable. Removed all references to ModMonoRequest. All request information is now available as input parameters or through the IRequestBroker. Some old calls to ModMonoRequest have been merged into a single IRequestBroker call, to avoid the overhead of a cross-app domain call. * XSPApplicationHost.cs: Most of the code has been moved to other classes: ApplicationServer, WebSource, XSPWebSource, ModMonoWebSource... * XSPWorkerRequest.cs: Removed dependency to RequestData, since passing it through the cross-app domain channel requires serialization support. The same information is passed as primitive parameters. In general, calls to the network stream are now done through the IRequestBroker. * server.cs: Create the ApplicationServer by providing a ModMonoWebSource or a XSPWebSource instance. * ApplicationServer.cs: New file. Moved here the old XSPApplicationServer. Almost all code is now shared between XSP and mod_mono. Specific behavior is now encapsulated in an IWebSource object. * LingeringNetworkStream.cs: New file. Moved here the old MyNetworkStream. * BaseApplicationHost.cs: New file. Moved here the old XSPApplicationHost. * WebSource.cs: New file. Defines the IWebSource and IWorker interfaces. * XSPApplicationHost.cs: New file. Provides an implementation for XSP of a IWebSource, an IRequestBroker, an IApplicationHost and an IWorker. * ModMonoApplicationHost.cs: New file. Provides an implementation for mod_mono of a IWebSource, an IRequestBroker, an IApplicationHost and an IWorker. 2004-06-19 Gonzalo Paniagua Javier * test/Makefile.am: install extensions.dll into test directory so that ServiceClient.exe runs fine. 2004-06-15 Gonzalo Paniagua Javier * test/favicon.ico: * test/index.aspx: * test/mono-powered-big.png: * test/mono-xsp.css: * test/monobutton.png: * test/small-icon.png: better appearance. Patch from Antonio Ognio. 2004-06-14 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: allow wilcard for vhosts, fixed matching of /xxx when we have a vhost for /xxx/, matching moved to VPathToHost class and improved. When creating a new host, lock on the VPathToHost object, not the entire array of vhosts. * server/server.cs: don't allow duplicated options passed in the command line. No need to wait on a handle when --nonstop. Just make the runner thread have IsBackGround to false and finish the main one. 2004-06-12 Gonzalo Paniagua Javier * test/dbpage1.aspx: * test/dbpage2.aspx: fixed connection leaks by adding a Page_Unload method that closes the connection. 2004-06-11 Gonzalo Paniagua Javier * test/Makefile.am: added typedesc.* * test/typedesc.(aspx|cs): sample test control showing how a Type that has a TypeDescriptor can be saved/restored to/from ViewState. 2004-06-10 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: only send the Close to the module once. * server/XSPApplicationHost.cs: added new class MyNetworkStream that handles lingering close for xsp standalone like apache does. Fixes bug #59688. BIG THANKS to David Taylor. * server/XSPWorkerRequest.cs: ensure we read all the data requested for the request body. Only call stream.Close once. 2004-06-05 Gonzalo Paniagua Javier * test/web.config: commented out gzip and mono.aspnet. It's causing troubles some times. 2004-06-03 Gonzalo Paniagua Javier * doc/xsp.1.in: * server/server.cs: don't flag --applications as deprecated. 2004-06-03 Gonzalo Paniagua Javier * test/serial.aspx: test that I used when gathering information to fix bug #59495. 2004-06-02 Gonzalo Paniagua Javier * INSTALL: added note for windows users. * configure.in: 0.14.99 * server/InitialWorkerRequest.cs: UrlDecode the path and check safety. Fixes bug #59429. 2004-06-02 Gonzalo Paniagua Javier * Released 0.14 2004-05-30 Jackson Harper * configure.in: * doc/.cvsignore: * doc/Makefile.am: * doc/asp_state.1.in: Add asp_state man page. 2004-05-28 Gonzalo Paniagua Javier * configure.in: * doc/.cvsignore: * doc/Makefile.am: * doc/dbsessmgr.1.in: * doc/xsp.1.in: added dbsessmgr manual page. * nunit-tests/standalone/Makefile.am: * tools/dbsessmgr/AssemblyInfo.cs.in: * tools/nunitasp/source/NUnitAsp/Makefile.am: * tools/nunitasp/source/NUnitAspTest/Makefile.am: build fixes. * tools/asp_state/asp_state.exe.config: added ?xml stuff. * tools/dbsessmgr/dbsessmgr.cs: use LoadWithPartialName. 2004-05-28 Gonzalo Paniagua Javier * INSTALL: * README: updated. 2004-05-28 Gonzalo Paniagua Javier * doc/xsp.1.in: added .webapp file format details and updated. * server/server.cs: UnixSocketFileName -> MonoUnixSocket. Mark --applications as deprecated. 2004-05-26 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: only support HTTP 1.0 in xsp.exe. 2004-05-20 Gonzalo Paniagua Javier * server/AssemblyInfo.cs.in: * server/AssemblyInfoModMono.cs.in: upadted year. * server/InitialWorkerRequest.cs: don't UrlDecode the path at this stage. 2004-05-19 Gonzalo Paniagua Javier * NEWS: * README: updated. * configure.in: * doc/Makefile.am: * doc/xsp.1.in: updated manual page and install the same one for mod-mono-server. * doc/xsp.1: Removed. 2004-05-19 Gonzalo Paniagua Javier * server/Makefile.am: InitialWorkerRequest.cs is only needed for xsp. * server/XSPApplicationHost.cs: * server/server.cs: support for virtual hosts in mod-mono-server by Jaroslaw Kowalsky. * test/Makefile.am: * test/datalist.aspx: * test/sample.webapp: added new files. 2004-05-14 Gonzalo Paniagua Javier * ChangeLog: forgot an entry. * configure.in: 0.13.99 * test/tabcontrol.cs: don't try to serialize a StateBag. 2004-05-06 Sebastien Pouliot * INSTALL: Removed notes about RNG on Windows as this had been fixed for some times. 2004-05-04 Gonzalo Paniagua Javier * test/dbpage1.aspx: * test/dbpage2.aspx: * test/mod-mono-server.exe.config: * test/web.config: don't use the deprecated Mono.Data.PostgresqlClient, but Npgsql. 2004-05-03 Gonzalo Paniagua Javier * test/Makefile.am: install the sample dlls to the right place. Thanks to Pablo Baena. 2004-05-03 Gonzalo Paniagua Javier * tools/nunitasp/source/NUnitAspTest/Makefile.am: fixed distcheck and don't install NUnitAspTest.dll. 2004-05-03 Gonzalo Paniagua Javier * INSTALL: added note on building using CSC. * test/mod-mono-server.exe.config: * test/web.config: use Version and PublicKeyToken where applicable. 2004-04-22 Gonzalo Paniagua Javier * NEWS: * ChangeLog: updated. * server/ModMonoWorkerRequest.cs: fixed buglet that made unknown headers not pass from mod_mono to System.Web. Shame on me. 2004-04-21 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: fixed PathInfo for mod_mono. Smells like a new release. Released 0.11. 2004-04-21 Gonzalo Paniagua Javier * NEWS: updated. * server/ModMonoRequest.cs: * server/ModMonoWorkerRequest.cs: marshal 2 string arrays instead of a Hashtable for request headers. Released 0.10. 2004-04-08 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: try the default index pages as the standalone xsp does. 2004-04-06 Gonzalo Paniagua Javier * AUTHORS: * configure.in: * nunit-tests/Makefile.am: * nunit-tests/standalone/Makefile.am: * server/Makefile.am: * test/.cvsignore: * test/Makefile.am: * test/TestService.asmx: * test/authtest/.cvsignore: * test/authtest/Makefile.am: * tools/asp_state/.cvsignore: * tools/asp_state/Makefile.am: * tools/dbsessmgr/.cvsignore: * tools/dbsessmgr/Makefile.am: * tools/nunitasp/source/Makefile.am: * tools/nunitasp/source/NUnitAsp/.cvsignore: * tools/nunitasp/source/NUnitAsp/Makefile.am: * tools/nunitasp/source/NUnitAsp/AspTester/.cvsignore: * tools/nunitasp/source/NUnitAsp/AspTester/Makefile.am: * tools/nunitasp/source/NUnitAsp/HtmlTester/.cvsignore: * tools/nunitasp/source/NUnitAspTest/.cvsignore: * tools/nunitasp/source/NUnitAspTest/Makefile.am: * tools/nunitasp/source/NUnitAspTest/AspTester/.cvsignore: * tools/nunitasp/source/NUnitAspTest/AspTester/Makefile.am: * tools/nunitasp/source/NUnitAspTest/HtmlTester/.cvsignore: makefile love. distcheck works now. Fixes bug #53652. * nunit-tests/standalone/Makefile.in: * server/Makefile.in: * test/Makefile.in: * tools/asp_state/Makefile.in: * tools/dbsessmgr/Makefile.in: * tools/nunitasp/source/NUnitAsp/Makefile.in: * tools/nunitasp/source/NUnitAspTest/Makefile.in: removed 2004-04-04 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: HostVPath treated as HostVPath + "/". * server/XSPApplicationHost.cs: replaced CR by CRLF in error messages sent to the client. Close the connection if we're writing an error. * server/XSPWorkerRequest.cs: replaced CR by CRLF and added the server header to the error. * server/server.cs: removed useless line. 2004-03-22 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: really close the opened connection. Patch from Jan Jaros. 2004-01-16 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: apply the same changes as in XSPWorkerRequest.cs related to PathInfo. Patch by Chris Turchin. This makes blogx work with mod_mono. 2004-01-08 Martin Willemoes Hansen * test/web_adrotator.xml: Added a ad for Mono, now the control realy shows its rotation capability. 2004-01-03 Gonzalo Paniagua Javier * Makefile.am: added nunit-tests to SUBDIRS. * server/Makefile.in: * test/Makefile.in: * tools/asp_state/Makefile.in: * tools/dbsessmgr/Makefile.in: * tools/nunitasp/source/NUnitAsp/Makefile.in: * tools/nunitasp/source/NUnitAspTest/Makefile.in: added distclean target. 2003-12-16 Gonzalo Paniagua Javier * server/server.cs: beutified error on --address argument. Fixes bug #52208. 2003-12-11 Gonzalo Paniagua Javier * configure.in: * nunit-tests/Makefile.am: * nunit-tests/standalone/Makefile.in: * nunit-tests/standalone/bug51682-1.aspx: * nunit-tests/standalone/bug51682-1.cs: added first standalone test. 2003-12-11 Gonzalo Paniagua Javier * configure.in: * tools/Makefile.am: added nunitasp to the build. 2003-12-02 Gonzalo Paniagua Javier * Released 0.8. 2003-11-26 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: added EndOfRequestEvent and invoke it in the override of EndOfRequest. * server/XSPApplicationHost.cs: use the new event and close the socket when notified of request end. This makes xsp work under heavy load too, when HttpRuntime.ProcessRequest returns inmediately. 2003-11-24 Jackson Harper * tools/asp_state/asp_state.exe.config: Use same port as MS, load the RemoteStateServer from System.Web. 2003-11-24 Jackson Harper * server/ModMonoRequest.cs: cache the result of the first (and unique) SetupClientBlock. Return false when should not block. * server/ModMonoWorkerRequest.cs: removed staled stuff. First do a 'should' and then setup the client block. 2003-11-17 Duncan Mak * server/Makefile.in (LOCAL_BIN_DIR): * test/Makefile.in (SAMPLES_DIR, SAMPLES_BIN_DIR): Use $(DESTDIR)$(prefix) instead of @prefix@. This is needed for the build system. 2003-11-16 Gonzalo Paniagua Javier * doc/xsp.1: updated. * server/AssemblyInfo.cs.in: * server/AssemblyInfoModMono.cs.in: Novell. * server/server.cs: handle wrong --root directories. 2003-11-05 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: no need to create a full WorkerRequest when we just want to get the uri information. * server/XSPApplicationHost.cs: removed workaround for the bug. 2003-10-28 Pedro Martínez Juliá * server/XSPApplicationHost.cs: add a few lines to set the domain data requested by XSPWorkerReqest (SimpleWorkerRequest). These are garbage lines because they are used only for the main application and there must be other way to get mod-mono-server working without this little hack. * test/Makefile.in: add "*.inc" and "*.xsl" to the install wildcard list. These files are needed by other "*.aspx" files. 2003-10-23 Gonzalo Paniagua Javier * server/IApplicationHost.cs: reduced to the minimum. * server/ModMonoRequest.cs: removed unused Hashtable and make the headers hashtable case insensitive. * server/XSPApplicationHost.cs: new class HttpErrors. Splitted XSPApplicationHost. Now there's a XSPApplicationServer which does the server work and creates the XSPApplicationHosts. Lock when adding new applications to dirToHost (thanks Lluis!) * server/server.cs: use XSPApplicationServer. 2003-10-09 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: reduced up to the minimum needed before it's serialized, as suggested by Lluis. * server/XSPApplicationHost.cs: make worker serializable again. Fixes bug #49354. * server/XSPWorkerRequest.cs: read the headers here. 2003-10-06 Gonzalo Paniagua Javier * configure.in: output the assemblyinfos too. * doc/Makefile.am: extradist. * server/AssemblyInfoModMono.cs.in: for mod-mono-server. * server/InitialWorkerRequest.cs: PathInfo should work now. * server/Makefile.in: use the assemblyinfo*.in files. * server/server.cs: added --version. * test/Makefile.in: simplified. 2003-10-05 Pedro Martínez Juliá * test/index.aspx: change directory where files are searched because if test directory is not the root directory of the server, the index page will have other files. 2003-10-04 Gonzalo Paniagua Javier * configure.in: * doc/Makefile.am: * server/Makefile.in: * test/Makefile.in: use automake. * Makefile.in: * doc/Makefile.in: Removed files. 2003-10-04 Gonzalo Paniagua Javier * Makefile.in: fix dist target. * server/XSPApplicationHost.cs: re-added line removed by mistake. * server/server.cs: added --nonstop argument to allow xsp be run with no controlling tty. 2003-10-03 Gonzalo Paniagua Javier * INSTALL: updated. * NEWS: updated. * Makefile.in: * doc/Makefile.in: * server/Makefile.in: * test/Makefile.in: * autogen.sh: * configure.in: do a real dist target. Make it work on windows. * server/ModMonoRequest.cs: read basic request data upon connection. * server/ModMonoWorkerRequest.cs: implemented GetUnknownHeaders. * server/MonoWorkerRequest.cs: minimize cross-appdomain calls. * server/XSPApplicationHost.cs: Worker is now MarshalByRef, not [Serializable]. Set the server thread as background. * server/server.cs: the server is now stopped by pressing enter. You can disable this behavior with --nonstop argument. * test/DefaultWsdlHelpGenerator.aspx: this has been moved to mono/data. 2003-10-01 Gonzalo Paniagua Javier * Makefile.in: * autogen.sh: * configure.in: * doc/Makefile.in: * server/Makefile.in: * test/Makefile.in: added 'dist' target to make a tarball. 2003-09-27 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: really add the sponsors now. 2003-09-22 Gonzalo Paniagua Javier * ChangeLog: unified all ChangeLog. * NEWS: * INSTALL: updated. * Makefile: * doc/Makefile.in: * doc/directives-syntax.txt: * doc/generated-code.txt: * doc/helping.txt: * server/ChangeLog: * server/Makefile: * server/Makefile.in: * server/global.asax: * server/mod-mono-server.exe.config: * server/xsp.exe.config: * test/ChangeLog: * test/Makefile: * test/Makefile.in: * test/global.asax: * test/mod-mono-server.exe.config: * test/xsp.exe.config: * test/authtest/ChangeLog: use auto* stuff forthe build and unified ChangeLog. * server/XSPApplicationHost.cs: added a couple of catches. 2003-09-22 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: added a ISponsor for NetworkStream and don't crash xsp.exe if RemoteEndPoint throws an exception. 2003-09-19 Gonzalo Paniagua Javier * server/ModMonoWorkerRequest.cs: don't cache the values from mod_mono_unix here... * server/ModMonoRequest.cs: ...and do it here. (GetClientBlock): mark the array as an Out parameter so that the modified array is passed back to the caller by remoting. This fixes POST when using mod_mono_unix. 2003-09-18 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: don't crash when no Host header is received or if it has an invalid port. 2003-09-14 Lluis Sanchez Gual * test/DefaultWsdlHelpGenerator.aspx. Added support for C# proxy generation. 2003-09-04 Lluis Sanchez Gual * test/Added DefaultWsdlHelpGenerator.aspx. 2003-09-04 Lluis Sanchez Gual * server/XSPWorkerRequest.cs: GetServerName(): reverted previous patch. There was a conflict with previous changes. Also modified implementation of GetLocalAddress(). It should get the value from the request header. 2003-09-04 Lluis Sanchez Gual * server/XSPWorkerRequest.cs: GetServerName(): return the address of the local server. 2003-08-29 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: removed Console... * server/ModMonoRequest.cs: removed debug output. * server/ModMonoWorkerRequest.cs: added pathinfo support. * server/MonoWorkerRequest.cs: removed GetRawUrl from here. * server/XSPApplicationHost.cs: read the request data needed to get the Uri. 2003-08-29 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: added PathInfo support. * server/MonoWorkerRequest.cs: removed unused GetPathInfo. Don't cache the mapped path as it may change (ie., / -> /index.aspx). * server/XSPWorkerRequest.cs: support pathinfo. Works with MS. Always send the 'Connection: close' header. Added support for GetLocal*. 2003-08-27 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: fixed bugs 47937 and 47938. * server/XSPApplicationHost.cs: close the socket when finished. * server/XSPWorkerRequest.cs: small fixes in ReadEntityBody. Removed the 302 redirection, handle it faking the path. 2003-08-26 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: infinite lifetime for XSPApplicationHost. 2003-08-25 Gonzalo Paniagua Javier * server/InitialWorkerRequest.cs: * server/XSPWorkerRequest.cs: keep the read buffer, its length and the position around (used in POST). Somehow this bug didnn't show up under MS runtime. * server/XSPApplicationHost.cs: fixed warning and commented out WriteLines. 2003-08-25 Gonzalo Paniagua Javier * server/IApplicationHost.cs: added 2 methods and 1 property to the interface. * server/InitialWorkerRequest.cs: used to read the request data before determining which application (if at all) is gonna process it. * server/Makefile: added new source file. * server/ModMonoRequest.cs: removed AliasMatches and added Decline. * server/ModMonoWorkerRequest.cs: new .ctor and Decline method that tells apache that we won't handle the request. * server/MonoWorkerRequest.cs: variable renamed. * server/XSPApplicationHost.cs: it can now handle multiple applications. * server/XSPWorkerRequest.cs: simplified as reading the request data is done in InitialWorkerRequest. * server/xsp.exe.config: * server/mod-mono-server.exe.config: added MonoApplications default setting. * server/server.cs: updated help and set the applications registered. 2003-08-21 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: handle possible exceptions in ProcessRequest. * server/XSPWorkerRequest.cs: don't do any check on the verb. If an error happens reading the request or the headers, send a 500 back and terminate. 2003-08-17 Gonzalo Paniagua Javier * server/AssemblyInfo.cs: updated version number. 2003-08-07 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: write the correct number of bytes when flushing the response. 2003-08-01 Gonzalo Paniagua Javier * test/monodoc.ashx: added this file that contains a couple of directives plus monodoc/browser/website-handler.cs. Yeah! BenM rules. 2003-08-01 Gonzalo Paniagua Javier * test/index.aspx: also list .ashx files. * test/webhandler.ashx: added new sample. 2003-08-01 Gonzalo Paniagua Javier * server/mod-mono-server.exe.config: New file. * server/Makefile: * server/ModMonoRequest.cs: new class that communicate with the new mod_mono_unix apache2 module. * server/ModMonoWorkerRequest.cs: HttpWorkerRequest for unix socket. * server/server.cs: * server/XSPApplicationHost.cs: updated for new apache2 module. 2003-07-30 Sebastien Pouliot * test/Makefile: Corrected extensions.dll for csc, error: Options '/out' and '/target' must appear before source file names 2003-07-24 Gonzalo Paniagua Javier * test/web.config: update to new type/assembly name and make it use gzip by default. 2003-07-24 Gonzalo Paniagua Javier * server/AcceptEncodingConfig.cs: * server/AcceptEncodingModule.cs: * server/AcceptEncodingSectionHandler.cs: * server/GZipFilter.cs: * server/Makefile: these .cs files have been moved to Mono.Http.dll. * server/AssemblyInfo.cs: upgrade version. 2003-07-23 Gonzalo Paniagua Javier * test/web.config: the new mono.aspnet configuration section has been added and other contents from ../server/web.config file. 2003-07-23 Gonzalo Paniagua Javier * server/AcceptEncodingConfig.cs: class to hold the configuration for the filters enabled in web.config. * server/AcceptEncodingModule.cs: IHttpModule to plug the filters. * server/AcceptEncodingSectionHandler.cs: configuration file section handler for accept-encoding filters. * server/GZipFilter.cs: sample filter for gzip encoding. * server/Makefile: reference ICSharpCode.SharpZipLib, added new files and renamed executable to xsp.exe * server/server.exe.config: removed and renamed to... * server/xsp.exe.config: ...this one. * server/web.config: Removed file. It's been merged with ../test/ 2003-07-09 Lluis Sanchez Gual * test/README: added descrption of web service samples. * test/Makefile: added compilation of extensions and service client. * test/web.config: Copied from the server directory. It includes soap extension configuration. * test/TestService.asmx: New file. A simple test service. * test/ConverterService.asmx: New file. Currency conversion test service. * test/TraceExtension.cs: New file. Trace soap extension. * test/EncryptExtension.cs: New file. A Soap extension that encrypts the info. * test/DumpExtension.cs: New file. Dump soap extension. * test/ServiceClient.cs: New file. Web service test app. * test/ServiceClient.exe.config: New file. Config file for the ServiceClient test app. * test/Reference.cs: New file. Web service client proxy implementation. 2003-07-09 Lluis Sanchez Gual * server/Makefile: install target: copy web service files. 2003-06-20 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: reverted latest Ben's patch as it causes an annoying bug when testing under windows. 2003-05-31 Gonzalo Paniagua Javier * server/XSPApplicationHost.cs: * server/XSPWorkerRequest.cs: support GetRemoteName, GetRemoteAddress and GetRemotePort. Fixes bug #43985. 2003-05-24 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: when redirecting to an index page, also use the query string. Fixes bug #43598. 2003-05-24 Ben Maurer * server/XSPWorkerRequest.cs: Now /foo/ does not redirect to /foo/index.aspx, it just does a Response.Transfer () sort of thing. 2003-05-06 Gonzalo Paniagua Javier * test/body.inc: New file. * test/header.inc: New file. * test/includetest.aspx: New file. 2003-05-05 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: * server/server.cs: * server/server.exe.config: * server/web.config: the index files must be set in the proper AppDomain. Fixes #42309. 2003-05-04 Gonzalo Paniagua Javier * server/web.config: removed server.exe keys. * server/Makefile: readded server.exe.config. * server/XSPWorkerRequest.cs: * server/server.cs: * server/server.exe.config: made the default index files list configurable. 2003-05-03 Pedro Martínez Juliá * server/server.cs: new options to set listen address. 2003-03-27 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: added a MapPathEvent that is fired before doing the normal MapPath stuff and can provide alternate mappings. 2003-02-17 Gonzalo Paniagua Javier * server/Makefile: .dbg files are gone. * server/MonoWorkerRequest.cs: fixed MapPath to deal with virtual directories. * server/XSPWorkerRequest.cs: some cosmetic changes along with a fix when redirecting to location page. * server/server.cs: new options to set the root and virtual directory for the application. * server/XSPApplicationHost.cs: keep path and virtual path in instance fields. 2003-02-15 Gonzalo Paniagua Javier * test/web_datagrid_command.aspx: added sample that allows deleting rows from a data source. 2003-02-12 Gonzalo Paniagua Javier * test/authtest/index.aspx: * test/authtest/login.aspx: * test/authtest/web.config: authorization test from http://www.asp.net. 2003-02-12 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: when running under MS runtime, closing 'stream' is required too. 2003-02-06 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: fixed buglet in GetAppPath. 2003-02-04 Gonzalo Paniagua Javier * server/Makefile: removed installation of server.exe.config. * server/XSPWorkerRequest.cs: buffered input from the socket. * server/server.exe.config: Removed file. Yahoo! * server/web.config: authentication mode set to Forms. 2003-02-02 Gonzalo Paniagua Javier * server/XSPWorkerRequest.cs: fixed ReadEntityBody. Thanks to Brian Ritchie. Don't use a StreamReader to read from the stream cause it may buffer some data. TODO -> now we're using ReadByte to read from the stream. We should use Read and do some buffering. 2003-01-15 Gonzalo Paniagua Javier * test/dbpage1.aspx: * test/dbpage2.aspx: make the database accessing samples take some parameters from the configuration file to choose the IDbConnection and documented it. 2003-01-15 Gonzalo Paniagua Javier * server/Makefile: * server/server.exe.config: * server/web.config: make the database accessing samples take some parameters from the configuration file to choose the IDbConnection and documented it. 2003-01-14 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: * server/XSPWorkerRequest.cs: moved GetUnknownHeader(s) here. 2003-01-14 Gonzalo Paniagua Javier * server/IApplicationHost.cs: * server/MonoWorkerRequest.cs: the same files as in mod_mono. They must be kept in synch. * server/XSPApplicationHost.cs: same as previous MonoApplicationHost, but implements IApplicationHost. * server/XSPWorkerRequest.cs: it derives now from MonoWorkerRequest. Removed some overrides that are already present in the base class. * server/server.cs: use XSPApplicationHost. * server/Makefile: added/removed files to SOURCES. Install the .dbg file. * server/MonoApplicationHost.cs: Removed file. Now mod_mono and xsp share IApplicationHost and MonoWorkerRequest. 2003-01-12 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: fixed GetRawUrl. 2003-01-08 Gonzalo Paniagua Javier * test/web_datagrid.aspx: simple datagrid test. 2003-01-07 Gonzalo Paniagua Javier * test/registertest.aspx: * test/registertest1.ascx: * test/registertest2.ascx: new test for @ Register directive. 2003-01-07 Gonzalo Paniagua Javier * server/Makefile: also copy .ascx files. 2003-01-06 Gonzalo Paniagua Javier * test/Makefile: added codebehind1 test. * test/codebehind1.[aspx|cs]: codebehind test by David B. Bitton . 2002-12-20 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: it know handles directory requests either redirecting to a / terminated url for directories or searching for one of the default index files for / terminated urls. 2002-12-19 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: changes to match recent MapPath fixing in System.Web. 2002-12-13 Juli Mallett * server/Makefile, server/Makefile, src/Makefile: Spell `make' as `$(MAKE)'. * server/README: Fix typo. 2002-12-12 Gonzalo Paniagua Javier * server/AssemblyInfo.cs: New file. * server/Makefile: added AssemblyInfo.cs. * server/MonoWorkerRequest.cs: create Server header from assembly attributes. Thanks to alp and danmorg. Some path handling fixes and kludges. 2002-12-10 Alp Toker * server/server/MonoWorkerRequest.cs: send a 'Server' HTTP header 2002-12-05 Gonzalo Paniagua Javier * server/server/Makefile: updated. * server/server/MonoWorkerRequest.cs: give credits to Opless (Simon White). * server/server/server.cs: get the port from a config file. * server/server/server.exe.config: configuration file. * server/server/web.config: added appSettings. 2002-11-24 Daniel Morgan * test/dbpage1.aspx: modify to dynamically load the Mono.Data.PostgreSqlClient assembly and Connection class Mono.Data.PostgreSqlClient.PgSqlConnection. This is a temporary solution until global.asax has support for this. 2002-10-31 Gonzalo Paniagua Javier * server/MonoWorkerRequest.cs: use a default encoding without markers. * server/server.cs: Trace output goes to Console.Out. 2002-10-27 Gonzalo Paniagua Javier * server/Makefile: added Tracing.cs * server/MonoApplicationHost.cs: use WebTrace. * server/MonoWorkerRequest.cs: use WebTrace. Also changed FlushResponse. Now it outputs correctly the status and the headers. * server/Tracing.cs: new file. Almost the same as System.Web.Util.WebTrace. It's used to get some output under MS runtime, which disables normal tracing for System.Web. * server/server.cs: removed Trace stuff. 2002-10-23 Gonzalo Paniagua Javier * test/Makefile: used to build the .cs files for user controls. 2002-10-23 Gonzalo Paniagua Javier * server/Makefile: added 'trace' target. * server/index.aspx: removed file added by mistake. 2002-10-22 Gonzalo Paniagua Javier * server/ChangeLog: * server/Makefile: * server/MonoApplicationHost.cs: * server/MonoWorkerRequest.cs: * server/global.asax: * server/index.aspx: * server/server.cs: * server/web.config: new web server that uses ASP.NET hosting capabilities. It works with MS runtime and will be used to debug our classes from now on. xsp/src/* is now obsoleted and will stop working some time soon. 2002-09-27 Gonzalo Paniagua Javier * test/databind-arraylist.aspx: fixed variable name. * test/htmlimage.aspx: * test/htmlinputimage.aspx: * test/tabcontrol2.aspx: * test/web_adrotator.xml: * test/web_hyperlink.aspx: * test/web_image.aspx: * test/web_imagebutton.aspx: modify the img url. Ximian site changed. 2002-09-04 Gonzalo Paniagua Javier * test/index.aspx: now we have a working Path... 2002-08-12 Gonzalo Paniagua Javier * test/dbpage2.aspx: fixes to make mcs happy. 2002-08-01 Gonzalo Paniagua Javier * test/temperature.aspx: Duncan asked for this temperature converter. 2002-07-31 Gonzalo Paniagua Javier * test/web_dropdownlist.aspx: New file. 2002-07-28 Gonzalo Paniagua Javier * test/mono.png: image for the index page. * test/index.aspx: index.aspx page which shows the list of available .aspx files in the current directory. Contributed by Alp Toker. * test/validator1.aspx: first validator test working! 2002-07-23 Gonzalo Paniagua Javier * test/dbpage2.aspx: new sample. It uses tabcontrol2 and sets up a page with 4 tabs (Browse, Insert, Update, Delete) for maintenance of a simple PostgreSQL database using ADO.NET. 2002-07-22 Gonzalo Paniagua Javier * test/tabcontrol.aspx: removed .dll extension from assembly file name. * test/tabcontrol2.aspx: now it does not set up the contents of each tab programatically. It uses . * test/tabcontrol2.cs: added TabContent control. TabContent can contain any control (excluding HtmlForm, of course). Modified Tabs2 to use TabContent and maintaining state of all tabs. 2002-07-21 Gonzalo Paniagua Javier * test/tabcontrol2.aspx: page to test tabcontrol2.cs * test/tabcontrol2.cs: almost the same as tabcontrol1, but this one handles postback events an stores a ControlCollection associatted to each tab. 2002-07-21 Gonzalo Paniagua Javier * test/tabcontrol.aspx: sample using a user control that allows modifying its properties and display the resulting control. * test/tabcontrol.cs: the user control for the above page. It must be compiled and the dll copied to output directory if testing with our test server. 2002-07-06 Gonzalo Paniagua Javier * test/dbpage1.aspx: displays data from a database in a Table. 2002-07-03 Gonzalo Paniagua Javier * test/server-side-object.aspx: New file. 2002-06-29 Gonzalo Paniagua Javier * test/session1.aspx: used to play with session tracking. 2002-06-20 Gonzalo Paniagua Javier * test/web_repeater.aspx: rendered ok. Includes data binding! 2002-06-19 Gonzalo Paniagua Javier * test/web_radiobuttonlist.aspx: another one. 2002-06-18 Gonzalo Paniagua Javier * test/web_checkboxlist.aspx: New file. Still have to fix the Name property to assign name attribute depending on parent name. 2002-06-18 Gonzalo Paniagua Javier * test/web_listbox.aspx: new file rendered ok. 2002-06-17 Gonzalo Paniagua Javier * test/web_table.aspx: New file. Renders Table, TableRow and TableCell. 2002-06-16 Gonzalo Paniagua Javier * test/web_panel.aspx: New file. 2002-06-12 Gonzalo Paniagua Javier * test/web_radiobutton.aspx: * test/web_textbox.aspx: 2 more. 2002-06-12 Gonzalo Paniagua Javier * test/web_imagebutton.aspx: rendered ok. 2002-06-12 Gonzalo Paniagua Javier * test/web_linkbutton.aspx: 17 more to go! 2002-06-12 Gonzalo Paniagua Javier * test/web_label.aspx: fixed cut&paste error in title. * test/web_literal.aspx: * test/web_placeholder.aspx: New files. 2002-06-12 Gonzalo Paniagua Javier * test/web_label.aspx: one more. 2002-06-12 Gonzalo Paniagua Javier * test/web_button.aspx: * test/web_checkbox.aspx: another couple rendered ok. 2002-06-11 Gonzalo Paniagua Javier * test/web_adrotator.aspx: * test/web_hyperlink.aspx: * test/web_image.aspx: new tests that render fine with our System.Web. * test/web_adrotator.xml: needed by web_adrotator.aspx. 2002-06-09 Gonzalo Paniagua Javier * test/htmltable.aspx: * test/htmltextarea.aspx: New files. Rendered ok. 2002-06-09 Gonzalo Paniagua Javier * test/htmlselect.aspx: another one that is rendered by our System.Web. 2002-06-06 Gonzalo Paniagua Javier * test/htmlinputbutton.aspx: New file. Renders fine with our System.Web. * test/htmlinputcheckbox.aspx: another one. * test/htmlinputfile.aspx: another one. 2002-06-05 Gonzalo Paniagua Javier * test/htmlimage.aspx: New file. Renders fine with our System.Web. 2002-06-05 Gonzalo Paniagua Javier * test/htmlanchor.aspx: New file. * test/htmlbutton.aspx: New file. * test/htmlgeneric.aspx: New file. These render fine using xsp + server + mono System.Web. 2002-05-25 Gonzalo Paniagua Javier * test/code-render.aspx: new file. 2002-05-24 Gonzalo Paniagua Javier * test/databind-attribute.aspx: new file. 2002-05-22 Gonzalo Paniagua Javier * test/databind-template.aspx: added another template (previously, this failed to generate proper code). 2002-05-22 Gonzalo Paniagua Javier * test/databind-template.aspx: new file. 2002-05-22 Gonzalo Paniagua Javier * test/databind-class.aspx: new file. 2002-05-21 Gonzalo Paniagua Javier * test/listitem.aspx: new file. 2002-05-16 Gonzalo Paniagua Javier * test/calendar.aspx: new file. Style properties inside component. 2002-05-15 Gonzalo Paniagua Javier * test/README, ChangeLog: changed line ending to unix format. * test/databind-arraylist.aspx: added an ArrayList as server object. Also changed to unix format. 2002-05-14 Gonzalo Paniagua Javier Created directory and added a couple of samples. xsp-4.2/lib/0000775000175000017500000000000012627055650007752 500000000000000xsp-4.2/lib/fpm_helper.c0000664000175000017500000001045012627046413012154 00000000000000/*************************************************************************** * libancillary - black magic on Unix domain sockets * (C) Nicolas George * fd_recv.c - receiving file descriptors * fd_send.c - sending file descriptors ***************************************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _XPG4_2 /* Solaris sucks */ # define _XPG4_2 #endif #include #include #include #include #include #if defined(__FreeBSD__) # include /* FreeBSD sucks */ #endif #include "fpm_helper.h" int recv_fds_with_buffer(int sock, int *fds, unsigned n_fds, void *buffer) { struct msghdr msghdr; char nothing; struct iovec nothing_ptr; struct cmsghdr *cmsg; int i; nothing_ptr.iov_base = ¬hing; nothing_ptr.iov_len = 1; msghdr.msg_name = NULL; msghdr.msg_namelen = 0; msghdr.msg_iov = ¬hing_ptr; msghdr.msg_iovlen = 1; msghdr.msg_flags = 0; msghdr.msg_control = buffer; msghdr.msg_controllen = sizeof(struct cmsghdr) + sizeof(int) * n_fds; cmsg = CMSG_FIRSTHDR(&msghdr); cmsg->cmsg_len = msghdr.msg_controllen; cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; for(i = 0; i < n_fds; i++) ((int *)CMSG_DATA(cmsg))[i] = -1; if(recvmsg(sock, &msghdr, 0) < 0) return(-1); for(i = 0; i < n_fds; i++) fds[i] = ((int *)CMSG_DATA(cmsg))[i]; n_fds = (cmsg->cmsg_len - sizeof(struct cmsghdr)) / sizeof(int); return(n_fds); } int recv_fds(int sock, int *fd, unsigned n_fds) { ANCIL_FD_BUFFER(ANCIL_MAX_N_FDS) buffer; assert(n_fds <= ANCIL_MAX_N_FDS); return(recv_fds_with_buffer(sock, fd, n_fds, &buffer)); } int recv_fd(int sock, int *fd) { ANCIL_FD_BUFFER(1) buffer; return(recv_fds_with_buffer(sock, fd, 1, &buffer) == 1 ? 0 : -1); } int send_fds_with_buffer(int sock, const int *fds, unsigned n_fds, void *buffer) { struct msghdr msghdr; char nothing = '!'; struct iovec nothing_ptr; struct cmsghdr *cmsg; int i; nothing_ptr.iov_base = ¬hing; nothing_ptr.iov_len = 1; msghdr.msg_name = NULL; msghdr.msg_namelen = 0; msghdr.msg_iov = ¬hing_ptr; msghdr.msg_iovlen = 1; msghdr.msg_flags = 0; msghdr.msg_control = buffer; msghdr.msg_controllen = sizeof(struct cmsghdr) + sizeof(int) * n_fds; cmsg = CMSG_FIRSTHDR(&msghdr); cmsg->cmsg_len = msghdr.msg_controllen; cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; for(i = 0; i < n_fds; i++) ((int *)CMSG_DATA(cmsg))[i] = fds[i]; return(sendmsg(sock, &msghdr, 0) >= 0 ? 0 : -1); } int send_fds(int sock, const int *fds, unsigned n_fds) { ANCIL_FD_BUFFER(ANCIL_MAX_N_FDS) buffer; assert(n_fds <= ANCIL_MAX_N_FDS); return(send_fds_with_buffer(sock, fds, n_fds, &buffer)); } int send_fd(int sock, int fd) { ANCIL_FD_BUFFER(1) buffer; return(send_fds_with_buffer(sock, &fd, 1, &buffer)); } xsp-4.2/lib/Makefile.in0000664000175000017500000005353012627055642011746 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libfpm_helper_la_LIBADD = am_libfpm_helper_la_OBJECTS = libfpm_helper_la-fpm_helper.lo libfpm_helper_la_OBJECTS = $(am_libfpm_helper_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libfpm_helper_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libfpm_helper_la_CFLAGS) $(CFLAGS) \ $(libfpm_helper_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libfpm_helper_la_SOURCES) DIST_SOURCES = $(libfpm_helper_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ CLEANFILES = .libs/libfpm_helper.so .libs/libfpm_helper_old.so *~ lib_LTLIBRARIES = libfpm_helper.la libfpm_helper_la_SOURCES = fpm_helper.h fpm_helper.c libfpm_helper_la_LDFLAGS = -module libfpm_helper_la_DEPENDENCIES = libfpm_helper_la_CFLAGS = -Wall all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfpm_helper.la: $(libfpm_helper_la_OBJECTS) $(libfpm_helper_la_DEPENDENCIES) $(EXTRA_libfpm_helper_la_DEPENDENCIES) $(AM_V_CCLD)$(libfpm_helper_la_LINK) -rpath $(libdir) $(libfpm_helper_la_OBJECTS) $(libfpm_helper_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfpm_helper_la-fpm_helper.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libfpm_helper_la-fpm_helper.lo: fpm_helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfpm_helper_la_CFLAGS) $(CFLAGS) -MT libfpm_helper_la-fpm_helper.lo -MD -MP -MF $(DEPDIR)/libfpm_helper_la-fpm_helper.Tpo -c -o libfpm_helper_la-fpm_helper.lo `test -f 'fpm_helper.c' || echo '$(srcdir)/'`fpm_helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfpm_helper_la-fpm_helper.Tpo $(DEPDIR)/libfpm_helper_la-fpm_helper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fpm_helper.c' object='libfpm_helper_la-fpm_helper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfpm_helper_la_CFLAGS) $(CFLAGS) -c -o libfpm_helper_la-fpm_helper.lo `test -f 'fpm_helper.c' || echo '$(srcdir)/'`fpm_helper.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/lib/fpm_helper.h0000664000175000017500000001026012627046413012160 00000000000000/*************************************************************************** * libancillary - black magic on Unix domain sockets * (C) Nicolas George * ancillary.h - public header ***************************************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ANCILLARY_H__ #define ANCILLARY_H__ /*************************************************************************** * Start of the readable part. ***************************************************************************/ #define ANCIL_MAX_N_FDS 960 /* * Maximum number of fds that can be sent or received using the "esay" * functions; this is so that all can fit in one page. */ extern int ancil_send_fds_with_buffer(int, const int *, unsigned, void *); /* * ancil_send_fds_with_buffer(sock, n_fds, fds, buffer) * * Sends the file descriptors in the array pointed by fds, of length n_fds * on the socket sock. * buffer is a writeable memory area large enough to hold the required data * structures. * Returns: -1 and errno in case of error, 0 in case of success. */ extern int ancil_recv_fds_with_buffer(int, int *, unsigned, void *); /* * ancil_recv_fds_with_buffer(sock, n_fds, fds, buffer) * * Receives *n_fds file descriptors into the array pointed by fds * from the socket sock. * buffer is a writeable memory area large enough to hold the required data * structures. * Returns: -1 and errno in case of error, the actual number of received fd * in case of success */ #define ANCIL_FD_BUFFER(n) \ struct { \ struct cmsghdr h; \ int fd[n]; \ } /* ANCIL_FD_BUFFER(n) * * A structure type suitable to be used as buffer for n file descriptors. * Requires . * Example: * ANCIL_FD_BUFFER(42) buffer; * ancil_recv_fds_with_buffer(sock, 42, my_fds, &buffer); */ extern int ancil_send_fds(int, const int *, unsigned); /* * ancil_send_fds(sock, n_fds, fds) * * Sends the file descriptors in the array pointed by fds, of length n_fds * on the socket sock. * n_fds must not be greater than ANCIL_MAX_N_FDS. * Returns: -1 and errno in case of error, 0 in case of success. */ extern int ancil_recv_fds(int, int *, unsigned); /* * ancil_recv_fds(sock, n_fds, fds) * * Receives *n_fds file descriptors into the array pointed by fds * from the socket sock. * *n_fds must not be greater than ANCIL_MAX_N_FDS. * Returns: -1 and errno in case of error, the actual number of received fd * in case of success. */ extern int ancil_send_fd(int, int); /* ancil_recv_fd(sock, fd); * * Sends the file descriptor fd on the socket sock. * Returns : -1 and errno in case of error, 0 in case of success. */ extern int ancil_recv_fd(int, int *); /* ancil_send_fd(sock, &fd); * * Receives the file descriptor fd from the socket sock. * Returns : -1 and errno in case of error, 0 in case of success. */ #endif /* ANCILLARY_H__ */ xsp-4.2/lib/Makefile.am0000664000175000017500000000037712627046413011732 00000000000000CLEANFILES = .libs/libfpm_helper.so .libs/libfpm_helper_old.so *~ lib_LTLIBRARIES = libfpm_helper.la libfpm_helper_la_SOURCES = fpm_helper.h fpm_helper.c libfpm_helper_la_LDFLAGS = -module libfpm_helper_la_DEPENDENCIES = libfpm_helper_la_CFLAGS = -Wall xsp-4.2/packaging/0000775000175000017500000000000012627055650011130 500000000000000xsp-4.2/packaging/Makefile.in0000664000175000017500000004540612627055642013127 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = packaging ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = opensuse all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign packaging/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign packaging/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/packaging/opensuse/0000775000175000017500000000000012627055650012771 500000000000000xsp-4.2/packaging/opensuse/Makefile.in0000664000175000017500000003113612627055642014763 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = packaging/opensuse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = xsp2.init xsp2.fw sysconfig.xsp2 xsp2.logrotate all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign packaging/opensuse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign packaging/opensuse/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/packaging/opensuse/xsp2.fw0000664000175000017500000000022012627046413014132 00000000000000## Name: Mono XSP2 ASP.NET Host Service ## Description: Open ports for Mono XSP2 server # space separated list of allowed TCP ports TCP="8080" xsp-4.2/packaging/opensuse/xsp2.logrotate0000664000175000017500000000024612627046413015526 00000000000000/var/log/xsp2.log { compress dateext maxage 365 rotate 99 missingok notifempty size +4096k create 644 wwwrun www sharedscripts } xsp-4.2/packaging/opensuse/Makefile.am0000664000175000017500000000007412627046413014743 00000000000000EXTRA_DIST = xsp2.init xsp2.fw sysconfig.xsp2 xsp2.logrotatexsp-4.2/packaging/opensuse/xsp2.init0000775000175000017500000002605412627046413014501 00000000000000#!/bin/sh # # System startup script for XSP2 # Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or (at # your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, # USA. # # System startup script for XSP2 # # LSB compatible service control script; see http://www.linuxbase.org/spec/ # # Note: This template uses functions rc_XXX defined in /etc/rc.status on # UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your # script on this template and ensure that it works on non UL based LSB # compliant Linux distributions, you either have to provide the rc.status # functions from UL or change the script to work without them. # See skeleton.compat for a template that works with other distros as well. # ### BEGIN INIT INFO # Provides: xsp2 # Required-Start: $syslog $remote_fs $local_fs $network # Should-Start: $time ypbind smtp # Required-Stop: $syslog $remote_fs # Should-Stop: $time ypbind smtp # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: xsp2 daemon providing ASP.NET hosting # Description: Start xsp2 to run ASP.NET applications with # the Mono runtime. ### END INIT INFO # # Any extensions to the keywords given above should be preceeded by # X-VendorTag- (X-UnitedLinux- X-SuSE- for us) according to LSB. # # Notes on Required-Start/Should-Start: # * There are two different issues that are solved by Required-Start # and Should-Start # (a) Hard dependencies: This is used by the runlevel editor to determine # which services absolutely need to be started to make the start of # this service make sense. Example: nfsserver should have # Required-Start: $portmap # Also, required services are started before the dependent ones. # The runlevel editor will warn about such missing hard dependencies # and suggest enabling. During system startup, you may expect an error, # if the dependency is not fulfilled. # (b) Specifying the init script ordering, not real (hard) dependencies. # This is needed by insserv to determine which service should be # started first (and at a later stage what services can be started # in parallel). The tag Should-Start: is used for this. # It tells, that if a service is available, it should be started # before. If not, never mind. # * When specifying hard dependencies or ordering requirements, you can # use names of services (contents of their Provides: section) # or pseudo names starting with a $. The following ones are available # according to LSB (1.1): # $local_fs all local file systems are mounted # (most services should need this!) # $remote_fs all remote file systems are mounted # (note that /usr may be remote, so # many services should Require this!) # $syslog system logging facility up # $network low level networking (eth card, ...) # $named hostname resolution available # $netdaemons all network daemons are running # The $netdaemons pseudo service has been removed in LSB 1.2. # For now, we still offer it for backward compatibility. # These are new (LSB 1.2): # $time the system time has been set correctly # $portmap SunRPC portmapping service available # UnitedLinux extensions: # $ALL indicates that a script should be inserted # at the end # * The services specified in the stop tags # (Required-Stop/Should-Stop) # specify which services need to be still running when this service # is shut down. Often the entries there are just copies or a subset # from the respective start tag. # * Should-Start/Stop are now part of LSB as of 2.0, # formerly SUSE/Unitedlinux used X-UnitedLinux-Should-Start/-Stop. # insserv does support both variants. # * X-UnitedLinux-Default-Enabled: yes/no is used at installation time # (%fillup_and_insserv macro in %post of many RPMs) to specify whether # a startup script should default to be enabled after installation. # It's not used by insserv. # # Note on runlevels: # 0 - halt/poweroff 6 - reboot # 1 - single user 2 - multiuser without network exported # 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm) # # Note on script names: # http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html # A registry has been set up to manage the init script namespace. # http://www.lanana.org/ # Please use the names already registered or register one or use a # vendor prefix. # Check for missing binaries (stale symlinks should not happen) # Note: Special treatment of stop for LSB conformance XSP2_BIN=/usr/lib/mono/2.0/xsp2.exe XSP2_WRAPPER=/usr/bin/xsp2 MONO_BIN=/usr/bin/mono test -x $XSP2_BIN || { echo "$XSP2_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } test -x $MONO_BIN || { echo "$MONO_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } # Check for existence of needed config file and read it XSP2_CONFIG=/etc/sysconfig/xsp2 test -r $XSP2_CONFIG || { echo "$XSP2_CONFIG does not exist"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } # Defaults XSP_PORT="8080" XSP_ADDRESS="0.0.0.0" XSP_APPCONFIGDIR="/etc/xsp/2.0/applications-enabled/" XSP_DEBUG="no" XSP_ROOTDIR="/srv/xsp2" XSP_USER="wwwrun" XSP_GROUP="www" # Read config . $XSP2_CONFIG XSP_ROOTAPP="--applications /:$XSP_ROOTDIR" XSP_OPTIONS="--nonstop --port $XSP_PORT --address $XSP_ADDRESS $XSP_ROOTAPP --appconfigdir $XSP_APPCONFIGDIR --root $XSP_ROOTDIR $XSP_EXTRA_OPTIONS" XSP_PIDFILE=/var/run/xsp2/xsp2.pid if test "x$XSP_DEBUG" = "xyes"; then MONO_OPTIONS="$MONO_OPTIONS --debug" fi # Source LSB init functions # providing start_daemon, killproc, pidofproc, # log_success_msg, log_failure_msg and log_warning_msg. # This is currently not used by UnitedLinux based distributions and # not needed for init scripts for UnitedLinux only. If it is used, # the functions from rc.status should not be sourced or used. #. /lib/lsb/init-functions # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v be verbose in local rc status and clear it afterwards # rc_status -v -r ditto and clear both the local and overall rc status # rc_status -s display "skipped" and exit with status 3 # rc_status -u display "unused" and exit with status 3 # rc_failed set local and overall rc status to failed # rc_failed set local and overall rc status to # rc_reset clear both the local and overall rc status # rc_exit exit appropriate to overall rc status # rc_active checks whether a service is activated by symlinks . /etc/rc.status # Reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - user had insufficient privileges # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signaling is not supported) are # considered a success. case "$1" in start) echo -n "Starting xsp2 " ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. export MONO_OPTIONS if [ -f "$XSP_PIDFILE" ] && [ "$(readlink /proc/$(cat $XSP_PIDFILE)/exe)" == "$MONO_BIN" ]; then rc_check 0 else /sbin/startproc -p $XSP_PIDFILE -l /var/log/xsp2.log -u $XSP_USER -g $XSP_GROUP $XSP2_WRAPPER $XSP_OPTIONS --pidfile $XSP_PIDFILE # Wait for it to warm up sleep 1 fi if [ -f "$XSP_PIDFILE" ]; then MYPID=$(cat $XSP_PIDFILE) else MYPID= fi if ! test "`readlink /proc/$MYPID/exe`" = "$MONO_BIN"; then rc_failed 7 fi # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down xsp2 " if test -f $XSP_PIDFILE; then MYPID=`cat $XSP_PIDFILE` if test "`readlink /proc/$MYPID/exe`" = "$MONO_BIN"; then kill -TERM $MYPID else rc_failed 7 fi rm -f $XSP_PIDFILE else rc_failed 7 fi # Remember status and be verbose rc_status -v ;; try-restart|condrestart) ## Do a restart only if the service was active before. ## Note: try-restart is now part of LSB (as of 1.9). ## RH has a similar command named condrestart. if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi # Remember status and be quiet rc_status ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; force-reload) ## Signal the daemon to reload its config. Most daemons ## do this on signal 1 (SIGHUP). ## If it does not support it, restart the service if it ## is running. echo -n "Reload service xsp2 " ## if it supports it: #/sbin/killproc -HUP $XSP2_BIN #touch /var/run/xsp2.pid #rc_status -v ## Otherwise: $0 try-restart rc_status ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) # If it supports signaling: echo -n "Reload service xsp2 " #/sbin/killproc -HUP $XSP2_BIN #touch /var/run/xsp2.pid #rc_status -v ## Otherwise if it does not support reload: rc_failed 3 rc_status -v ;; status) echo -n "Checking for service xsp2 " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Return value is slightly different for the status command: # 0 - service up and running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running (unused) # 4 - service status unknown :-( # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) # NOTE: checkproc returns LSB compliant status values. /sbin/checkproc -p $XSP_PIDFILE $MONO_BIN # NOTE: rc_status knows that we called this init script with # "status" option and adapts its messages accordingly. rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac rc_exit xsp-4.2/packaging/opensuse/sysconfig.xsp20000664000175000017500000000111112627046413015522 00000000000000## Path: Network/Remote access/xsp2 ## Description: XSP2 server settings ## Type: string ## Default: "" ## ServiceRestart: xsp2 # # Port on which xsp2 is to listen for requests # XSP_PORT="8080" # # Address on which xsp2 is to listen for requests # XSP_ADDRESS="0.0.0.0" # # Configuration directory which contains application definition files # XSP_APPCONFIGDIR="/etc/xsp/2.0/applications-enabled/" # # Should mono be ran with debugging enabled (backtraces with lines on errors) # XSP_DEBUG="no" # # Extra options you might want to pass to xsp2, see man xsp # XSP_EXTRA_OPTIONS="" xsp-4.2/packaging/Makefile.am0000664000175000017500000000002112627046413013072 00000000000000SUBDIRS=opensuse xsp-4.2/INSTALL0000664000175000017500000000250712627046413010156 00000000000000* Compiling and installing XSP ------------------------------- We will assume you want to install XSP in /usr. To compile XSP from a fresh git clone (as opposed to a tarball), run this first: ./autogen.sh To compile XSP and install it to /usr: ./configure --prefix=/usr make make install If you don't specify --prefix, it will default to /usr/local. If ./configure finds a working 'gmcs' it will automatically build a 2.0 profile version of xsp, named xsp2. * Running XSP with the bundled tests ------------------------------------ Go to /usr/lib/xsp/test directory and run: mono /usr/bin/xsp.exe You can optionally provide a port where the server should listen on: mono /usr/bin/xsp.exe --port 80 The default port is 8080. There are other command line options. Run: mono /usr/bin/xsp.exe --help to display all of them. Notes for MS runtime users ---------------------------- If you're compiling under windows, you may need to copy xsp.exe, ICSharpCode.SharpZipLib.dll and Mono.Http.dll (distributed with mono) to xsp/server and xsp/server/test/bin directories if it's not installed for the system. (*) In windows, if you want to build xsp using csc, do: MCS=csc make You will also need IIS with support for ASP.NET for xsp to work with the MS runtime. xsp-4.2/src/0000775000175000017500000000000012627055647010001 500000000000000xsp-4.2/src/mono.snk0000664000175000017500000000112412627046413011373 00000000000000$RSA2yw:kz.tѯ̓t+,4GM$G~hSoNF^՗.m6p/ MHֱ/F_I.d/^d%F+=QТY_z{ is9~ \@9Oxsp-4.2/src/TODO0000664000175000017500000000062112627046413010377 00000000000000 * Move Mono.WebServer.FastCgi/CondifgurationManager.cs to Mono.WebServer. * Fix Mono.WebServer.FastCgi/ApplicationManager.cs' automapping feature and move it to Mono.WebServer. * Write unit tests for ApplicationManager.cs' automapping. * Reuse the Configuration- and ApplicatioManager in Mono.WebServer.Apache and .XSP. * Write fastcgi-mono-server(1) (partly done), import Brian's docs. xsp-4.2/src/Mono.WebServer/0000775000175000017500000000000012627055647012614 500000000000000xsp-4.2/src/Mono.WebServer/ChangeLog0000664000175000017500000000223212627046413014274 000000000000002010-05-28 Marek Habersack * ApplicationServer.cs: OnAccept sends BeginAccept exceptions back to the client and then re-throws the exception. Fixes bug #609787 2010-04-05 Gonzalo Paniagua Javier * LingeringNetworkStream.cs: shutdown our side in LingeringClose, otherwise it will take 50ms to close the socket. 2010-03-18 Marek Habersack * Utility.cs: added * LingeringNetworkStream.cs: don't shutdown the socket in LingeringClose - it will be done later. * ApplicationServer.cs: fixed a typo in a lock block All the checks for whether socket is connected are performed in a safe manner. 2010-03-01 Marek Habersack * XSPWorker.cs: close makes sure to unregister socket, so that there's no reference to it held by ApplicationServer. * ApplicationServer.cs: added a new public method, ShutdownSockets, to be called in single app mode to properly close all the listening and the accepted sockets. Added a pair of methods, {Register,Unregister}Socket to keep track of all the sockets to clean up in ShutdownSockets above. All sockets have SO_LINGER on. xsp-4.2/src/Mono.WebServer/Paths.cs0000664000175000017500000000512412627046413014133 00000000000000// // Paths.cs // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Copyright (c) Copyright 2002-2007 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Web; using System.Web.Hosting; namespace Mono.WebServer { public static class Paths { public static void GetPathsFromUri (IApplicationHost appHost, string verb, string uri, out string realUri, out string pathInfo) { // There's a hidden missing feature here... :) realUri = uri; pathInfo = String.Empty; string vpath = HttpRuntime.AppDomainAppVirtualPath; int vpathLen = vpath.Length; if (vpath [vpathLen - 1] != '/') vpath += '/'; if (vpathLen > uri.Length) return; uri = uri.Substring (vpathLen); while (uri.Length > 0 && uri [0] == '/') uri = uri.Substring (1); int lastSlash = uri.Length; for (int dot = uri.LastIndexOf ('.'); dot > 0; dot = uri.LastIndexOf ('.', dot - 1)) { int slash = uri.IndexOf ('/', dot); if (slash == -1) slash = lastSlash; string partial = uri.Substring (0, slash); lastSlash = slash; if (!VirtualPathExists (appHost, verb, partial)) continue; realUri = vpath + uri.Substring (0, slash); pathInfo = uri.Substring (slash); break; } } static bool VirtualPathExists (IApplicationHost appHost, string verb, string uri) { if (appHost.IsHttpHandler (verb, uri)) return true; VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider; return vpp != null && vpp.FileExists ("/" + uri); } } } xsp-4.2/src/Mono.WebServer/MapPathEventArgs.cs0000664000175000017500000000371512627046413016231 00000000000000// // Mono.WebServer.MapPathEventArgs // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Documentation: // Brian Nickel // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer { public class MapPathEventArgs : EventArgs { // Contains the virtual path, as used in the request. // Contains the physical "mapped" path. string mapped; // Indicates whether or not the path has been mapped. public MapPathEventArgs (string path) { Path = path; IsMapped = false; } public string Path { get; private set; } public bool IsMapped { get; private set; } public string MappedPath { get { return mapped; } set { mapped = value; IsMapped = !String.IsNullOrEmpty (value); } } } } xsp-4.2/src/Mono.WebServer/Worker.cs0000664000175000017500000000351412627046413014326 00000000000000// // Mono.WebServer.Worker // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Documentation: // Brian Nickel // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public abstract class Worker { public virtual bool IsAsync { get { return false; } } public virtual void SetReuseCount (int reuses) { } public virtual int GetRemainingReuses () { return 0; } public abstract void Run (object state); public abstract int Read (byte [] buffer, int position, int size); public abstract void Write (byte [] buffer, int position, int size); public abstract void Close (); public abstract void Flush (); public abstract bool IsConnected (); } } xsp-4.2/src/Mono.WebServer/IRequestBroker.cs0000664000175000017500000000254212627046413015763 00000000000000// // Mono.WebServer.IRequestBroker // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Documentation: // Brian Nickel // // (C) 2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public interface IRequestBroker { } } xsp-4.2/src/Mono.WebServer/EndOfRequestHandler.cs0000664000175000017500000000275412627046413016724 00000000000000// // Mono.WebServer.EndOfRequestHandler // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Documentation: // Brian Nickel // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public delegate void EndOfRequestHandler (MonoWorkerRequest request); } xsp-4.2/src/Mono.WebServer/FinePlatformID.cs0000664000175000017500000000244712627046413015664 00000000000000// // FinePlatformID.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public enum FinePlatformID { Windows, Linux, MacOSX } }xsp-4.2/src/Mono.WebServer/Options/0000775000175000017500000000000012627055647014247 500000000000000xsp-4.2/src/Mono.WebServer/Options/Descriptions.cs0000664000175000017500000001173512627046413017162 00000000000000// // Descriptions.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Options { public static class Descriptions { public const string MaxConns = "Specifies the maximum number of concurrent connections the server should accept."; public const string LogLevels = "Specifies what log levels to log. It can be any of the following values, or multiple if comma separated:\n" + "* Debug\n" + "* Notice\n" + "* Warning\n" + "* Error\n" + "* Standard (Notice,Warning,Error)\n" + "* All (Debug,Standard)\n" + "This value is only used when \"logfile\" or \"printlog\" are set."; public const string Socket = "Specifies the type of socket to listen on. Valid values are \"pipe\", \"unix\", and \"tcp\".\n" + "\"pipe\" indicates to use piped socket opened by the web server when it spawns the application.\n" + "\"unix\" indicates that a standard unix socket should be opened.\n" + " The file name can be specified in the \"filename\" argument or appended to this argument with a colon, eg:\n" + " unix\n unix:/tmp/fastcgi-mono-socket\n" + "\"tcp\" indicates that a TCP socket should be opened. " + " The address and port can be specified in the \"port\" and \"address\" arguments or appended to this argument with a colon, eg:\n" + " tcp\n tcp:8081\n tcp:127.0.0.1:8081\n tcp:0.0.0.0:8081"; public const string AppConfigFile = "Adds application definitions from an XML configuration file, typically with the \".webapp\" extension. " + "See sample configuration file that comes with the server."; public const string AppConfigDir = "Adds application definitions from all XML files found in the specified directory. " + "Files must have the \".webapp\" extension."; public const string ConfigFile = "Specifies a file containing configuration options, identical to those available in the command line."; public const string Stoppable = "Allows the user to stop the server by pressing \"Enter\". " + "This should not be used when the server has no controlling terminal."; internal const string Address = "Specifies the IP address to listen on."; public const string Port = "Specifies the TCP port number to listen on."; internal const string Root = "Specifies the root directory the server changes to before doing performing any operations.\n" + "This value is only used when \"appconfigfile\", \"appconfigdir\", or \"applications\" is set, to provide a relative base path."; // TODO: use markup (sigh) for better formatting public const string Applications = "Adds applications from a comma separated list of virtual and physical directory pairs. " + "The pairs are separated by colons and optionally include the virtual host name and port to use:\n" + " [hostname:[port:]]VPath:realpath,...\n" + "Samples:\n" + " /:.\n" + " The virtual root directory, \"/\", is mapped to the current directory or \"root\" if specified." + " /blog:../myblog\n" + " The virtual /blog is mapped to ../myblog\n" + " myhost.someprovider.net:/blog:../myblog\n" + " The virtual /blog at myhost.someprovider.net is mapped to ../myblog.\n" + " This means that other host names, like \"localhost\" will not be mapped.\n" + " /:.,/blog:../myblog\n" + " Two applications like the above ones are handled.\n" + " *:80:/:standard,*:433:/:secure\n" + " The server uses different applications on the unsecure and secure ports."; public const string Terminate = "Gracefully terminates a running mod-mono-server instance. " + "All other options but --filename or --address and --port are ignored if this option is provided."; public const string Master = "This instance will be used to by mod_mono to create ASP.NET applications on demand. " + "If this option is provided, there is no need to provide a list of applications to start."; } }xsp-4.2/src/Mono.WebServer/Options/Options.cs0000664000175000017500000007042412627046413016147 00000000000000// // Options.cs // // Authors: // Jonathan Pryor // // Copyright (C) 2008 Novell (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // // A Getopt::Long-inspired option parsing library for C#. // // NDesk.Options.OptionSet is built upon a key/value table, where the // key is a option format string and the value is a delegate that is // invoked when the format string is matched. // // Option format strings: // Regex-like BNF Grammar: // name: .+ // type: [=:] // sep: ( [^{}]+ | '{' .+ '}' )? // aliases: ( name type sep ) ( '|' name type sep )* // // Each '|'-delimited name is an alias for the associated action. If the // format string ends in a '=', it has a required value. If the format // string ends in a ':', it has an optional value. If neither '=' or ':' // is present, no value is supported. `=' or `:' need only be defined on one // alias, but if they are provided on more than one they must be consistent. // // Each alias portion may also end with a "key/value separator", which is used // to split option values if the option accepts > 1 value. If not specified, // it defaults to '=' and ':'. If specified, it can be any character except // '{' and '}' OR the *string* between '{' and '}'. If no separator should be // used (i.e. the separate values should be distinct arguments), then "{}" // should be used as the separator. // // Options are extracted either from the current option by looking for // the option name followed by an '=' or ':', or is taken from the // following option IFF: // - The current option does not contain a '=' or a ':' // - The current option requires a value (i.e. not a Option type of ':') // // The `name' used in the option format string does NOT include any leading // option indicator, such as '-', '--', or '/'. All three of these are // permitted/required on any named option. // // Option bundling is permitted so long as: // - '-' is used to start the option group // - all of the bundled options are a single character // - at most one of the bundled options accepts a value, and the value // provided starts from the next character to the end of the string. // // This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' // as '-Dname=value'. // // Option processing is disabled by specifying "--". All options after "--" // are returned by OptionSet.Parse() unchanged and unprocessed. // // Unprocessed options are returned from OptionSet.Parse(). // // Examples: // int verbose = 0; // OptionSet p = new OptionSet () // .Add ("v", v => ++verbose) // .Add ("name=|value=", v => Console.WriteLine (v)); // p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); // // The above would parse the argument string array, and would invoke the // lambda expression three times, setting `verbose' to 3 when complete. // It would also print out "A" and "B" to standard output. // The returned array would contain the string "extra". // // C# 3.0 collection initializers are supported and encouraged: // var p = new OptionSet () { // { "h|?|help", v => ShowHelp () }, // }; // // System.ComponentModel.TypeConverter is also supported, allowing the use of // custom data types in the callback type; TypeConverter.ConvertFromString() // is used to convert the value option to an instance of the specified // type: // // var p = new OptionSet () { // { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, // }; // // Random other tidbits: // - Boolean options (those w/o '=' or ':' in the option format string) // are explicitly enabled if they are followed with '+', and explicitly // disabled if they are followed with '-': // string a = null; // var p = new OptionSet () { // { "a", s => a = s }, // }; // p.Parse (new string[]{"-a"}); // sets a != null // p.Parse (new string[]{"-a+"}); // sets a != null // p.Parse (new string[]{"-a-"}); // sets a == null // using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Runtime.Serialization; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; namespace NDesk.Options { public class OptionValueCollection : IList { readonly List values = new List (); readonly OptionContext context; internal OptionValueCollection (OptionContext context) { this.context = context; } #region ICollection public void Add (string item) {values.Add (item);} public void Clear () {values.Clear ();} public bool Contains (string item) {return values.Contains (item);} public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);} public bool Remove (string item) {return values.Remove (item);} public int Count {get {return values.Count;}} public bool IsReadOnly {get {return false;}} #endregion #region IEnumerable IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();} #endregion #region IEnumerable public IEnumerator GetEnumerator () {return values.GetEnumerator ();} #endregion #region IList public int IndexOf (string item) {return values.IndexOf (item);} public void Insert (int index, string item) {values.Insert (index, item);} public void RemoveAt (int index) {values.RemoveAt (index);} void AssertValid (int index) { if (context.Option == null) throw new InvalidOperationException ("OptionContext.Option is null."); if (index >= context.Option.MaxValueCount) throw new ArgumentOutOfRangeException ("index"); if (context.Option.OptionValueType == OptionValueType.Required && index >= values.Count) throw new OptionException (String.Format ( context.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), context.OptionName), context.OptionName); } public string this [int index] { get { AssertValid (index); return index >= values.Count ? null : values [index]; } set { values [index] = value; } } #endregion public List ToList () { return new List (values); } public string[] ToArray () { return values.ToArray (); } public override string ToString () { return String.Join (", ", values.ToArray ()); } } public class OptionContext { public OptionContext (OptionSet set) { OptionSet = set; OptionValues = new OptionValueCollection (this); } public Option Option { get; set; } public string OptionName { get; set; } public int OptionIndex { get; set; } public OptionSet OptionSet { get; private set; } public OptionValueCollection OptionValues { get; private set; } } public enum OptionValueType { None, Optional, Required, } public abstract class Option { protected Option (string prototype, string description) : this (prototype, description, 1) { } protected Option (string prototype, string description, int maxValueCount) { if (prototype == null) throw new ArgumentNullException ("prototype"); if (prototype.Length == 0) throw new ArgumentException ("Cannot be the empty string.", "prototype"); if (maxValueCount < 0) throw new ArgumentOutOfRangeException ("maxValueCount"); Prototype = prototype; Description = description; Names = prototype.Split ('|'); MaxValueCount = maxValueCount; OptionValueType = ParsePrototype (); if (MaxValueCount == 0 && OptionValueType != OptionValueType.None) throw new ArgumentException ( "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + "OptionValueType.Optional.", "maxValueCount"); if (OptionValueType == OptionValueType.None && maxValueCount > 1) throw new ArgumentException ( String.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), "maxValueCount"); if (Array.IndexOf (Names, "<>") >= 0 && ((Names.Length == 1 && OptionValueType != OptionValueType.None) || (Names.Length > 1 && MaxValueCount > 1))) throw new ArgumentException ( "The default option handler '<>' cannot require values.", "prototype"); } public string Prototype { get; private set; } public string Description { get; private set; } public OptionValueType OptionValueType { get; private set; } public int MaxValueCount { get; private set; } public string[] GetNames () { return (string[]) Names.Clone (); } public string[] GetValueSeparators () { if (ValueSeparators == null) return new string [0]; return (string[]) ValueSeparators.Clone (); } protected static T Parse (string value, OptionContext c) { TypeConverter conv = TypeDescriptor.GetConverter (typeof (T)); T t = default (T); try { if (value != null) t = (T) conv.ConvertFromString (value); } catch (Exception e) { throw new OptionException ( String.Format ( c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."), value, typeof (T).Name, c.OptionName), c.OptionName, e); } return t; } internal string[] Names { get; private set; } internal string[] ValueSeparators { get; private set; } static readonly char[] nameTerminator = {'=', ':'}; OptionValueType ParsePrototype () { char type = '\0'; var seps = new List (); for (int i = 0; i < Names.Length; ++i) { string name = Names [i]; if (name.Length == 0) throw new ArgumentException ("Empty option names are not supported."); int end = name.IndexOfAny (nameTerminator); if (end == -1) continue; Names [i] = name.Substring (0, end); if (type == '\0' || type == name [end]) type = name [end]; else throw new ArgumentException ( String.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end])); AddSeparators (name, end, seps); } if (type == '\0') return OptionValueType.None; if (MaxValueCount <= 1 && seps.Count != 0) throw new ArgumentException ( String.Format ("Cannot provide key/value separators for Options taking {0} value(s).", MaxValueCount)); if (MaxValueCount > 1) { if (seps.Count == 0) ValueSeparators = new[]{":", "="}; else if (seps.Count == 1 && seps [0].Length == 0) ValueSeparators = null; else ValueSeparators = seps.ToArray (); } return type == '=' ? OptionValueType.Required : OptionValueType.Optional; } static void AddSeparators (string name, int end, ICollection seps) { int start = -1; for (int i = end+1; i < name.Length; ++i) { switch (name [i]) { case '{': if (start != -1) throw new ArgumentException ( String.Format ("Ill-formed name/value separator found in \"{0}\".", name), "name"); start = i+1; break; case '}': if (start == -1) throw new ArgumentException ( String.Format ("Ill-formed name/value separator found in \"{0}\".", name), "name"); seps.Add (name.Substring (start, i-start)); start = -1; break; default: if (start == -1) seps.Add (name [i].ToString ()); break; } } if (start != -1) throw new ArgumentException ( String.Format ("Ill-formed name/value separator found in \"{0}\".", name), "name"); } public void Invoke (OptionContext c) { OnParseComplete (c); c.OptionName = null; c.Option = null; c.OptionValues.Clear (); } protected abstract void OnParseComplete (OptionContext c); public override string ToString () { return Prototype; } } [Serializable] public class OptionException : Exception { public OptionException () { } public OptionException (string message, string optionName) : base (message) { OptionName = optionName; } public OptionException (string message, string optionName, Exception innerException) : base (message, innerException) { OptionName = optionName; } protected OptionException (SerializationInfo info, StreamingContext context) : base (info, context) { OptionName = info.GetString ("OptionName"); } public string OptionName { get; private set; } [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)] public override void GetObjectData (SerializationInfo info, StreamingContext context) { base.GetObjectData (info, context); info.AddValue ("OptionName", OptionName); } } public delegate void OptionAction (TKey key, TValue value); public class OptionSet : KeyedCollection { public OptionSet () : this (f => f) { } public OptionSet (Converter localizer) { MessageLocalizer = localizer; } public Converter MessageLocalizer { get; private set; } protected override string GetKeyForItem (Option item) { if (item == null) throw new ArgumentNullException ("item"); if (item.Names != null && item.Names.Length > 0) return item.Names [0]; // This should never happen, as it's invalid for Option to be // constructed w/o any names. throw new InvalidOperationException ("Option has no names!"); } [Obsolete ("Use KeyedCollection.this[string]")] protected Option GetOptionForName (string option) { if (option == null) throw new ArgumentNullException ("option"); try { return base [option]; } catch (KeyNotFoundException) { return null; } } protected override void InsertItem (int index, Option item) { base.InsertItem (index, item); AddImpl (item); } protected override void RemoveItem (int index) { base.RemoveItem (index); Option p = Items [index]; // KeyedCollection.RemoveItem() handles the 0th item for (int i = 1; i < p.Names.Length; ++i) { Dictionary.Remove (p.Names [i]); } } protected override void SetItem (int index, Option item) { base.SetItem (index, item); RemoveItem (index); AddImpl (item); } void AddImpl (Option option) { if (option == null) throw new ArgumentNullException ("option"); var added = new List (option.Names.Length); try { // KeyedCollection.InsertItem/SetItem handle the 0th name. for (int i = 1; i < option.Names.Length; ++i) { Dictionary.Add (option.Names [i], option); added.Add (option.Names [i]); } } catch (Exception) { foreach (string name in added) Dictionary.Remove (name); throw; } } public new OptionSet Add (Option option) { base.Add (option); return this; } sealed class ActionOption : Option { readonly Action action; public ActionOption (string prototype, string description, int count, Action action) : base (prototype, description, count) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (c.OptionValues); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 1, v => action (v [0])); base.Add (p); return this; } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { if (action == null) throw new ArgumentNullException ("action"); Option p = new ActionOption (prototype, description, 2, v => action (v [0], v [1])); base.Add (p); return this; } sealed class ActionOption : Option { readonly Action action; public ActionOption (string prototype, string description, Action action) : base (prototype, description, 1) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action (Parse (c.OptionValues [0], c)); } } sealed class ActionOption : Option { readonly OptionAction action; public ActionOption (string prototype, string description, OptionAction action) : base (prototype, description, 2) { if (action == null) throw new ArgumentNullException ("action"); this.action = action; } protected override void OnParseComplete (OptionContext c) { action ( Parse (c.OptionValues [0], c), Parse (c.OptionValues [1], c)); } } public OptionSet Add (string prototype, Action action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, Action action) { return Add (new ActionOption (prototype, description, action)); } public OptionSet Add (string prototype, OptionAction action) { return Add (prototype, null, action); } public OptionSet Add (string prototype, string description, OptionAction action) { return Add (new ActionOption (prototype, description, action)); } protected virtual OptionContext CreateOptionContext () { return new OptionContext (this); } public List Parse (IEnumerable arguments) { OptionContext c = CreateOptionContext (); c.OptionIndex = -1; bool process = true; var unprocessed = new List (); Option def = Contains ("<>") ? this ["<>"] : null; foreach (string argument in arguments) { ++c.OptionIndex; if (argument == "--") { process = false; continue; } if (!process) { Unprocessed (unprocessed, def, c, argument); continue; } if (!Parse (argument, c)) Unprocessed (unprocessed, def, c, argument); } if (c.Option != null) c.Option.Invoke (c); return unprocessed; } static void Unprocessed (ICollection extra, Option def, OptionContext c, string argument) { if (def == null) { extra.Add (argument); return; } c.OptionValues.Add (argument); c.Option = def; c.Option.Invoke (c); } readonly Regex valueOption = new Regex ( @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value) { if (argument == null) throw new ArgumentNullException ("argument"); flag = name = sep = value = null; Match m = valueOption.Match (argument); if (!m.Success) { return false; } flag = m.Groups ["flag"].Value; name = m.Groups ["name"].Value; if (m.Groups ["sep"].Success && m.Groups ["value"].Success) { sep = m.Groups ["sep"].Value; value = m.Groups ["value"].Value; } return true; } protected virtual bool Parse (string argument, OptionContext c) { if (c.Option != null) { ParseValue (argument, c); return true; } string f, n, s, v; if (!GetOptionParts (argument, out f, out n, out s, out v)) return false; if (Contains (n)) { Option p = this [n]; c.OptionName = f + n; c.Option = p; switch (p.OptionValueType) { case OptionValueType.None: c.OptionValues.Add (n); c.Option.Invoke (c); break; case OptionValueType.Optional: case OptionValueType.Required: ParseValue (v, c); break; } return true; } // no match; is it a bool option? if (ParseBool (argument, n, c)) return true; // is it a bundled option? if (ParseBundledValue (f, String.Concat (n, s, v), c)) return true; return false; } void ParseValue (string option, OptionContext c) { if (option != null) foreach (string o in c.Option.ValueSeparators != null ? option.Split (c.Option.ValueSeparators, StringSplitOptions.None) : new[]{option}) { c.OptionValues.Add (o); } if (c.OptionValues.Count == c.Option.MaxValueCount || c.Option.OptionValueType == OptionValueType.Optional) c.Option.Invoke (c); else if (c.OptionValues.Count > c.Option.MaxValueCount) { throw new OptionException (MessageLocalizer (String.Format ( "Error: Found {0} option values when expecting {1}.", c.OptionValues.Count, c.Option.MaxValueCount)), c.OptionName); } } bool ParseBool (string option, string n, OptionContext c) { string rn; if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') && Contains ((rn = n.Substring (0, n.Length-1)))) { Option p = this [rn]; string v = n [n.Length-1] == '+' ? option : null; c.OptionName = option; c.Option = p; c.OptionValues.Add (v); p.Invoke (c); return true; } return false; } bool ParseBundledValue (string f, string n, OptionContext c) { if (f != "-") return false; for (int i = 0; i < n.Length; ++i) { string opt = f + n [i]; string rn = n [i].ToString (); if (!Contains (rn)) { if (i == 0) return false; throw new OptionException (String.Format (MessageLocalizer ( "Cannot bundle unregistered option '{0}'."), opt), opt); } Option p = this [rn]; switch (p.OptionValueType) { case OptionValueType.None: Invoke (c, opt, n, p); break; case OptionValueType.Optional: case OptionValueType.Required: { string v = n.Substring (i+1); c.Option = p; c.OptionName = opt; ParseValue (v.Length != 0 ? v : null, c); return true; } default: throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType); } } return true; } static void Invoke (OptionContext c, string name, string value, Option option) { c.OptionName = name; c.Option = option; c.OptionValues.Add (value); option.Invoke (c); } const int OPTION_WIDTH = 29; public void WriteOptionDescriptions (TextWriter o) { foreach (Option p in this) { int written = 0; if (!WriteOptionPrototype (o, p, ref written)) continue; if (written < OPTION_WIDTH) o.Write (new string (' ', OPTION_WIDTH - written)); else { o.WriteLine (); o.Write (new string (' ', OPTION_WIDTH)); } List lines = GetLines (MessageLocalizer (GetDescription (p.Description))); o.WriteLine (lines [0]); var prefix = new string (' ', OPTION_WIDTH+2); for (int i = 1; i < lines.Count; ++i) { o.Write (prefix); o.WriteLine (lines [i]); } } } bool WriteOptionPrototype (TextWriter o, Option p, ref int written) { string[] names = p.Names; int i = GetNextOptionIndex (names, 0); if (i == names.Length) return false; if (names [i].Length == 1) { Write (o, ref written, " -"); Write (o, ref written, names [0]); } else { Write (o, ref written, " --"); Write (o, ref written, names [0]); } for ( i = GetNextOptionIndex (names, i+1); i < names.Length; i = GetNextOptionIndex (names, i+1)) { Write (o, ref written, ", "); Write (o, ref written, names [i].Length == 1 ? "-" : "--"); Write (o, ref written, names [i]); } if (p.OptionValueType == OptionValueType.Optional || p.OptionValueType == OptionValueType.Required) { if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, MessageLocalizer ("[")); } Write (o, ref written, MessageLocalizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description))); string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 ? p.ValueSeparators [0] : " "; for (int c = 1; c < p.MaxValueCount; ++c) { Write (o, ref written, MessageLocalizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description))); } if (p.OptionValueType == OptionValueType.Optional) { Write (o, ref written, MessageLocalizer ("]")); } } return true; } static int GetNextOptionIndex (string[] names, int i) { while (i < names.Length && names [i] == "<>") { ++i; } return i; } static void Write (TextWriter o, ref int n, string s) { n += s.Length; o.Write (s); } static string GetArgumentName (int index, int maxIndex, string description) { if (String.IsNullOrEmpty (description)) return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); string[] nameStart = maxIndex == 1 ? new[] { "{0:", "{" } : new[] { "{" + index + ":" }; foreach (string name in nameStart) { int start, j = 0; do { start = description.IndexOf (name, j); } while (start >= 0 && j != 0 && description [j++ - 1] == '{'); if (start == -1) continue; int end = description.IndexOf ("}", start); if (end == -1) continue; return description.Substring (start + name.Length, end - start - name.Length); } return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); } static string GetDescription (string description) { if (String.IsNullOrEmpty (description)) return String.Empty; var sb = new StringBuilder (description.Length); int start = -1; for (int i = 0; i < description.Length; ++i) { switch (description [i]) { case '{': if (i == start) { sb.Append ('{'); start = -1; } else if (start < 0) start = i + 1; break; case '}': if (start < 0) { if ((i+1) == description.Length || description [i+1] != '}') throw new InvalidOperationException ("Invalid option description: " + description); ++i; sb.Append ("}"); } else { sb.Append (description.Substring (start, i - start)); start = -1; } break; case ':': if (start < 0) goto default; start = i + 1; break; default: if (start < 0) sb.Append (description [i]); break; } } return sb.ToString (); } static List GetLines (string description) { var lines = new List (); if (String.IsNullOrEmpty (description)) { lines.Add (String.Empty); return lines; } const int length = 80 - OPTION_WIDTH - 2; int start = 0, end; do { end = GetLineEnd (start, length, description); bool cont = false; if (end < description.Length) { char c = description [end]; if (c == '-' || (char.IsWhiteSpace (c) && c != '\n')) ++end; else if (c != '\n') { cont = true; --end; } } lines.Add (description.Substring (start, end - start)); if (cont) { lines [lines.Count-1] += "-"; } start = end; if (start < description.Length && description [start] == '\n') ++start; } while (end < description.Length); return lines; } static int GetLineEnd (int start, int length, string description) { int end = Math.Min (start + length, description.Length); int sep = -1; for (int i = start; i < end; ++i) { switch (description [i]) { case ' ': case '\t': case '\v': case '-': case ',': case '.': case ';': sep = i; break; case '\n': return i; } } if (sep == -1 || end == description.Length) return end; return sep; } } } xsp-4.2/src/Mono.WebServer/Options/ConfigurationManager.cs0000664000175000017500000001117712627046413020616 00000000000000// // ConfigurationManager.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Globalization; using System.IO; using System.Xml; using Mono.Unix; using Mono.WebServer.Log; using NDesk.Options; using Mono.WebServer.Options.Settings; namespace Mono.WebServer.Options { public abstract partial class ConfigurationManager { const string EXCEPT_BAD_ELEM = "XML setting \"{0}={1}\" is invalid."; readonly SettingsCollection settings; [Obsolete] internal SettingsCollection Settings { get { return settings; } } public bool TryLoadXmlConfig (string file) { if (String.IsNullOrEmpty (file)) throw new ArgumentNullException ("file"); var doc = new XmlDocument (); try { doc.Load (file); } catch (FileNotFoundException e) { Console.Error.WriteLine("ERROR: Couldn't find configuration file {0}!", e.FileName); return false; } if (Platform.IsUnix) { var fileInfo = new UnixFileInfo (file); ImportSettings (doc, true, file, fileInfo.OwnerUser.UserName, fileInfo.OwnerGroup.GroupName); } else ImportSettings (doc, true, file); return true; } [Obsolete] public void ImportSettings (XmlDocument doc, bool insertEmptyValue) { ImportSettings (doc, insertEmptyValue, null); } void ImportSettings (XmlDocument doc, bool insertEmptyValue, string filename , string user = null, string group = null) { if (doc == null) throw new ArgumentNullException ("doc"); var tags = doc.GetElementsByTagName ("Setting"); foreach (XmlElement setting in tags) { string name = GetXmlValue (setting, "Name"); string value = Parse (GetXmlValue (setting, "Value"), filename, user, group); if (name.Length == 0) throw AppExcept (EXCEPT_BAD_ELEM, name, value); if (settings.Contains (name)) { if (insertEmptyValue || value.Length > 0) settings [name].MaybeParseUpdate (SettingSource.Xml, value); } else Logger.Write (LogLevel.Warning, "Unrecognized xml setting: {0} with value {1}", name, value); } } static string Parse (string value, string filename, string user, string group) { if (!String.IsNullOrEmpty (filename)) value = value.Replace ("$(filename)", Path.GetFileNameWithoutExtension (filename)); if (!String.IsNullOrEmpty (user)) value = value.Replace ("$(user)", user); if (!String.IsNullOrEmpty (group)) value = value.Replace ("$(group)", group); return value; } public OptionSet CreateOptionSet () { var p = new OptionSet (); foreach (ISetting setting in settings) { var boolSetting = setting as Setting; if (boolSetting != null) { p.Add (setting.Prototype, setting.Description, v => boolSetting.MaybeUpdate (SettingSource.CommandLine, v != null)); } else { ISetting setting1 = setting; // Used in closure, must copy p.Add (setting.Prototype + "=", setting.Description, v => { if (v != null) setting1.MaybeParseUpdate (SettingSource.CommandLine, v); } ); } } return p; } static ApplicationException AppExcept (string message, params object [] args) { return new ApplicationException (String.Format ( CultureInfo.InvariantCulture, message, args)); } static string GetXmlValue (XmlElement elem, string name) { string value = elem.GetAttribute (name); if (!String.IsNullOrEmpty (value)) return value; foreach (XmlElement child in elem.GetElementsByTagName (name)) { value = child.InnerText; if (!String.IsNullOrEmpty (value)) return value; } return String.Empty; } } } xsp-4.2/src/Mono.WebServer/Options/IHelpConfigurationManager.cs0000664000175000017500000000263712627046413021541 00000000000000// // IHelpConfigurationManager.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using NDesk.Options; namespace Mono.WebServer.Options { public interface IHelpConfigurationManager { string ProgramName { get; } string Description { get; } OptionSet CreateOptionSet (); } }xsp-4.2/src/Mono.WebServer/Options/Settings/0000775000175000017500000000000012627055647016047 500000000000000xsp-4.2/src/Mono.WebServer/Options/Settings/Int32Setting.cs0000664000175000017500000000310512627046413020541 00000000000000// // Int32Setting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class Int32Setting : Setting { public Int32Setting (string name, string description, string appSetting = null, string environment = null, int defaultValue = default(Int32), string prototype = null) : base (name, Int32.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/ISetting.cs0000664000175000017500000000303012627046413020027 00000000000000// // ISetting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public interface ISetting { string Name { get; } string Description { get; } string AppSetting { get; } string Environment { get; } string Prototype { get; } [Obsolete] object Value { get; } void MaybeParseUpdate (SettingSource settingSource, string value); } }xsp-4.2/src/Mono.WebServer/Options/Settings/Parser.cs0000664000175000017500000000245512627046413017547 00000000000000// // Parser.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Options.Settings { public delegate bool Parser (string input, out T output); }xsp-4.2/src/Mono.WebServer/Options/Settings/NullableInt32Setting.cs0000664000175000017500000000313412627046413022222 00000000000000// // NullableInt32Setting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class NullableInt32Setting : NullableSetting { public NullableInt32Setting (string name, string description, string appSetting = null, string environment = null, int? defaultValue = null, string prototype = null) : base (name, Int32.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/NullableUInt16Setting.cs0000664000175000017500000000314612627046413022354 00000000000000// // NullableUInt16Setting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class NullableUInt16Setting : NullableSetting { public NullableUInt16Setting (string name, string description, string appSetting = null, string environment = null, ushort? defaultValue = null, string prototype = null) : base (name, UInt16.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/StringSetting.cs0000664000175000017500000000327612627046413021121 00000000000000// // StringSetting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class StringSetting : Setting { public StringSetting (string name, string description, string appSetting = null, string environment = null, string defaultValue = null, string prototype = null) : base (name, FakeParse, description, appSetting, environment, defaultValue, prototype) { } static bool FakeParse (string value, out string result) { result = value; return !String.IsNullOrEmpty (value); } } }xsp-4.2/src/Mono.WebServer/Options/Settings/SettingSource.cs0000664000175000017500000000252612627046413021110 00000000000000// // SettingSource.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Options.Settings { public enum SettingSource { Default, AppSettings, Environment, Xml, CommandLine } }xsp-4.2/src/Mono.WebServer/Options/Settings/Setting.cs0000664000175000017500000000607112627046413017726 00000000000000// // Settings.cs. // // Author: // Leonardo Taglialegne // // Copyright (C) 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class Setting : ISetting { // TODO: Find a clean way to make this static readonly Parser parser; public Setting (string name, Parser parser, string description, string appSetting = null, string environment = null, T defaultValue = default (T), string prototype = null) { Prototype = prototype ?? name; Description = description; AppSetting = appSetting; Environment = environment; Name = name; this.parser = parser; Value = defaultValue; if (!String.IsNullOrEmpty (environment)) foreach (string envVar in environment.Split ('|')) { string value = System.Environment.GetEnvironmentVariable (envVar); MaybeParseUpdate (SettingSource.Environment, value); } if (!String.IsNullOrEmpty (appSetting)) foreach (var appSett in appSetting.Split ('|')) { string value = System.Configuration.ConfigurationManager.AppSettings [appSett]; MaybeParseUpdate (SettingSource.AppSettings, value); } } public void MaybeParseUpdate (SettingSource settingSource, string value) { if (value == null) return; T result; if (parser (value, out result)) MaybeUpdate (settingSource, result); } public bool MaybeUpdate (SettingSource source, T value) { if (source < this.source) return false; Value = value; this.source = source; return true; } public static implicit operator T (Setting setting) { return setting.Value; } SettingSource source = SettingSource.Default; public string Name { get; private set; } public string Prototype { get; private set; } public string Environment { get; private set; } public string AppSetting { get; private set; } public string Description { get; private set; } public T Value { get; private set; } [Obsolete] object ISetting.Value { get { return Value; } } } }xsp-4.2/src/Mono.WebServer/Options/Settings/BoolSetting.cs0000664000175000017500000000307512627046413020543 00000000000000// // BoolSetting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class BoolSetting : Setting { public BoolSetting (string name, string description, string appSetting = null, string environment = null, bool defaultValue = false, string prototype = null) : base (name, Boolean.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/EnumSetting.cs0000664000175000017500000000355012627046413020552 00000000000000// // EnumSetting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class EnumSetting : Setting where T : struct { static bool EnumParser (string input, out TEnum output) { output = default (TEnum); try { output = (TEnum)Enum.Parse (typeof (TEnum), input, true); return true; } catch (ArgumentException) { // TODO: catch more specific type return false; } } public EnumSetting (string name, string description, string appSetting = null, string environment = null, T defaultValue = default(T), string prototype = null) : base (name, EnumParser, description, appSetting, environment, defaultValue, prototype) { } } } xsp-4.2/src/Mono.WebServer/Options/Settings/UInt32Setting.cs0000664000175000017500000000311412627046413020666 00000000000000// // UInt32Setting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class UInt32Setting : Setting { public UInt32Setting (string name, string description, string appSetting = null, string environment = null, uint defaultValue = default(UInt32), string prototype = null) : base (name, UInt32.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/UInt16Setting.cs0000664000175000017500000000312012627046413020665 00000000000000// // UInt16Setting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Options.Settings { public class UInt16Setting : Setting { public UInt16Setting (string name, string description, string appSetting = null, string environment = null, ushort defaultValue = default(UInt16), string prototype = null) : base (name, UInt16.TryParse, description, appSetting, environment, defaultValue, prototype) { } } }xsp-4.2/src/Mono.WebServer/Options/Settings/SettingsCollection.cs0000664000175000017500000000271212627046413022123 00000000000000// // SettingsCollection.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Collections.ObjectModel; namespace Mono.WebServer.Options.Settings { public sealed class SettingsCollection : KeyedCollection { protected override string GetKeyForItem (ISetting item) { return item.Name; } } }xsp-4.2/src/Mono.WebServer/Options/Settings/NullableSetting.cs0000664000175000017500000000353012627046413021402 00000000000000// // NullableSetting.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Options.Settings { public class NullableSetting:Setting where T : struct { public NullableSetting (string name, Parser parser, string description, string appSetting = null, string environment = null, T? defaultValue = null, string prototype = null) : base (name, ToNullable(parser), description, appSetting, environment, defaultValue, prototype) { } static Parser ToNullable (Parser parser) { return delegate (string input, out T? output) { T temp; if (!parser (input, out temp)) { output = null; return false; } output = temp; return true; }; } } } xsp-4.2/src/Mono.WebServer/Options/ServerConfigurationManager.cs0000664000175000017500000000613312627046413022001 00000000000000// // ServerConfigurationManager.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using Mono.WebServer.Options.Settings; namespace Mono.WebServer.Options { public abstract class ServerConfigurationManager : ConfigurationManager, IHelpConfigurationManager { #region Backing fields protected readonly StringSetting root = new StringSetting ("root", Descriptions.Root, "MonoServerRootDir", "MONO_ROOT|MONO_FCGI_ROOT", Environment.CurrentDirectory); readonly StringSetting applications = new StringSetting ("applications", Descriptions.Applications, "MonoApplications", "MONO_APPLICATIONS|MONO_FCGI_APPLICATIONS"); readonly StringSetting appConfigFile = new StringSetting ("appconfigfile", Descriptions.AppConfigFile, "MonoApplicationsConfigFile", "MONO_APPCONFIGFILE|MONO_FCGI_APPCONFIGFILE"); readonly StringSetting appConfigDir = new StringSetting ("appconfigdir", Descriptions.AppConfigDir, "MonoApplicationsConfigDir", "MONO_APPCONFIGDIR|MONO_FCGI_APPCONFIGDIR"); readonly UInt32Setting backlog = new UInt32Setting ("backlog", "The listen backlog.", defaultValue: 500); protected readonly Setting address = new Setting ("address", IPAddress.TryParse, Descriptions.Address, "MonoServerAddress", "MONO_ADDRESS|MONO_FCGI_ADDRESS", IPAddress.Loopback); #endregion #region Typesafe properties public string Root { get { return root; } } public string Applications { get { return applications; } } public string AppConfigFile { get { return appConfigFile; } } public string AppConfigDir { get { return appConfigDir; } } public uint Backlog { get { return backlog; } } public IPAddress Address { get { return address; } } #endregion public abstract string ProgramName { get; } public abstract string Description { get; } protected ServerConfigurationManager (string name) : base (name) { Add (root, applications, appConfigFile, appConfigDir, backlog, address); } } } xsp-4.2/src/Mono.WebServer/Options/ConfigurationManager.Fields.cs0000664000175000017500000001071312627046413022016 00000000000000// // ConfigurationManager.Fields.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.Log; using Mono.WebServer.Options.Settings; namespace Mono.WebServer.Options { public abstract partial class ConfigurationManager { protected ConfigurationManager (string name) { settings = new SettingsCollection {help, version, verbose, printlog, logFile, configFile, this.name, loglevels}; this.name.MaybeUpdate (SettingSource.Default, name); } #region Baking fields readonly BoolSetting help = new BoolSetting ("help", "Shows this help message and exits.", prototype: "?|h|help"); readonly BoolSetting version = new BoolSetting ("version", "Displays version information and exits.", "V|version"); readonly BoolSetting verbose = new BoolSetting ("verbose", "Prints extra messages. Mainly useful for debugging.", prototype: "v|verbose"); readonly BoolSetting printlog = new BoolSetting ("printlog", "Prints log messages to the console.", environment: "MONO_PRINTLOG|MONO_FCGI_PRINTLOG", defaultValue: true); readonly StringSetting logFile = new StringSetting ("logfile", "Specifies a file to log events to.", "FastCgiLogFile", "MONO_LOGFILE|MONO_FCGI_LOGFILE"); readonly StringSetting configFile = new StringSetting ("configfile|config-file", Descriptions.ConfigFile); readonly StringSetting name = new StringSetting ("name", "Specifies a name to print in the log"); readonly EnumSetting loglevels = new EnumSetting ("loglevels", Descriptions.LogLevels, "FastCgiLogLevels", "MONO_FCGI_LOGLEVELS", LogLevel.Standard); #endregion #region Typesafe properties public bool Help { get { return help; } } public bool Version { get { return version; } } public bool Verbose { get { return verbose; } } public bool PrintLog { get { return printlog; } } public string LogFile { get { return logFile; } } public string ConfigFile { get { return configFile; } } public string Name { get { return name; } } public LogLevel LogLevels { get { return loglevels; } } #endregion protected void Add (params ISetting[] settings) { if (settings == null) throw new ArgumentNullException ("settings"); foreach (ISetting setting in settings) this.settings.Add (setting); } public void SetupLogger () { Logger.Level = LogLevels; OpenLogFile (); Logger.WriteToConsole = PrintLog; Logger.Verbose = Verbose; Logger.Name = Name; } void OpenLogFile () { try { if (LogFile != null) Logger.Open (LogFile); } catch (Exception e) { Logger.Write (LogLevel.Error, "Error opening log file: {0}", e.Message); Logger.Write (LogLevel.Warning, "Events will not be logged to file."); } } /// /// If a configfile option was specified, tries to load /// the configuration file /// /// false on failure, true on success or /// option not present public bool LoadConfigFile () { try { if (ConfigFile != null) if(!TryLoadXmlConfig (ConfigFile)) return false; } catch (ApplicationException e) { Logger.Write (LogLevel.Error, e.Message); return false; } catch (System.Xml.XmlException e) { Logger.Write (LogLevel.Error, "Error reading XML configuration: {0}", e.Message); return false; } return true; } } } xsp-4.2/src/Mono.WebServer/Options/ConfigurationManagerExtensions.cs0000664000175000017500000000507212627046413022673 00000000000000// // ConfigurationManagerExtensions.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using NDesk.Options; namespace Mono.WebServer.Options { public static class ConfigurationManagerExtensions { public static void PrintHelp (this T configurationManager) where T : IHelpConfigurationManager { Version.Show (); Console.WriteLine (configurationManager.Description); Console.WriteLine ("Usage is:\n"); Console.WriteLine (" {0} [...]", configurationManager.ProgramName); Console.WriteLine (); configurationManager.CreateOptionSet ().WriteOptionDescriptions (Console.Out); } public static bool LoadCommandLineArgs (this T configurationManager, string [] cmd_args) where T : IHelpConfigurationManager { if (cmd_args == null) throw new ArgumentNullException ("cmd_args"); OptionSet optionSet = configurationManager.CreateOptionSet (); List extra; try { extra = optionSet.Parse (cmd_args); } catch (OptionException e) { Console.WriteLine ("{0}: {1}", configurationManager.ProgramName, e.Message); Console.WriteLine ("Try `{0} --help' for more information.", configurationManager.ProgramName); return false; } if (extra.Count > 0) { Console.Write ("Warning: unparsed command line arguments: "); foreach (string s in extra) { Console.Write ("{0} ", s); } Console.WriteLine (); } return true; } } } xsp-4.2/src/Mono.WebServer/VPathToHost.cs0000664000175000017500000001035412627046413015240 00000000000000// // VPathToHost.cs // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Copyright (c) Copyright 2002-2007 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Web.Hosting; using System.Globalization; namespace Mono.WebServer { public class VPathToHost { public readonly string vhost; public readonly int vport; public readonly string vpath; public string realPath; public readonly bool haveWildcard; public IApplicationHost AppHost; public IRequestBroker RequestBroker; public VPathToHost (string vhost, int vport, string vpath, string realPath) { this.vhost = (vhost != null) ? vhost.ToLower (CultureInfo.InvariantCulture) : null; this.vport = vport; this.vpath = vpath; if (String.IsNullOrEmpty (vpath) || vpath [0] != '/') throw new ArgumentException ("Virtual path must begin with '/': " + vpath, "vpath"); this.realPath = realPath; AppHost = null; if (vhost != null && this.vhost.Length != 0 && this.vhost [0] == '*') { haveWildcard = true; if (this.vhost.Length > 2 && this.vhost [1] == '.') this.vhost = this.vhost.Substring (2); } } public bool TryClearHost (IApplicationHost host) { if (AppHost == host) { AppHost = null; return true; } return false; } public void UnloadHost () { if (AppHost != null) AppHost.Unload (); AppHost = null; } public bool Redirect (string path, out string redirect) { redirect = null; if (path.Length == vpath.Length - 1) { redirect = vpath; return true; } return false; } public bool Match (string vhost, int vport, string vpath) { if (vport != -1 && this.vport != -1 && vport != this.vport) return false; if (vpath == null) return false; if (vhost != null && this.vhost != null && this.vhost != "*") { int length = this.vhost.Length; string lwrvhost = vhost.ToLower (CultureInfo.InvariantCulture); if (haveWildcard) { if (length > vhost.Length) return false; if (length == vhost.Length && this.vhost != lwrvhost) return false; if (vhost [vhost.Length - length - 1] != '.') return false; if (!lwrvhost.EndsWith (this.vhost)) return false; } else if (this.vhost != lwrvhost) { return false; } } int local = vpath.Length; int vlength = this.vpath.Length; if (vlength > local) { // Check for /xxx requests to be redirected to /xxx/ if (this.vpath [vlength - 1] != '/') return false; return (vlength - 1 == local && this.vpath.Substring (0, vlength - 1) == vpath); } return (vpath.StartsWith (this.vpath)); } public void CreateHost (ApplicationServer server, WebSource webSource) { string v = vpath; if (v != "/" && v.EndsWith ("/")) { v = v.Substring (0, v.Length - 1); } AppHost = ApplicationHost.CreateApplicationHost (webSource.GetApplicationHostType(), v, realPath) as IApplicationHost; AppHost.Server = server; if (!server.SingleApplication) { // Link the host in the application domain with a request broker in the main domain RequestBroker = webSource.CreateRequestBroker (); AppHost.RequestBroker = RequestBroker; } } } } xsp-4.2/src/Mono.WebServer/InitialWorkerRequest.cs0000664000175000017500000001432412627046413017212 00000000000000// // Mono.WebServer.InitialWorkerRequest // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Web; namespace Mono.WebServer { public class InitialWorkerRequest { string verb; string path; string queryString; string protocol; readonly Stream stream; int inputLength; int position; const int B_SIZE = 1024 * 32; static readonly Stack bufferStack = new Stack (); static readonly Encoding encoding = Encoding.GetEncoding (28591); public bool GotSomeInput { get; private set; } public byte [] InputBuffer { get; private set; } public RequestData RequestData { get { var rd = new RequestData (verb, path, queryString, protocol); var buffer = new byte [inputLength - position]; Buffer.BlockCopy (InputBuffer, position, buffer, 0, inputLength - position); rd.InputBuffer = buffer; return rd; } } public static byte [] AllocateBuffer () { lock (bufferStack) { if (bufferStack.Count != 0) return bufferStack.Pop (); } return new byte [B_SIZE]; } public static void FreeBuffer (byte [] buf) { if (buf == null) return; lock (bufferStack) { bufferStack.Push (buf); } } public InitialWorkerRequest (Stream ns) { if (ns == null) throw new ArgumentNullException ("ns"); stream = ns; } public void FreeBuffer () { if (InputBuffer != null) FreeBuffer (InputBuffer); } public void SetBuffer (byte [] buffer, int length) { InputBuffer = buffer; inputLength = length; GotSomeInput = (length > 0); position = 0; } void FillBuffer () { position = 0; InputBuffer = AllocateBuffer (); inputLength = stream.Read (InputBuffer, 0, B_SIZE); if (inputLength == 0) // Socket closed throw new IOException ("socket closed"); GotSomeInput = true; } string ReadRequestLine () { var text = new StringBuilder (); do { if (InputBuffer == null || position >= inputLength) FillBuffer (); if (position >= inputLength) break; bool cr = false; int count = 0; byte b = 0; int i; for (i = position; count < 8192 && i < inputLength; i++, count++) { b = InputBuffer [i]; if (b == '\r') { cr = true; count--; continue; } if (b == '\n' || cr) { count--; break; } } if (position >= inputLength && b == '\r' || b == '\n') count++; if (count >= 8192 || count + text.Length >= 8192) throw new InvalidOperationException ("Line too long."); if (count <= 0) { position = i + 1; break; } text.Append (encoding.GetString (InputBuffer, position, count)); position = i + 1; if (i >= inputLength) { b = InputBuffer [inputLength - 1]; if (b != '\r' && b != '\n') continue; FillBuffer(); if (b == '\r' && inputLength > 0 && InputBuffer[0] == '\n') position++; } break; } while (true); if (text.Length == 0) { return null; } return text.ToString (); } bool GetRequestLine () { string req; try { while (true) { req = ReadRequestLine (); if (req == null) { GotSomeInput = false; return false; } req = req.Trim (); // Ignore empty lines before the actual request. if (req.Length > 0) break; } } catch (Exception) { GotSomeInput = false; return false; } string [] s = req.Split (' '); switch (s.Length) { case 2: verb = s [0].Trim (); path = s [1].Trim (); break; case 3: verb = s [0].Trim (); path = s [1].Trim (); protocol = s [2].Trim (); break; default: return false; } int qmark = path.IndexOf ('?'); if (qmark != -1) { queryString = path.Substring (qmark + 1); path = path.Substring (0, qmark); } path = GetSafePath (path); if (path.StartsWith ("/~/")) { // Not sure about this. It makes request such us /~/dir/file work path = path.Substring (2); } return true; } static string GetSafePath (string path) { bool appendSlash = path.EndsWith ("/"); path = HttpUtility.UrlDecode (path); path = path.Replace ('\\','/'); while (path.IndexOf ("//") != -1) path = path.Replace ("//", "/"); string [] parts = path.Split ('/'); var result = new List (parts.Length); int end = parts.Length; for (int i = 0; i < end; i++) { string current = parts [i]; if (current.Length == 0 || current == "." ) continue; if (current == "..") { if (result.Count > 0) result.RemoveAt (result.Count - 1); continue; } result.Add (current); } if (result.Count == 0) return "/"; var res = new StringBuilder(); foreach (var part in result) { res.Append ('/'); res.Append (part); } if (appendSlash) res.Append ('/'); return res.ToString (); } public void ReadRequestData () { if (!GetRequestLine ()) throw new RequestLineException (); if (protocol == null) { protocol = "HTTP/1.0"; } } } } xsp-4.2/src/Mono.WebServer/WebTrace.cs0000664000175000017500000000772212627046413014556 00000000000000// // ApplicationServer.cs // // Authors: // Marek Habersack (mhabersack@novell.com) // // Copyright (c) Copyright 2007 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Text; using System.Threading; using System.Diagnostics; using System.Reflection; namespace Mono.WebServer { public sealed class WebTrace { static string GetMethodName (StackFrame sf) { MethodBase mi = sf.GetMethod (); return mi != null ? String.Format ("{0}.{1}(): ", mi.ReflectedType, mi.Name) : null; } static string GetExtraInfo (StackFrame sf = null) { string threadid = String.Format ("thread_id: {0}", Thread.CurrentThread.ManagedThreadId.ToString ("x")); string domainid = String.Format ("appdomain_id: {0}", AppDomain.CurrentDomain.Id.ToString ("x")); string filepath = sf == null ? null : sf.GetFileName (); int lineNumber = sf == null ? -1 : sf.GetFileLineNumber (); string format = String.IsNullOrEmpty (filepath) ? " [{0}, {1}]" : " [{0}, {1}, in {2}:{3}]"; return String.Format (format, domainid, threadid, filepath, lineNumber); } static void Enter (string format, StackFrame sf, params object[] parms) { var sb = new StringBuilder ("Enter: "); string methodName = GetMethodName (sf); if (methodName != null) sb.Append (methodName); if (format != null) sb.AppendFormat (format, parms); sb.Append (GetExtraInfo (sf)); Trace.WriteLine (sb.ToString ()); Trace.Indent (); } [Conditional ("WEBTRACE")] public static void Enter (string format, params object[] parms) { Enter (format, new StackFrame (1), parms); } [Conditional ("WEBTRACE")] public static void Enter () { Enter (null, new StackFrame (1), null); } static void Leave (string format, StackFrame sf, params object[] parms) { var sb = new StringBuilder ("Leave: "); string methodName = GetMethodName (sf); if (methodName != null) sb.Append (methodName); if (format != null) sb.AppendFormat (format, parms); sb.Append (GetExtraInfo (sf)); Trace.Unindent (); Trace.WriteLine (sb.ToString ()); } [Conditional ("WEBTRACE")] public static void Leave (string format, params object[] parms) { Leave (format, new StackFrame (1), parms); } [Conditional ("WEBTRACE")] public static void Leave () { Leave (null, new StackFrame (1), null); } [Conditional ("WEBTRACE")] public static void WriteLine (string format, params object[] parms) { if (format == null) return; var sb = new StringBuilder (); sb.AppendFormat (format, parms); sb.Append (GetExtraInfo ()); Trace.WriteLine (sb.ToString ()); } [Conditional ("WEBTRACE")] public static void WriteLineIf (bool cond, string format, params object[] parms) { if (!cond) return; if (format == null) return; var sb = new StringBuilder (); sb.AppendFormat (format, parms); sb.Append (GetExtraInfo ()); Trace.WriteLine (sb.ToString ()); } } } xsp-4.2/src/Mono.WebServer/WebSource.cs0000664000175000017500000000343512627046413014755 00000000000000// // Mono.WebServer.WebSource // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Documentation: // Brian Nickel // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net.Sockets; namespace Mono.WebServer { public abstract class WebSource : IDisposable { public abstract Socket CreateSocket (); public abstract Worker CreateWorker (Socket client, ApplicationServer server); public abstract Type GetApplicationHostType (); public abstract IRequestBroker CreateRequestBroker (); public void Dispose () { Dispose (true); GC.SuppressFinalize (this); } protected virtual void Dispose (bool disposing) { } } } xsp-4.2/src/Mono.WebServer/AssemblyInfo4.cs.in0000664000175000017500000000423212627046413016137 00000000000000// AssemblyInfo.cs for Mono.WebServer.dll // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Copyright (c) 2002,2003,2004,2005 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("0.4.0.0")] [assembly: AssemblyTitle ("Mono.WebServer2")] [assembly: AssemblyDescription ("Classes for embedding an ASP.NET server in your application .NET 4.0.")] [assembly: AssemblyCopyright ("(c) 2002-2011 Novell, Inc.")] [assembly: AssemblyCompany ("Novell, Inc.")] [assembly: InternalsVisibleTo ("fastcgi-mono-server4, PublicKey = 0024000004800000940000000602000" + "00024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1af" + "cc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2" + "ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081db" + "ea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35" + "f46cdff12a1bd78e4ef0065d016df")] xsp-4.2/src/Mono.WebServer/IApplicationHost.cs0000664000175000017500000000313112627046413016262 00000000000000// // Mono.WebServer.IApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Documentation: // Brian Nickel // // (C) 2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer { public interface IApplicationHost { string Path { get; } string VPath { get; } AppDomain Domain { get; } IRequestBroker RequestBroker { get; set; } ApplicationServer Server { get; set; } void Unload (); bool IsHttpHandler (string verb, string uri); } } xsp-4.2/src/Mono.WebServer/LingeringNetworkStream.cs0000664000175000017500000000520712627046413017522 00000000000000// // Mono.WebServer.LingeringNetworkStream // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) Copyright 2004 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net.Sockets; namespace Mono.WebServer { public class LingeringNetworkStream : NetworkStream { const int USECONDS_TO_LINGER = 2000000; const int MAX_USECONDS_TO_LINGER = 30000000; // We dont actually use the data from this buffer. So we cache it... static byte [] buffer; public LingeringNetworkStream (Socket sock, bool owns) : base (sock, owns) { EnableLingering = true; OwnsSocket = owns; } public bool OwnsSocket { get; private set; } public bool EnableLingering { get; set; } void LingeringClose () { int waited = 0; if (!Connected) return; try { Socket.Shutdown (SocketShutdown.Send); DateTime start = DateTime.UtcNow; while (waited < MAX_USECONDS_TO_LINGER) { int nread = 0; try { if (!Socket.Poll (USECONDS_TO_LINGER, SelectMode.SelectRead)) break; if (buffer == null) buffer = new byte [512]; nread = Socket.Receive (buffer, 0, buffer.Length, 0); } catch { } if (nread == 0) break; waited += (int) (DateTime.UtcNow - start).TotalMilliseconds * 1000; } } catch { // ignore - we don't care, we're closing anyway } } public override void Close () { if (EnableLingering) { try { LingeringClose (); } finally { base.Close (); } } else base.Close (); } public bool Connected { get { return Socket.Connected; } } } } xsp-4.2/src/Mono.WebServer/Makefile.in0000664000175000017500000003454012627055642014602 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/Mono.WebServer ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo2.cs AssemblyInfo4.cs CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/AssemblyInfo2.cs.in \ $(srcdir)/AssemblyInfo4.cs.in $(srcdir)/Makefile.in ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = $(top_builddir)/src/Mono.WebServer datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfigdir = $(libdir)/pkgconfig MCSFLAGS = -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe -keyfile:$(top_srcdir)/src/mono.snk SYSTEMCORE_DEP = @SYSTEMCORE_DEP@ monowebserver4dir = $(prefix)/lib/xsp/4.5 monowebserver4_install = 4.0/Mono.WebServer2.dll monowebserver4_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:System.Core.dll -r:Mono.Posix.dll GACUTIL4 = $(GACUTIL) -package 4.5 noinst_SCRIPTS = $(monowebserver4_install) CLEANFILES = 4.0/Mono.WebServer2.dll* EXTRA_DIST = $(sources) AssemblyInfo4.cs.in Mono.WebServer.sources sources = $(shell cat $(srcdir)/Mono.WebServer.sources) monowebserver4_build_sources = $(addprefix $(srcdir)/, $(sources)) $(addprefix $(top_builddir)/src/Mono.WebServer/, AssemblyInfo4.cs) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.WebServer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.WebServer/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo2.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo2.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ AssemblyInfo4.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo4.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile 4.0/Mono.WebServer2.dll: $(monowebserver4_build_sources) -$(MKDIR_P) 4.0 $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(monowebserver4_references) /target:library /out:$@ $(monowebserver4_build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/4.0/Mono.WebServer2.dll uninstall-local: -for i in Mono.WebServer2 ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done clean-local: rm -rf 4.0 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer/IdentityToken.cs0000664000175000017500000000304212627046413015643 00000000000000// // IdentityToken.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Unix.Native; namespace Mono.WebServer { public class IdentityToken : IDisposable { readonly uint euid; readonly uint egid; public IdentityToken (uint euid, uint egid) { this.euid = euid; this.egid = egid; } public void Dispose () { Syscall.seteuid (euid); Syscall.setegid (egid); } } } xsp-4.2/src/Mono.WebServer/Log/0000775000175000017500000000000012627055647013335 500000000000000xsp-4.2/src/Mono.WebServer/Log/FileLogger.cs0000664000175000017500000000423412627046413015615 00000000000000// // FileLogger.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; namespace Mono.WebServer.Log { class FileLogger : ILogger { StreamWriter writer; readonly object write_lock = new object (); ~FileLogger () { Close (); } public void Open (string path) { if (path == null) throw new ArgumentNullException ("path"); lock (write_lock) { Close (); Stream stream = File.Open (path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite); stream.Seek (0, SeekOrigin.End); writer = new StreamWriter (stream); } } public void Write (LogLevel level, string text) { if (writer == null) return; lock (write_lock) { if (writer == null) return; writer.WriteLine (text); writer.Flush (); } } public void Close () { lock (write_lock) { if (writer == null) return; try { writer.Flush (); writer.Close (); } catch (ObjectDisposedException) { // Already done } writer = null; } } } } xsp-4.2/src/Mono.WebServer/Log/ILogger.cs0000664000175000017500000000246012627046413015125 00000000000000// // ILogger.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Log { public interface ILogger { void Write (LogLevel level, string text); } } xsp-4.2/src/Mono.WebServer/Log/Logger.cs0000664000175000017500000001005412627046413015012 00000000000000// // Logger.cs: Logs server events. // // Author: // Brian Nickel (brian.nickel@gmail.com) // Leonardo Taglialegne // // Copyright (C) 2007 Brian Nickel // Copyright (C) 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Diagnostics; namespace Mono.WebServer.Log { public static class Logger { static readonly List loggers = new List (); static readonly FileLogger file_logger = new FileLogger (); static readonly object write_lock = new object (); #region Public Static Properties public static LogLevel Level { get; set; } public static bool WriteToConsole { get; set; } public static bool Verbose { get; set; } public static string Name { get; set; } static int? ThreadId { get { if (Verbose && (Level & LogLevel.Debug) != LogLevel.None) return Thread.CurrentThread.ManagedThreadId; return null; } } static int? ProcessId { get { if (Verbose && (Level & LogLevel.Debug) != LogLevel.None) return Process.GetCurrentProcess ().Id; return null; } } #endregion static Logger () { Level = LogLevel.Standard; loggers.Add (file_logger); } #region Public Static Methods public static void AddLogger (ILogger logger) { loggers.Add (logger); } public static void Open (string path) { file_logger.Open (path); } public static void Write (LogLevel level, string format, params object [] args) { Write (level, CultureInfo.CurrentCulture, format, args); } public static void Write (Exception e) { if (e == null) throw new ArgumentNullException ("e"); Write (LogLevel.Error, e.Message); if(e.StackTrace != null) foreach(var line in e.StackTrace.Split(new []{Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)) Write (LogLevel.Error, line); } static string GetFormatString () { return ThreadId == null ? "[{2}] {3,-7}: {4}" : Name == null ? "{1,2} [{2}] {3,-7}: {4}" : "{0,5}:{1,2} {5,-8} [{2}] {3,-7}: {4}"; } public static void Write (LogLevel level, string message) { if ((Level & level) == LogLevel.None) return; var format = GetFormatString (); string time = Verbose ? DateTime.Now.ToString ("yyyy-MM-dd HH:mm:ss.ffffff") : DateTime.Now.ToString ("yyyy-MM-dd HH:mm:ss"); string text = String.Format (CultureInfo.CurrentCulture, format, ProcessId, ThreadId, time, level, message, Name); if (WriteToConsole) lock (write_lock) if (Verbose) Console.WriteLine (text); else Console.WriteLine (message); foreach(var logger in loggers) logger.Write (level, text); } static void Write (LogLevel level, IFormatProvider provider, string format, params object [] args) { Write (level, String.Format (provider, format, args)); } public static void Close () { file_logger.Close (); } #endregion } } xsp-4.2/src/Mono.WebServer/Log/LogLevel.cs0000664000175000017500000000271312627046413015307 00000000000000// // LogLevel.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.Log { [Flags] public enum LogLevel { None = 0x00, Error = 0x01, Warning = 0x02, Notice = 0x04, Debug = 0x08, Standard = Error | Warning | Notice, All = Error | Warning | Notice | Debug } }xsp-4.2/src/Mono.WebServer/UnregisterRequestEventHandler.cs0000664000175000017500000000260512627046413021055 00000000000000// // Mono.WebServer.UnregisterRequestEventHandler // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public delegate void UnregisterRequestEventHandler (object sender, UnregisterRequestEventArgs args); } xsp-4.2/src/Mono.WebServer/RequestData.cs0000664000175000017500000000367612627046413015310 00000000000000// // Mono.WebServer.RequestData // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Text; namespace Mono.WebServer { public class RequestData { public string Verb; public string Path; public string PathInfo; public string QueryString; public string Protocol; public byte [] InputBuffer; public RequestData (string verb, string path, string queryString, string protocol) { Verb = verb; Path = path; QueryString = queryString; Protocol = protocol; } public override string ToString () { var sb = new StringBuilder (); sb.AppendFormat ("Verb: {0}\n", Verb); sb.AppendFormat ("Path: {0}\n", Path); sb.AppendFormat ("PathInfo: {0}\n", PathInfo); sb.AppendFormat ("QueryString: {0}\n", QueryString); return sb.ToString (); } } } xsp-4.2/src/Mono.WebServer/MapPathEventHandler.cs0000664000175000017500000000276712627046413016720 00000000000000// // Mono.WebServer.MapPathEventHandler // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Documentation: // Brian Nickel // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer { public delegate void MapPathEventHandler (object sender, MapPathEventArgs args); } xsp-4.2/src/Mono.WebServer/RequestLineException.cs0000664000175000017500000000266112627046413017176 00000000000000// // Mono.WebServer.RequestLineException // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer { class RequestLineException : ApplicationException { public RequestLineException () : base ("Error reading request line") { } } } xsp-4.2/src/Mono.WebServer/MonoWorkerRequest.cs0000664000175000017500000004052712627046413016535 00000000000000// // Mono.WebServer.MonoWorkerRequest // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Documentation: // Brian Nickel // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Specialized; using System.Configuration; using System.IO; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Web; using System.Web.Hosting; using Mono.WebServer.Log; namespace Mono.WebServer { public abstract class MonoWorkerRequest : SimpleWorkerRequest { const string DEFAULT_EXCEPTION_HTML = "Runtime ErrorAn exception ocurred:
{0}
"; static readonly char[] mapPathTrimStartChars = { '/' }; static bool checkFileAccess = true; readonly static bool needToReplacePathSeparator; readonly static char pathSeparatorChar; readonly IApplicationHost appHostBase; Encoding encoding; Encoding headerEncoding; byte [] queryStringBytes; string hostVPath; string hostPath; string hostPhysicalRoot; EndOfSendNotification end_send; object end_send_data; X509Certificate client_cert; NameValueCollection server_variables; bool inUnhandledException; // as we must have the client certificate (if provided) then we're able to avoid // pre-calculating some items (and cache them if we have to calculate) string cert_cookie; string cert_issuer; string cert_serial; string cert_subject; protected byte[] server_raw; protected byte[] client_raw; public event MapPathEventHandler MapPathEvent; public event EndOfRequestHandler EndOfRequestEvent; public abstract int RequestId { get; } protected static bool RunningOnWindows { get; private set; } public static bool CheckFileAccess { get { return checkFileAccess; } set { checkFileAccess = value; } } // Gets the physical path of the application host of the // current instance. string HostPath { get { if (hostPath == null) hostPath = appHostBase.Path; return hostPath; } } // Gets the virtual path of the application host of the // current instance. string HostVPath { get { if (hostVPath == null) hostVPath = appHostBase.VPath; return hostVPath; } } string HostPhysicalRoot { get { if (hostPhysicalRoot == null) hostPhysicalRoot = appHostBase.Server.PhysicalRoot; return hostPhysicalRoot; } } protected virtual Encoding Encoding { get { if (encoding == null) encoding = Encoding.GetEncoding (28591); return encoding; } set { encoding = value; } } protected virtual Encoding HeaderEncoding { get { if (headerEncoding == null) { HttpContext ctx = HttpContext.Current; HttpResponse response = ctx != null ? ctx.Response : null; Encoding enc = inUnhandledException ? null : response != null ? response.HeaderEncoding : null; headerEncoding = enc ?? Encoding; } return headerEncoding; } } static MonoWorkerRequest () { PlatformID pid = Environment.OSVersion.Platform; RunningOnWindows = ((int) pid != 128 && pid != PlatformID.Unix && pid != PlatformID.MacOSX); if (Path.DirectorySeparatorChar != '/') { needToReplacePathSeparator = true; pathSeparatorChar = Path.DirectorySeparatorChar; } try { string v = ConfigurationManager.AppSettings ["MonoServerCheckHiddenFiles"]; if (!String.IsNullOrEmpty (v)) { if (!Boolean.TryParse (v, out checkFileAccess)) checkFileAccess = true; } } catch (Exception) { // ignore checkFileAccess = true; } } protected MonoWorkerRequest (IApplicationHost appHost) : base (String.Empty, String.Empty, null) { if (appHost == null) throw new ArgumentNullException ("appHost"); appHostBase = appHost; } public override string GetAppPath () { return HostVPath; } public override string GetAppPathTranslated () { return HostPath; } public override string GetFilePathTranslated () { return MapPath (GetFilePath ()); } public override string GetLocalAddress () { return "localhost"; } public override string GetServerName () { string hostHeader = GetKnownRequestHeader(HeaderHost); if (String.IsNullOrEmpty (hostHeader)) { hostHeader = GetLocalAddress (); } else { int colonIndex = hostHeader.IndexOf (':'); if (colonIndex > 0) { hostHeader = hostHeader.Substring (0, colonIndex); } else if (colonIndex == 0) { hostHeader = GetLocalAddress (); } } return hostHeader; } public override int GetLocalPort () { return 0; } public override byte [] GetPreloadedEntityBody () { return null; } public override byte [] GetQueryStringRawBytes () { if (queryStringBytes == null) { string queryString = GetQueryString (); if (queryString != null) queryStringBytes = Encoding.GetBytes (queryString); } return queryStringBytes; } // Invokes the registered delegates one by one until the path is mapped. // // Parameters: // path = virutal path of the request. // // Returns a string containing the mapped physical path of the request, or null if // the path was not successfully mapped. // string DoMapPathEvent (string path) { if (MapPathEvent != null) { var args = new MapPathEventArgs (path); foreach (MapPathEventHandler evt in MapPathEvent.GetInvocationList ()) { evt (this, args); if (args.IsMapped) return args.MappedPath; } } return null; } // The logic here is as follows: // // If path is equal to the host's virtual path (including trailing slash), // return the host virtual path. // // If path is absolute (starts with '/') then check if it's under our host vpath. If // it is, base the mapping under the virtual application's physical path. If it // isn't use the physical root of the application server to return the mapped // path. If you have just one application configured, then the values computed in // both of the above cases will be the same. If you have several applications // configured for this xsp/mod-mono-server instance, then virtual paths outside our // application virtual path will return physical paths relative to the server's // physical root, not application's. This is consistent with the way IIS worker // request works. See bug #575600 // public override string MapPath (string path) { string eventResult = DoMapPathEvent (path); if (eventResult != null) return eventResult; string hostVPath = HostVPath; int hostVPathLen = HostVPath.Length; int pathLen = path != null ? path.Length : 0; #if NET_2_0 bool inThisApp = path.StartsWith (hostVPath, StringComparison.Ordinal); #else bool inThisApp = path.StartsWith (hostVPath); #endif if (pathLen == 0 || (inThisApp && (pathLen == hostVPathLen || (pathLen == hostVPathLen + 1 && path [pathLen - 1] == '/')))) { if (needToReplacePathSeparator) return HostPath.Replace ('/', pathSeparatorChar); return HostPath; } string basePath = null; switch (path [0]) { case '~': if (path.Length >= 2 && path [1] == '/') path = path.Substring (1); break; case '/': if (!inThisApp) basePath = HostPhysicalRoot; break; } if (basePath == null) basePath = HostPath; if (inThisApp && (path.Length == hostVPathLen || path [hostVPathLen] == '/')) path = path.Substring (hostVPathLen + 1); path = path.TrimStart (mapPathTrimStartChars); if (needToReplacePathSeparator) path = path.Replace ('/', pathSeparatorChar); return Path.Combine (basePath, path); } protected abstract bool GetRequestData (); public bool ReadRequestData () { return GetRequestData (); } static void LocationAccessible (string localPath) { bool doThrow = false; if (RunningOnWindows) { try { var fi = new FileInfo (localPath); FileAttributes attr = fi.Attributes; if ((attr & FileAttributes.Hidden) != 0 || (attr & FileAttributes.System) != 0) doThrow = true; } catch (Exception) { // ignore, will be handled in system.web return; } } else { // throw only if the file exists, let system.web handle the request // otherwise if (File.Exists (localPath) || Directory.Exists (localPath)) if (Path.GetFileName (localPath) [0] == '.') doThrow = true; } if (doThrow) throw new HttpException (403, "Forbidden."); } void AssertFileAccessible () { if (!checkFileAccess) return; string localPath = GetFilePathTranslated (); if (String.IsNullOrEmpty (localPath)) return; char dirsep = Path.DirectorySeparatorChar; string appPath = GetAppPathTranslated (); string[] segments = localPath.Substring (appPath.Length).Split (dirsep); var sb = new StringBuilder (appPath); foreach (string s in segments) { if (s.Length == 0) continue; if (s [0] != '.') { sb.Append (s); sb.Append (dirsep); continue; } sb.Append (s); LocationAccessible (sb.ToString ()); } } public void ProcessRequest () { string error = null; inUnhandledException = false; try { AssertFileAccessible (); HttpRuntime.ProcessRequest (this); } catch (HttpException ex) { inUnhandledException = true; error = ex.GetHtmlErrorMessage (); } catch (Exception ex) { inUnhandledException = true; var hex = new HttpException (400, "Bad request", ex); error = hex.GetHtmlErrorMessage (); } if (!inUnhandledException) return; if (error.Length == 0) error = String.Format (DEFAULT_EXCEPTION_HTML, "Unknown error"); try { SendStatus (400, "Bad request"); SendUnknownResponseHeader ("Connection", "close"); SendUnknownResponseHeader ("Date", DateTime.Now.ToUniversalTime ().ToString ("r")); Encoding enc = Encoding.UTF8; byte[] bytes = enc.GetBytes (error); SendUnknownResponseHeader ("Content-Type", "text/html; charset=" + enc.WebName); SendUnknownResponseHeader ("Content-Length", bytes.Length.ToString ()); SendResponseFromMemory (bytes, bytes.Length); FlushResponse (true); } catch (Exception ex) { // should "never" happen Logger.Write (LogLevel.Error, "Error while processing a request: "); Logger.Write (ex); throw; } } public override void EndOfRequest () { if (EndOfRequestEvent != null) EndOfRequestEvent (this); if (end_send != null) end_send (this, end_send_data); } public override void SetEndOfSendNotification (EndOfSendNotification callback, object extraData) { end_send = callback; end_send_data = extraData; } public override void SendCalculatedContentLength (int contentLength) { //FIXME: Should we ignore this for apache2? SendUnknownResponseHeader ("Content-Length", contentLength.ToString ()); } public override void SendKnownResponseHeader (int index, string value) { if (HeadersSent ()) return; string headerName = GetKnownResponseHeaderName (index); SendUnknownResponseHeader (headerName, value); } protected void SendFromStream (Stream stream, long offset, long length) { if (offset < 0 || length <= 0) return; long stLength = stream.Length; if (offset + length > stLength) length = stLength - offset; if (offset > 0) stream.Seek (offset, SeekOrigin.Begin); var fileContent = new byte [8192]; int count = fileContent.Length; while (length > 0 && (count = stream.Read (fileContent, 0, count)) != 0) { SendResponseFromMemory (fileContent, count); length -= count; // Keep the System. prefix count = (int) System.Math.Min (length, fileContent.Length); } } public override void SendResponseFromFile (string filename, long offset, long length) { FileStream file = null; try { file = File.OpenRead (filename); SendFromStream (file, offset, length); } finally { if (file != null) file.Close (); } } public override void SendResponseFromFile (IntPtr handle, long offset, long length) { Stream file = null; try { file = new FileStream (handle, FileAccess.Read); SendFromStream (file, offset, length); } finally { if (file != null) file.Close (); } } public override string GetServerVariable (string name) { if (server_variables == null) return String.Empty; if (IsSecure ()) { X509Certificate client = ClientCertificate; switch (name) { case "CERT_COOKIE": if (cert_cookie == null) { if (client == null) cert_cookie = String.Empty; else cert_cookie = client.GetCertHashString (); } return cert_cookie; case "CERT_ISSUER": if (cert_issuer == null) { if (client == null) cert_issuer = String.Empty; else cert_issuer = client.Issuer; } return cert_issuer; case "CERT_SERIALNUMBER": if (cert_serial == null) { if (client == null) cert_serial = String.Empty; else cert_serial = client.GetSerialNumberString (); } return cert_serial; case "CERT_SUBJECT": if (cert_subject == null) { if (client == null) cert_subject = String.Empty; else cert_subject = client.Subject; } return cert_subject; } } string s = server_variables [name]; return s ?? String.Empty; } public void AddServerVariable (string name, string value) { if (server_variables == null) server_variables = new NameValueCollection (); server_variables.Add (name, value); } #region Client Certificate Support public X509Certificate ClientCertificate { get { if ((client_cert == null) && (client_raw != null)) client_cert = new X509Certificate (client_raw); return client_cert; } } public void SetClientCertificate (byte[] rawcert) { client_raw = rawcert; } public override byte[] GetClientCertificate () { return client_raw; } public override byte[] GetClientCertificateBinaryIssuer () { if (ClientCertificate == null) return base.GetClientCertificateBinaryIssuer (); // TODO: not 100% sure of the content return new byte [0]; } public override int GetClientCertificateEncoding () { if (ClientCertificate == null) return base.GetClientCertificateEncoding (); return 0; } public override byte[] GetClientCertificatePublicKey () { if (ClientCertificate == null) return base.GetClientCertificatePublicKey (); return ClientCertificate.GetPublicKey (); } public override DateTime GetClientCertificateValidFrom () { if (ClientCertificate == null) return base.GetClientCertificateValidFrom (); return DateTime.Parse (ClientCertificate.GetEffectiveDateString ()); } public override DateTime GetClientCertificateValidUntil () { if (ClientCertificate == null) return base.GetClientCertificateValidUntil (); return DateTime.Parse (ClientCertificate.GetExpirationDateString ()); } #endregion protected static string[] SplitAndTrim (string list) { if (String.IsNullOrEmpty (list)) return new string[0]; return (from f in list.Split (',') let trimmed = f.Trim () where trimmed.Length != 0 select trimmed).ToArray (); } } } xsp-4.2/src/Mono.WebServer/Platform.cs0000664000175000017500000001016312627046413014637 00000000000000// // Platform.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using Mono.Unix; using Mono.Unix.Native; using Mono.WebServer.Log; namespace Mono.WebServer { public static class Platform { public static readonly FinePlatformID Value; public static string Name { get { return Value.ToString (); } } public static bool IsUnix { get { var platform = Environment.OSVersion.Platform; return platform == PlatformID.Unix || platform == PlatformID.MacOSX || platform == (PlatformID)128; } } static Platform() { Value = GetPlatformId(); } static FinePlatformID GetPlatformId() { switch (Environment.OSVersion.Platform) { case PlatformID.Unix: case (PlatformID)128: // Well, there are chances MacOSX is reported as Unix instead of MacOSX. // Instead of platform check, we'll do a feature checks (Mac specific root folders) if (Directory.Exists("/Applications") && Directory.Exists("/System") && Directory.Exists("/Users") && Directory.Exists("/Volumes")) return FinePlatformID.MacOSX; return FinePlatformID.Linux; case PlatformID.MacOSX: return FinePlatformID.MacOSX; default: return FinePlatformID.Windows; } } static uint GetUid (string user) { var info = new UnixUserInfo (user); long uid = info.UserId; if (uid > UInt32.MaxValue || uid <= 0) throw new ArgumentOutOfRangeException ("user", String.Format ("Uid for {0} ({1}) not in range for suid", user, uid)); return (uint)uid; } static uint GetGid (string group) { var info = new UnixGroupInfo (group); var gid = info.GroupId; if (gid > UInt32.MaxValue || gid <= 0) throw new ArgumentOutOfRangeException ("group", String.Format ("Gid for {0} ({1}) not in range for sgid", group, gid)); return (uint)gid; } static void SetUser (string user) { Syscall.setuid (GetUid (user)); } static void SetGroup (string group) { Syscall.setgid (GetGid (group)); } public static void LogIdentity () { Logger.Write (LogLevel.Debug, "Uid {0}, euid {1}, gid {2}, egid {3}", Syscall.getuid (), Syscall.geteuid (), Syscall.getgid (), Syscall.getegid ()); } public static void SetIdentity (uint uid, uint gid) { // TODO: Use platform-specific code if (IsUnix) { Syscall.setgid (gid); Syscall.setuid (uid); LogIdentity (); } else Logger.Write (LogLevel.Warning, "Not dropping privileges"); } public static void SetIdentity (string user, string group) { // TODO: Use platform-specific code if (IsUnix) { SetGroup (group); SetUser (user); LogIdentity (); } else Logger.Write (LogLevel.Warning, "Not dropping privileges"); } public static IDisposable Impersonate(string user,string group) { uint uid = GetUid (user); uint gid = GetGid (group); uint euid = Syscall.geteuid (); uint egid = Syscall.getegid (); Syscall.setegid (gid); Syscall.seteuid (uid); return new IdentityToken (euid, egid); } } } xsp-4.2/src/Mono.WebServer/SearchPattern.cs0000664000175000017500000001024112627046413015613 00000000000000// // System.IO.SearchPattern.cs: Filename glob support. // // Author: // Dan Lewis (dihlewis@yahoo.co.uk) // // (C) 2002 // // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace System.IO.Foo { // FIXME: there's a complication with this algorithm under windows. // the pattern '*.*' matches all files (i think . matches the extension), // whereas under UNIX it should only match files containing the '.' character. class SearchPattern { public SearchPattern (string pattern) : this (pattern, false) { } public SearchPattern (string pattern, bool ignore) { SetPattern (pattern, ignore); } public void SetPattern (string pattern, bool ignore) { this.ignore = ignore; Compile (pattern); } public bool IsMatch (string text) { return Match (ops, text, 0); } // private Op ops; // the compiled pattern bool ignore; // ignore case void Compile (string pattern) { if (pattern == null) throw new ArgumentException ("Invalid search pattern."); if (pattern == "*") { // common case ops = new Op (OpCode.True); return; } ops = null; int ptr = 0; Op last_op = null; while (ptr < pattern.Length) { Op op; switch (pattern [ptr]) { case '?': op = new Op (OpCode.AnyChar); ++ ptr; break; case '*': op = new Op (OpCode.AnyString); ++ ptr; break; default: op = new Op (OpCode.ExactString); int end = pattern.IndexOfAny (WildcardChars, ptr); if (end < 0) end = pattern.Length; op.Argument = pattern.Substring (ptr, end - ptr); if (ignore) op.Argument = op.Argument.ToLower (); ptr = end; break; } if (last_op == null) ops = op; else last_op.Next = op; last_op = op; } if (last_op == null) ops = new Op (OpCode.End); else last_op.Next = new Op (OpCode.End); } bool Match (Op op, string text, int ptr) { while (op != null) { switch (op.Code) { case OpCode.True: return true; case OpCode.End: if (ptr == text.Length) return true; return false; case OpCode.ExactString: int length = op.Argument.Length; if (ptr + length > text.Length) return false; string str = text.Substring (ptr, length); if (ignore) str = str.ToLower (); if (str != op.Argument) return false; ptr += length; break; case OpCode.AnyChar: if (++ ptr > text.Length) return false; break; case OpCode.AnyString: while (ptr <= text.Length) { if (Match (op.Next, text, ptr)) return true; ++ ptr; } return false; } op = op.Next; } return true; } // private static internal static readonly char [] WildcardChars = { '*', '?' }; class Op { public Op (OpCode code) { Code = code; Argument = null; Next = null; } public readonly OpCode Code; public string Argument; public Op Next; } enum OpCode { ExactString, // literal AnyChar, // ? AnyString, // * End, // end of pattern True // always succeeds }; } } xsp-4.2/src/Mono.WebServer/HttpErrors.cs0000664000175000017500000000503712627046413015173 00000000000000// // HttpErrors.cs // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Copyright (c) Copyright 2002-2007 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Text; namespace Mono.WebServer { public class HttpErrors { static readonly byte [] error500; static readonly byte [] badRequest; static HttpErrors () { const string s = "HTTP/1.0 500 Server error\r\n" + "Connection: close\r\n\r\n" + "500 Server Error

Server error

\r\n" + "Your client sent a request that was not understood by this server.\r\n" + "\r\n"; error500 = Encoding.ASCII.GetBytes (s); const string br = "HTTP/1.0 400 Bad Request\r\n" + "Connection: close\r\n\r\n" + "400 Bad Request" + "

Bad Request

The request was not understood" + "

"; badRequest = Encoding.ASCII.GetBytes (br); } public static byte [] NotFound (string uri) { string s = String.Format ("HTTP/1.0 404 Not Found\r\n" + "Connection: close\r\n\r\n" + "404 Not Found\r\n" + "

Not Found

The requested URL {0} was not found on this " + "server.

\r\n\r\n", uri); return Encoding.ASCII.GetBytes (s); } public static byte [] BadRequest () { return badRequest; } public static byte [] ServerError () { return error500; } } } xsp-4.2/src/Mono.WebServer/BaseRequestBroker.cs0000664000175000017500000001635212627046413016451 00000000000000// // Mono.WebServer.BaseRequestBroker // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer { public class BaseRequestBroker: MarshalByRefObject, IRequestBroker { public event UnregisterRequestEventHandler UnregisterRequestEvent; // Contains the initial request capacity of a BaseRequestBroker const int INITIAL_REQUESTS = 200; // The size of a request buffer in bytes. // // This number should be equal to INPUT_BUFFER_SIZE // in System.Web.HttpRequest. const int BUFFER_SIZE = 32*1024; // Contains a lock to use when accessing and modifying the // request allocation tables. static readonly object reqlock = new object(); // Contains the request ID's. int[] request_ids = new int [INITIAL_REQUESTS]; // Contains the registered workers. Worker[] requests = new Worker [INITIAL_REQUESTS]; // Contains buffers for the requests to use. byte[][] buffers = new byte [INITIAL_REQUESTS][]; // Contains the number of active requests. int requests_count; // Contains the total number of requests served so far. // May freely wrap around. uint requests_served; ///

/// Grows the size of the request allocation tables by 33%. /// /// This *MUST* be called with the reqlock held! /// /// ID to use for a new request. /// Current length of the allocation tables. int GrowRequests (ref int curlen) { int newsize = curlen + curlen/3; var new_request_ids = new int [newsize]; var new_requests = new Worker [newsize]; var new_buffers = new byte [newsize][]; request_ids.CopyTo (new_request_ids, 0); Array.Clear (request_ids, 0, request_ids.Length); request_ids = new_request_ids; requests.CopyTo (new_requests, 0); Array.Clear (requests, 0, requests.Length); requests = new_requests; buffers.CopyTo (new_buffers, 0); Array.Clear (buffers, 0, buffers.Length); buffers = new_buffers; curlen = newsize; return curlen + 1; } /// /// Gets the next available request ID, expanding the array /// of possible ID's if necessary. /// /// This *MUST* be called with the reqlock held! /// /// ID of the request. int GetNextRequestId () { int reqlen = request_ids.Length; requests_served++; // increment to 1 before putting into request_ids // so that the 0 id is reserved for slot not used if (requests_served == 0x8000) // and check for wrap-around for the above requests_served = 1; // making sure we don't exceed 0x7FFF or go negative requests_count++; int newid; if (requests_count >= reqlen) newid = GrowRequests (ref reqlen); else newid = Array.IndexOf (request_ids, 0); if (newid == -1) { // Should never happen... throw new ApplicationException ("could not allocate new request id"); } // TODO: newid had better not exceed 0xFFFF. newid = ((ushort)newid & 0xFFFF) | (((ushort)requests_served & 0x7FFF) << 16); request_ids [IdToIndex(newid)] = newid; return newid; } public int RegisterRequest (Worker worker) { int result; lock (reqlock) { result = IdToIndex (GetNextRequestId ()); requests [result] = worker; // Don't create a new array if one already exists. byte[] a = buffers [result]; if (a == null) buffers [result] = new byte [BUFFER_SIZE]; } return request_ids [result]; } int IdToIndex(int requestId) { return requestId & 0xFFFF; } public void UnregisterRequest (int id) { lock (reqlock) { if (!ValidRequest (id)) return; DoUnregisterRequest (id); int idx = IdToIndex (id); byte[] a = buffers [idx]; if (a != null) Array.Clear (a, 0, a.Length); requests [idx] = null; request_ids [idx] = 0; requests_count--; } } /// /// Invokes registered handlers of UnregisterRequestEvent. Each handler is passed an /// arguments object which contains the ID of a request that is about to be /// unregistered. /// /// ID of a request that is about to be unregistered. void DoUnregisterRequest (int id) { if (UnregisterRequestEvent == null) return; Delegate[] handlers = UnregisterRequestEvent.GetInvocationList (); if (handlers == null || handlers.Length == 0) return; var args = new UnregisterRequestEventArgs (id); foreach (UnregisterRequestEventHandler handler in handlers) handler (this, args); } protected bool ValidRequest (int requestId) { int idx = IdToIndex (requestId); return (idx >= 0 && idx < request_ids.Length && request_ids [idx] == requestId && buffers [idx] != null); } public int Read (int requestId, int size, out byte[] buffer) { buffer = null; Worker w; lock (reqlock) { if (!ValidRequest (requestId)) return 0; w = GetWorker (requestId); if (w == null) return 0; // Use a pre-allocated buffer only when the size matches // as it will be transferred across appdomain boundaries // in full length if (size == BUFFER_SIZE) { buffer = buffers [IdToIndex (requestId)]; } else { buffer = new byte[size]; } } return w.Read (buffer, 0, size); } public Worker GetWorker (int requestId) { lock (reqlock) { if (!ValidRequest (requestId)) return null; return requests [IdToIndex (requestId)]; } } public void Write (int requestId, byte[] buffer, int position, int size) { Worker worker = GetWorker (requestId); if (worker != null) worker.Write (buffer, position, size); } public void Close (int requestId) { Worker worker = GetWorker (requestId); if (worker != null) worker.Close (); } public void Flush (int requestId) { Worker worker = GetWorker (requestId); if (worker != null) worker.Flush (); } public bool IsConnected (int requestId) { Worker worker = GetWorker (requestId); return (worker != null && worker.IsConnected ()); } public override object InitializeLifetimeService () { return null; } } } xsp-4.2/src/Mono.WebServer/BaseApplicationHost.cs0000664000175000017500000001530612627046413016753 00000000000000// Mono.WebServer.BaseApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO.Foo; using System.Threading; using System.Web; using System.Web.Configuration; using System.Collections.Generic; using Mono.WebServer.Log; namespace Mono.WebServer { public class BaseApplicationHost : MarshalByRefObject, IApplicationHost { static readonly ReaderWriterLockSlim handlersCacheLock = new ReaderWriterLockSlim (); string path; string vpath; readonly EndOfRequestHandler endOfRequest; Dictionary handlersCache; public BaseApplicationHost () { endOfRequest = EndOfRequest; AppDomain.CurrentDomain.DomainUnload += OnUnload; } public void Unload () { HttpRuntime.UnloadAppDomain (); } public void OnUnload (object o, EventArgs args) { if (Server != null) Server.DestroyHost (this); } public override object InitializeLifetimeService () { return null; // who wants to live forever? } public ApplicationServer Server { get; set; } public string Path { get { if (path == null) path = AppDomain.CurrentDomain.GetData (".appPath").ToString (); return path; } } public string VPath { get { if (vpath == null) vpath = AppDomain.CurrentDomain.GetData (".appVPath").ToString (); return vpath; } } public AppDomain Domain { get { return AppDomain.CurrentDomain; } } public IRequestBroker RequestBroker { get; set; } protected void ProcessRequest (MonoWorkerRequest mwr) { if (mwr == null) throw new ArgumentNullException ("mwr"); if (!mwr.ReadRequestData ()) { EndOfRequest (mwr); return; } mwr.EndOfRequestEvent += endOfRequest; try { mwr.ProcessRequest (); } catch (ThreadAbortException) { Thread.ResetAbort (); } catch (Exception ex) { // should "never" happen // we don't know what the request state is, // better write the exception to the console // than forget it. Logger.Write(LogLevel.Error, "Unhandled exception: {0}", ex); EndOfRequest (mwr); } } public void EndOfRequest (MonoWorkerRequest mwr) { try { mwr.CloseConnection (); } catch { } finally { var brb = RequestBroker as BaseRequestBroker; if (brb != null) brb.UnregisterRequest (mwr.RequestId); } } public virtual bool IsHttpHandler (string verb, string uri) { string cacheKey = verb + "_" + uri; bool locked = false; try { handlersCacheLock.EnterReadLock (); locked = true; if (handlersCache != null) { bool found; if (handlersCache.TryGetValue (cacheKey, out found)) return found; } else { handlersCache = new Dictionary (); } } finally { if (locked) handlersCacheLock.ExitReadLock (); } bool handlerFound = LocateHandler (verb, uri); locked = false; try { handlersCacheLock.EnterWriteLock (); locked = true; if (handlersCache.ContainsKey (cacheKey)) handlersCache [cacheKey] = handlerFound; else handlersCache.Add (cacheKey, handlerFound); } finally { if (locked) handlersCacheLock.ExitWriteLock (); } return handlerFound; } bool LocateHandler (string verb, string uri) { var config = WebConfigurationManager.GetSection ("system.web/httpHandlers") as HttpHandlersSection; HttpHandlerActionCollection handlers = config != null ? config.Handlers : null; int count = handlers != null ? handlers.Count : 0; if (count == 0) return false; for (int i = 0; i < count; i++) { HttpHandlerAction handler = handlers [i]; string[] verbs = SplitVerbs (handler.Verb); if (verbs == null) { if (PathMatches (handler, uri)) return true; continue; } for (int j = 0; j < verbs.Length; j++) { if (verbs [j] != verb) continue; if (PathMatches (handler, uri)) return true; } } return false; } bool PathMatches (HttpHandlerAction handler, string uri) { bool result = false; string[] handlerPaths = handler.Path.Split (','); int slash = uri.LastIndexOf ('/'); string origUri = uri; if (slash != -1) uri = uri.Substring (slash); SearchPattern sp = null; foreach (string handlerPath in handlerPaths) { if (handlerPath == "*") continue; // ignore string matchExact = null; string endsWith = null; if (handlerPath.Length > 0) { if (handlerPath [0] == '*' && (handlerPath.IndexOf ('*', 1) == -1)) endsWith = handlerPath.Substring (1); if (handlerPath.IndexOf ('*') == -1) if (handlerPath [0] != '/') { string vpath = HttpRuntime.AppDomainAppVirtualPath; if (vpath == "/") vpath = String.Empty; matchExact = String.Concat (vpath, "/", handlerPath); } } if (matchExact != null) { result = matchExact.Length == origUri.Length && origUri.EndsWith (matchExact, StringComparison.OrdinalIgnoreCase); if (result) break; continue; } if (endsWith != null) { result = uri.EndsWith (endsWith, StringComparison.OrdinalIgnoreCase); if (result) break; continue; } string pattern; if (handlerPath.Length > 0 && handlerPath [0] == '/') pattern = handlerPath.Substring (1); else pattern = handlerPath; if (sp == null) sp = new SearchPattern (pattern, true); else sp.SetPattern (pattern, true); if (sp.IsMatch (origUri)) { result = true; break; } } return result; } static string[] SplitVerbs (string verb) { return verb == "*" ? null : verb.Split (','); } } } xsp-4.2/src/Mono.WebServer/ApplicationServer.cs0000664000175000017500000003616312627046413016515 00000000000000// // ApplicationServer.cs // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // Copyright (c) Copyright 2002-2007 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Xml; using System.Text; using System.Threading; using System.IO; using Mono.WebServer.Log; namespace Mono.WebServer { // ApplicationServer runs the main server thread, which accepts client // connections and forwards the requests to the correct web application. // ApplicationServer takes an WebSource object as parameter in the // constructor. WebSource provides methods for getting some objects // whose behavior is specific to XSP or mod_mono. // Each web application lives in its own application domain, and incoming // requests are processed in the corresponding application domain. // Since the client Socket can't be passed from one domain to the other, the // flow of information must go through the cross-app domain channel. // For each application two objects are created: // 1) a IApplicationHost object is created in the application domain // 2) a IRequestBroker is created in the main domain. // // The IApplicationHost is used by the ApplicationServer to start the // processing of a request in the application domain. // The IRequestBroker is used from the application domain to access // information in the main domain. // // The complete sequence of servicing a request is the following: // // 1) The listener accepts an incoming connection. // 2) An Worker object is created (through the WebSource), and it is // queued in the thread pool. // 3) When the Worker's run method is called, it registers itself in // the application's request broker, and gets a request id. All this is // done in the main domain. // 4) The Worker starts the request processing by making a cross-app domain // call to the application host. It passes as parameters the request id // and other information already read from the request. // 5) The application host executes the request. When it needs to read or // write request data, it performs remote calls to the request broker, // passing the request id provided by the Worker. // 6) When the request broker receives a call from the application host, // it locates the Worker registered with the provided request id and // forwards the call to it. public class ApplicationServer : MarshalByRefObject { readonly WebSource webSource; bool started; bool stop; Socket listen_socket; Thread runner; // This is much faster than hashtable for typical cases. readonly List vpathToHost = new List (); public bool SingleApplication { get; set; } public IApplicationHost AppHost { get { return vpathToHost [0].AppHost; } set { vpathToHost [0].AppHost = value; } } public IRequestBroker Broker { get { return vpathToHost [0].RequestBroker; } set { vpathToHost [0].RequestBroker = value; } } public int Port { get { if (listen_socket == null || !listen_socket.IsBound) return -1; var iep = listen_socket.LocalEndPoint as IPEndPoint; if (iep == null) return -1; return iep.Port; } } public string PhysicalRoot { get; private set; } public bool Verbose { get; set; } [Obsolete ("Use the .ctor that takes a 'physicalRoot' argument instead")] public ApplicationServer (WebSource source) : this (source, Environment.CurrentDirectory) { } public ApplicationServer (WebSource source, string physicalRoot) { if (source == null) throw new ArgumentNullException ("source"); if (String.IsNullOrEmpty (physicalRoot)) throw new ArgumentNullException ("physicalRoot"); webSource = source; PhysicalRoot = physicalRoot; } public void AddApplication (string vhost, int vport, string vpath, string fullPath) { char dirSepChar = Path.DirectorySeparatorChar; if (fullPath != null && !fullPath.EndsWith (dirSepChar.ToString ())) fullPath += dirSepChar; // TODO: Check for duplicates, sort, optimize, etc. if (Verbose && !SingleApplication) { Logger.Write (LogLevel.Notice, "Registering application:"); Logger.Write(LogLevel.Notice, " Host: {0}", vhost ?? "any"); Logger.Write(LogLevel.Notice, " Port: {0}", (vport != -1) ? vport.ToString () : "any"); Logger.Write(LogLevel.Notice, " Virtual path: {0}", vpath); Logger.Write(LogLevel.Notice, " Physical path: {0}", fullPath); } vpathToHost.Add (new VPathToHost (vhost, vport, vpath, fullPath)); } public void AddApplicationsFromConfigDirectory (string directoryName) { if (Verbose && !SingleApplication) { Logger.Write(LogLevel.Notice, "Adding applications from *.webapp files in directory '{0}'", directoryName); } var di = new DirectoryInfo (directoryName); if (!di.Exists) { Logger.Write (LogLevel.Error, "Directory {0} does not exist.", directoryName); return; } foreach (FileInfo fi in di.GetFiles ("*.webapp")) AddApplicationsFromConfigFile (fi.FullName); } public void AddApplicationsFromConfigFile (string fileName) { if (Verbose && !SingleApplication) { Logger.Write(LogLevel.Notice, "Adding applications from config file '{0}'", fileName); } try { var doc = new XmlDocument (); doc.Load (fileName); foreach (XmlElement el in doc.SelectNodes ("//web-application")) { AddApplicationFromElement (el); } } catch { Logger.Write(LogLevel.Error, "Error loading '{0}'", fileName); throw; } } void AddApplicationFromElement (XmlNode el) { XmlNode n = el.SelectSingleNode ("enabled"); if (n != null && n.InnerText.Trim () == "false") return; string vpath = el.SelectSingleNode ("vpath").InnerText; string path = el.SelectSingleNode ("path").InnerText; string vhost = null; n = el.SelectSingleNode ("vhost"); #if !MOD_MONO_SERVER if (n != null) vhost = n.InnerText; #else // TODO: support vhosts in xsp.exe string name = el.SelectSingleNode ("name").InnerText; if (verbose && !single_app) Logger.Write (LogLevel.Warning, ("Ignoring vhost {0} for {1}", n.InnerText, name); #endif int vport = -1; n = el.SelectSingleNode ("vport"); #if !MOD_MONO_SERVER if (n != null) vport = Convert.ToInt32 (n.InnerText); #else // TODO: Listen on different ports if (verbose && !single_app) Logger.Write (LogLevel.Warning, ("Ignoring vport {0} for {1}", n.InnerText, name); #endif AddApplication (vhost, vport, vpath, path); } public void AddApplicationsFromCommandLine (string applications) { if (applications == null) throw new ArgumentNullException ("applications"); if (applications.Length == 0) return; if (Verbose && !SingleApplication) { Logger.Write(LogLevel.Notice, "Adding applications '{0}'...", applications); } string [] apps = applications.Split (','); foreach (string str in apps) { string [] app = str.Split (':'); if (app.Length < 2 || app.Length > 4) throw new ArgumentException ("Should be something like " + "[[hostname:]port:]VPath:realpath"); int vport; int pos = 0; string vhost = app.Length >= 3 ? app[pos++] : null; if (app.Length >= 4) { // FIXME: support more than one listen port. vport = Convert.ToInt16 (app[pos++]); } else { vport = -1; } string vpath = app [pos++]; string realpath = app[pos++]; if (!vpath.EndsWith ("/")) vpath += "/"; string fullPath = Path.GetFullPath (realpath); AddApplication (vhost, vport, vpath, fullPath); } } [Obsolete] public bool Start (bool bgThread, Exception initialException, int backlog) { return Start (bgThread, backlog); } public bool Start (bool bgThread, int backlog) { if (started) throw new InvalidOperationException ("The server is already started."); if (vpathToHost == null) throw new InvalidOperationException ("SetApplications must be called first."); if (SingleApplication) { var v = vpathToHost [0]; v.AppHost = AppHost; // Link the host in the application domain with a request broker in the *same* domain // Not needed for SingleApplication and mod_mono v.RequestBroker = webSource.CreateRequestBroker (); AppHost.RequestBroker = v.RequestBroker; } listen_socket = webSource.CreateSocket (); listen_socket.Listen (backlog); runner = new Thread (RunServer) {IsBackground = bgThread}; runner.Start (); stop = false; return true; } public void Stop () { if (!started) throw new InvalidOperationException ("The server is not started."); if (stop) return; // Just ignore, as we're already stopping stop = true; webSource.Dispose (); // A foreground thread is required to end cleanly var stopThread = new Thread (RealStop); stopThread.Start (); } public void ShutdownSockets () { if (listen_socket != null) { try { listen_socket.Close (); } catch { } finally { listen_socket = null; } } } void RealStop () { started = false; runner.Abort (); ShutdownSockets (); UnloadAll (); } public void UnloadAll () { lock (vpathToHost) { foreach (VPathToHost v in vpathToHost) { v.UnloadHost (); } } } void SetSocketOptions (Socket sock) { try { sock.LingerState = new LingerOption (true, 15); #if !MOD_MONO_SERVER sock.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 15000); // 15s sock.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 15000); // 15s #endif } catch { // Ignore exceptions here for systems that do not support these options. } } void RunServer () { started = true; var args = new SocketAsyncEventArgs (); args.Completed += OnAccept; listen_socket.AcceptAsync (args); if (runner.IsBackground) return; while (true) // Just sleep until we're aborted. Thread.Sleep (1000000); } void OnAccept (object sender, SocketAsyncEventArgs e) { if (!started && SingleApplication) { // We are shutting down. Last call... Environment.Exit (0); } Socket accepted = e.AcceptSocket; e.AcceptSocket = null; if (e.SocketError != SocketError.Success) { CloseSocket(accepted); accepted = null; } try { if (started) listen_socket.AcceptAsync (e); } catch (Exception ex) { if (accepted != null) CloseSocket (accepted); // not much we can do. fast fail by killing the process. Logger.Write (LogLevel.Error, "Unable to accept socket. Exiting the process. {0}", ex); Environment.Exit (1); } if (accepted == null) return; SetSocketOptions (accepted); StartRequest (accepted, 0); } void CloseSocket(Socket socket) { if (socket == null) return; // attempt a quick RST of the connection try { socket.LingerState = new LingerOption (true, 0); } catch { // ignore } try { socket.Close(); } catch { // ignore } } void SendException (Socket socket, Exception ex) { var sb = new StringBuilder (); string now = DateTime.Now.ToUniversalTime ().ToString ("r"); sb.Append ("HTTP/1.0 500 Server error\r\n"); sb.AppendFormat ("Date: {0}\r\n" + "Expires: {0}\r\n" + "Last-Modified: {0}\r\n", now); sb.AppendFormat ("Expires; {0}\r\n", now); sb.Append ("Cache-Control: private, must-revalidate, max-age=0\r\n"); sb.Append ("Content-Type: text/html; charset=UTF-8\r\n"); sb.Append ("Connection: close\r\n\r\n"); sb.AppendFormat ("Exception: {0}" + "

Exception caught.

" + "
{0}
" + "", ex); byte[] data = Encoding.UTF8.GetBytes (sb.ToString ()); try { int sent = socket.Send (data); if (sent != data.Length) throw new IOException ("Blocking send did not send entire buffer"); } catch (Exception ex2) { Logger.Write(LogLevel.Error, "Failed to send exception:"); Logger.Write(ex); Logger.Write(LogLevel.Error, "Exception ocurred while sending:"); Logger.Write(ex2); } } void StartRequest (Socket accepted, int reuses) { try { // The next line can throw (reusing and the client closed) Worker worker = webSource.CreateWorker (accepted, this); worker.SetReuseCount (reuses); if (worker.IsAsync) worker.Run (null); else ThreadPool.QueueUserWorkItem (worker.Run); } catch (Exception) { try { if (accepted != null) { try { if (accepted.Connected) accepted.Shutdown (SocketShutdown.Both); } catch { // ignore } accepted.Close (); } } catch { // ignore } } } public void ReuseSocket (Socket sock, int reuses) { StartRequest (sock, reuses); } public VPathToHost GetApplicationForPath (string vhost, int port, string path, bool defaultToRoot) { if (SingleApplication) return vpathToHost [0]; VPathToHost bestMatch = null; int bestMatchLength = 0; for (int i = vpathToHost.Count - 1; i >= 0; i--) { var v = vpathToHost [i]; int matchLength = v.vpath.Length; if (matchLength <= bestMatchLength || !v.Match (vhost, port, path)) continue; bestMatchLength = matchLength; bestMatch = v; } if (bestMatch != null) { lock (bestMatch) { if (bestMatch.AppHost == null) bestMatch.CreateHost (this, webSource); } return bestMatch; } if (defaultToRoot) return GetApplicationForPath (vhost, port, "/", false); if (Verbose) Logger.Write(LogLevel.Error, "No application defined for: {0}:{1}{2}", vhost, port, path); return null; } public VPathToHost GetSingleApp () { if (vpathToHost.Count == 1) return vpathToHost [0]; return null; } public void DestroyHost (IApplicationHost host) { // Called when the host appdomain is being unloaded for (int i = vpathToHost.Count - 1; i >= 0; i--) { var v = vpathToHost [i]; if (v.TryClearHost (host)) break; } } public override object InitializeLifetimeService () { return null; } } } xsp-4.2/src/Mono.WebServer/Makefile.am0000664000175000017500000000242512627054152014561 00000000000000pkgconfigdir=$(libdir)/pkgconfig builddir=$(top_builddir)/src/Mono.WebServer MCSFLAGS= -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe -keyfile:$(top_srcdir)/src/mono.snk SYSTEMCORE_DEP=@SYSTEMCORE_DEP@ monowebserver4dir = $(prefix)/lib/xsp/4.5 monowebserver4_install = 4.0/Mono.WebServer2.dll monowebserver4_references = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:System.Core.dll -r:Mono.Posix.dll GACUTIL4=$(GACUTIL) -package 4.5 noinst_SCRIPTS= $(monowebserver4_install) CLEANFILES = 4.0/Mono.WebServer2.dll* EXTRA_DIST = $(sources) AssemblyInfo4.cs.in Mono.WebServer.sources sources = $(shell cat $(srcdir)/Mono.WebServer.sources) monowebserver4_build_sources = $(addprefix $(srcdir)/, $(sources)) $(addprefix $(top_builddir)/src/Mono.WebServer/, AssemblyInfo4.cs) 4.0/Mono.WebServer2.dll: $(monowebserver4_build_sources) -$(MKDIR_P) 4.0 $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(monowebserver4_references) /target:library /out:$@ $(monowebserver4_build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/4.0/Mono.WebServer2.dll uninstall-local: -for i in Mono.WebServer2 ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done clean-local: rm -rf 4.0 xsp-4.2/src/Mono.WebServer/LockRecursionException.cs0000664000175000017500000000316112627046413017514 00000000000000/* * System.Threading.LockRecursionException * * Author(s) * Marek Safar * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Runtime.Serialization; namespace System.Threading { [Serializable] class LockRecursionException : Exception { public LockRecursionException () { } public LockRecursionException (string message) : base (message) { } public LockRecursionException (string message, Exception e) : base (message, e) { } protected LockRecursionException (SerializationInfo info, StreamingContext sc) : base (info, sc) { } } } xsp-4.2/src/Mono.WebServer/AssemblyInfo2.cs.in0000664000175000017500000000423212627046413016135 00000000000000// AssemblyInfo.cs for Mono.WebServer.dll // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Copyright (c) 2002,2003,2004,2005 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("0.2.0.0")] [assembly: AssemblyTitle ("Mono.WebServer2")] [assembly: AssemblyDescription ("Classes for embedding an ASP.NET server in your application .NET 2.0.")] [assembly: AssemblyCopyright ("(c) 2002-2011 Novell, Inc.")] [assembly: AssemblyCompany ("Novell, Inc.")] [assembly: InternalsVisibleTo ("fastcgi-mono-server2, PublicKey = 0024000004800000940000000602000" + "00024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1af" + "cc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2" + "ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081db" + "ea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35" + "f46cdff12a1bd78e4ef0065d016df")] xsp-4.2/src/Mono.WebServer/Version.cs0000664000175000017500000000427512627046413014507 00000000000000// // Version.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Reflection; namespace Mono.WebServer { public static class Version { public static void Show () { Assembly assembly = Assembly.GetExecutingAssembly (); string version = assembly.GetName ().Version.ToString (); // string title = GetAttribute (a => a.Title); string copyright = GetAttribute (a => a.Copyright); string description = GetAttribute (a => a.Description); Console.WriteLine ("{0} {1}\n(c) {2}\n{3}", Path.GetFileName (assembly.Location), version, copyright, description); } static string GetAttribute (Func func) where T : class { Assembly assembly = Assembly.GetExecutingAssembly (); var attributes = assembly.GetCustomAttributes (typeof (T), false); if (attributes.Length == 0) return String.Empty; var att = attributes [0] as T; if (att == null) return String.Empty; return func (att); } } } xsp-4.2/src/Mono.WebServer/Mono.WebServer.sources0000664000175000017500000000260612627046413016747 00000000000000./ApplicationServer.cs ./BaseApplicationHost.cs ./BaseRequestBroker.cs ./EndOfRequestHandler.cs ./FinePlatformID.cs ./HttpErrors.cs ./IApplicationHost.cs ./IdentityToken.cs ./InitialWorkerRequest.cs ./IRequestBroker.cs ./LingeringNetworkStream.cs ./LockRecursionException.cs ./LockRecursionPolicy.cs ./Log/FileLogger.cs ./Log/ILogger.cs ./Log/Logger.cs ./Log/LogLevel.cs ./MapPathEventArgs.cs ./MapPathEventHandler.cs ./MonoWorkerRequest.cs ./Options/ConfigurationManager.cs ./Options/ConfigurationManagerExtensions.cs ./Options/ConfigurationManager.Fields.cs ./Options/Descriptions.cs ./Options/IHelpConfigurationManager.cs ./Options/Options.cs ./Options/ServerConfigurationManager.cs ./Options/Settings/BoolSetting.cs ./Options/Settings/EnumSetting.cs ./Options/Settings/Int32Setting.cs ./Options/Settings/ISetting.cs ./Options/Settings/NullableInt32Setting.cs ./Options/Settings/NullableSetting.cs ./Options/Settings/NullableUInt16Setting.cs ./Options/Settings/Parser.cs ./Options/Settings/Setting.cs ./Options/Settings/SettingsCollection.cs ./Options/Settings/SettingSource.cs ./Options/Settings/StringSetting.cs ./Options/Settings/UInt16Setting.cs ./Options/Settings/UInt32Setting.cs ./Paths.cs ./Platform.cs ./RequestData.cs ./RequestLineException.cs ./SearchPattern.cs ./UnregisterRequestEventArgs.cs ./UnregisterRequestEventHandler.cs ./Version.cs ./VPathToHost.cs ./WebSource.cs ./WebTrace.cs ./Worker.cs xsp-4.2/src/Mono.WebServer/LockRecursionPolicy.cs0000664000175000017500000000242312627046413017015 00000000000000/* * System.Threading.LockRecursionPolicy * * Author(s) * Marek Safar * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace System.Threading { [Serializable] enum LockRecursionPolicy { NoRecursion, SupportsRecursion } } xsp-4.2/src/Mono.WebServer/UnregisterRequestEventArgs.cs0000664000175000017500000000275312627046413020400 00000000000000// // Mono.WebServer.UnregisterRequestEventArgs // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer { public class UnregisterRequestEventArgs : EventArgs { public int RequestId { get; private set; } public UnregisterRequestEventArgs (int requestId) { RequestId = requestId; } } } xsp-4.2/src/Mono.WebServer.XSP/0000775000175000017500000000000012627055647013265 500000000000000xsp-4.2/src/Mono.WebServer.XSP/ChangeLog0000664000175000017500000000152012627046413014744 000000000000002010-06-02 Marek Habersack * XSPWorkerRequest.cs: avoid double handle close when sending response from a file in certain cases. 2010-03-31 Marek Habersack * main.cs: wrapped --pidfile option body in try/catch block, as the failure to create the PID file is not critical. 2010-03-18 Marek Habersack * XSPWorker.cs: all the checks for whether socket is connected are performed in a safe manner. 2010-03-01 Marek Habersack * main.cs: added some documentation on RealMain. Added code to make sure single app mode is not used when running a non-stop server. In single app mode, when ThreadAbortException is thrown, make sure to shutdown up all the accepted sockets, or we'll end up with sockets with filled receive/send queues. xsp-4.2/src/Mono.WebServer.XSP/XSPWebSource.cs0000664000175000017500000000731612627046413016023 00000000000000// // Mono.WebServer.XSPApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; using Mono.Security.Protocol.Tls; using Mono.WebServer.XSP; using SecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; namespace Mono.WebServer { // // XSPWebSource: Provides methods to get objects and types specific // to XSP. // public class XSPWebSource: WebSource { IPEndPoint bindAddress; readonly bool secureConnection; readonly SecurityProtocolType securityProtocol; readonly X509Certificate cert; readonly PrivateKeySelectionCallback keyCB; readonly bool allowClientCert; readonly bool requireClientCert; public XSPWebSource(IPAddress address, int port, SecurityProtocolType securityProtocol, X509Certificate cert, PrivateKeySelectionCallback keyCB, bool allowClientCert, bool requireClientCert, bool single_app) { secureConnection = (cert != null && keyCB != null); bindAddress = new IPEndPoint (address, port); this.securityProtocol = securityProtocol; this.cert = cert; this.keyCB = keyCB; this.allowClientCert = allowClientCert; this.requireClientCert = requireClientCert; } public XSPWebSource (IPAddress address, int port, bool single_app) { SetListenAddress (address, port); } public XSPWebSource (IPAddress address, int port) : this (address, port, false) { } public void SetListenAddress (int port) { SetListenAddress (IPAddress.Any, port); } public void SetListenAddress (IPAddress address, int port) { SetListenAddress (new IPEndPoint (address, port)); } public void SetListenAddress (IPEndPoint bindAddress) { if (bindAddress == null) throw new ArgumentNullException ("bindAddress"); this.bindAddress = bindAddress; } public override Socket CreateSocket () { var listen_socket = new Socket (bindAddress.AddressFamily, SocketType.Stream, ProtocolType.IP); listen_socket.Bind (bindAddress); return listen_socket; } public override Worker CreateWorker (Socket client, ApplicationServer server) { return new XSPWorker (client, client.LocalEndPoint, server, secureConnection, securityProtocol, cert, keyCB, allowClientCert, requireClientCert); } public override Type GetApplicationHostType () { return typeof (XSPApplicationHost); } public override IRequestBroker CreateRequestBroker () { return new XSPRequestBroker (); } } } xsp-4.2/src/Mono.WebServer.XSP/Mono.WebServer.XSP.sources0000664000175000017500000000031112627046413020060 00000000000000./CompatTuple.cs ./ConfigurationManager.cs ./main.cs ./SecurityConfiguration.cs ./SslInformation.cs ./XSPApplicationHost.cs ./XSPRequestBroker.cs ./XSPWebSource.cs ./XSPWorker.cs ./XSPWorkerRequest.cs xsp-4.2/src/Mono.WebServer.XSP/Makefile.in0000664000175000017500000004110012627055642015241 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/Mono.WebServer.XSP ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo.cs xsp.pc xsp-2.pc xsp-4.pc CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Makefile.in \ $(srcdir)/xsp-2.pc.in $(srcdir)/xsp-4.pc.in \ $(srcdir)/xsp.pc.in ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = $(top_builddir)/src/Mono.WebServer.XSP datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfigdir = $(libdir)/pkgconfig MCSFLAGS = -debug+ -debug:full -nologo -nowarn:618 -unsafe $(WEBTRACING) -keyfile:$(top_srcdir)/src/mono.snk XSP4_EXE = xsp4.exe GACUTIL4 = $(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll references4 = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll pkgconfig_DATA = xsp-2.pc xsp-4.pc sources = $(shell cat $(srcdir)/Mono.WebServer.XSP.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) Mono.WebServer.XSP.sources AssemblyInfo.cs.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.WebServer.XSP/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.WebServer.XSP/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ xsp.pc: $(top_builddir)/config.status $(srcdir)/xsp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ xsp-2.pc: $(top_builddir)/config.status $(srcdir)/xsp-2.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ xsp-4.pc: $(top_builddir)/config.status $(srcdir)/xsp-4.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local uninstall-pkgconfigDATA .PRECIOUS: Makefile xsp4.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/xsp4.exe uninstall-local: -for i in xsp4 ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer.XSP/SecurityConfiguration.cs0000664000175000017500000002267312627046413020074 00000000000000// // server.cs: Web Server that uses ASP.NET hosting // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2005 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text; using Mono.Security.Authenticode; using MSX = Mono.Security.X509; using Mono.Security.X509.Extensions; using SecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType; namespace Mono.WebServer.XSP { public class SecurityConfiguration { bool valid; RSA key; X509Certificate x509; string password; public SecurityConfiguration () { Protocol = SecurityProtocolType.Default; } // properties public bool AcceptClientCertificates { get; set; } public string CertificateFile { get; set; } public bool Enabled { get; set; } public bool RequireClientCertificates { get; set; } public string Password { get { throw new CryptographicException ("Password is write-only."); } set { password = value; } } public string Pkcs12File { get; set; } public RSA KeyPair { get { if (!valid) CheckSecurityContextValidity (); return key; } } public string PvkFile { get; set; } public X509Certificate ServerCertificate { get { if (!valid) CheckSecurityContextValidity (); return x509; } } public SecurityProtocolType Protocol { get; set; } // methods public void CheckSecurityContextValidity () { if (Enabled) { // give priority to pkcs12 (for conflicting options) LoadPkcs12File (Pkcs12File, password); LoadCertificate (CertificateFile); LoadPrivateKeyFile (PvkFile, password); } valid = true; } public override string ToString () { if (!Enabled) return "(non-secure)"; var sb = new StringBuilder ("("); switch (Protocol) { case SecurityProtocolType.Default: sb.Append ("auto-detect SSL3/TLS1"); break; case SecurityProtocolType.Ssl3: sb.Append ("SSL3"); break; case SecurityProtocolType.Tls: sb.Append ("TLS1"); break; } if (RequireClientCertificates) sb.Append (" with mandatory client certificates"); sb.Append (")"); return sb.ToString (); } [Obsolete("Use the typesafe Protocol property")] public void SetProtocol (string protocol) { if (protocol != null) { try { Protocol = (SecurityProtocolType) Enum.Parse (typeof (SecurityProtocolType), protocol); } catch (Exception e) { string message = String.Format ("The value '{0}' given for security protocol is invalid.", protocol); throw new CryptographicException (message, e); } } else { Protocol = SecurityProtocolType.Default; } } // private stuff void LoadCertificate (string filename) { if ((filename == null) || (x509 != null)) return; try { x509 = X509Certificate.CreateFromCertFile (filename); } catch (Exception e) { string message = String.Format ("Unable to load X.509 certicate file '{0}'.", filename); throw new CryptographicException (message, e); } } void LoadPrivateKeyFile (string filename, string password) { if ((filename == null) || (key != null)) return; try { key = password == null ? PrivateKey.CreateFromFile (filename).RSA : PrivateKey.CreateFromFile (filename, password).RSA; } catch (CryptographicException ce) { string message = String.Format ("Invalid private key password or private key file '{0}' is corrupt.", filename); throw new CryptographicException (message, ce); } catch (Exception e) { string message = String.Format ("Unable to load private key '{0}'.", filename); throw new CryptographicException (message, e); } } void LoadPkcs12File (string filename, string password) { if ((filename == null) || (key != null)) return; try { MSX.PKCS12 pfx = password == null ? MSX.PKCS12.LoadFromFile (filename) : MSX.PKCS12.LoadFromFile (filename, password); // a PKCS12 file may contain many certificates and keys so we must find // the best one (i.e. not the first one) // test for only one certificate / keypair if (Simple (pfx)) return; // next, we look for a certificate with the server authentication EKU (oid // 1.3.6.1.5.5.7.3.1) and, if found, try to find a key associated with it if (ExtendedKeyUsage (pfx)) return; // next, we look for a certificate with the KU matching the use of a private // key matching SSL usage and, if found, try to find a key associated with it if (KeyUsage (pfx)) return; // next, we look for the old netscape extension if (NetscapeCertType (pfx)) return; // finally we iterate all keys (not certificates) to find a certificate with the // same public key if (BruteForce (pfx)) return; // we don't merit to use SSL ;-) throw new Exception ("Couldn't find an appropriate certificate and private key to use for SSL."); } catch (CryptographicException ce) { string message = String.Format ("Invalid private key password or private key file '{0}' is corrupt.", filename); throw new CryptographicException (message, ce); } catch (Exception e) { string message = String.Format ("Unable to load private key '{0}'.", filename); throw new CryptographicException (message, e); } } bool Simple (MSX.PKCS12 pfx) { int ncerts = pfx.Certificates.Count; if (ncerts == 0) throw new Exception ("No certificates are present in the PKCS#12 file."); int nkeys = pfx.Keys.Count; if (nkeys == 0) throw new Exception ("No keypair is present in the PKCS#12 file."); if (ncerts == 1) { MSX.X509Certificate cert = pfx.Certificates [0]; // only one certificate, find matching key if (nkeys == 1) { // only one key key = (pfx.Keys [0] as RSA); } else { // many keys (strange case) key = GetKeyMatchingCertificate (pfx, cert); } // complete ? if ((key != null) && (cert != null)) { x509 = new X509Certificate (cert.RawData); return true; } } return false; } bool ExtendedKeyUsage (MSX.PKCS12 pfx) { foreach (MSX.X509Certificate cert in pfx.Certificates) { MSX.X509Extension xtn = cert.Extensions ["2.5.29.37"]; if (xtn == null) continue; var eku = new ExtendedKeyUsageExtension (xtn); if (!eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.1")) continue; key = GetKeyMatchingCertificate (pfx, cert); if (key == null) continue; x509 = new X509Certificate (cert.RawData); break; } // complete ? return ((x509 != null) && (key != null)); } bool KeyUsage (MSX.PKCS12 pfx) { foreach (MSX.X509Certificate cert in pfx.Certificates) { MSX.X509Extension xtn = cert.Extensions ["2.5.29.15"]; if (xtn == null) continue; var ku = new KeyUsageExtension (xtn); if (!ku.Support (KeyUsages.digitalSignature) && !ku.Support (KeyUsages.keyEncipherment)) continue; key = GetKeyMatchingCertificate (pfx, cert); if (key == null) continue; x509 = new X509Certificate (cert.RawData); break; } // complete ? return ((x509 != null) && (key != null)); } bool NetscapeCertType (MSX.PKCS12 pfx) { foreach (MSX.X509Certificate cert in pfx.Certificates) { MSX.X509Extension xtn = cert.Extensions ["2.16.840.1.113730.1.1"]; if (xtn == null) continue; var ct = new NetscapeCertTypeExtension (xtn); if (!ct.Support (NetscapeCertTypeExtension.CertTypes.SslServer)) continue; key = GetKeyMatchingCertificate (pfx, cert); if (key == null) continue; x509 = new X509Certificate (cert.RawData); break; } // complete ? return ((x509 != null) && (key != null)); } bool BruteForce (MSX.PKCS12 pfx) { foreach (object o in pfx.Keys) { key = (o as RSA); if (key == null) continue; string s = key.ToXmlString (false); foreach (MSX.X509Certificate cert in pfx.Certificates) { if (s == cert.RSA.ToXmlString (false)) x509 = new X509Certificate (cert.RawData); } // complete ? if ((x509 != null) && (key != null)) return true; } return false; } static RSA GetKeyMatchingCertificate (MSX.PKCS12 pfx, MSX.X509Certificate cert) { IDictionary attributes = pfx.GetAttributes (cert); return (pfx.GetAsymmetricAlgorithm (attributes) as RSA); } } } xsp-4.2/src/Mono.WebServer.XSP/XSPWorkerRequest.cs0000664000175000017500000004610512627046413016746 00000000000000// // Mono.WebServer.XSPWorkerRequest // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Simon Waite (simon@psionics.demon.co.uk) // Marek Habersack (grendel@twistedcode.net) // // (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2005 Novell, Inc. (http://www.novell.com) // Copyright 2012 Xamarin, Inc (http://xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Globalization; using System.IO; using System.Net; using System.Reflection; using System.Text; using System.Web; using System.Runtime.InteropServices; using Mono.WebServer.Log; namespace Mono.WebServer { public class XSPWorkerRequest : MonoWorkerRequest { readonly string verb; string path; readonly string rawUrl; readonly string pathInfo; readonly string queryString; readonly string protocol; Hashtable headers; string [][] unknownHeaders; bool headersSent; readonly StringBuilder responseHeaders; int statusCode; string statusDescription; byte [] inputBuffer; int inputLength; bool refilled; int position; readonly EndPoint remoteEP; bool sentConnection; readonly int localPort; readonly string localAddress; readonly int requestId; XSPRequestBroker requestBroker; bool keepAlive; bool haveContentLength; readonly IntPtr socket; readonly bool secure; static readonly bool running_tests; static readonly bool no_libc; static readonly string server_software; static readonly string serverHeader; static string [] indexFiles = { "index.aspx", "Default.aspx", "default.aspx", "index.html", "index.htm" }; static XSPWorkerRequest () { no_libc = CheckOS (); running_tests = (Environment.GetEnvironmentVariable ("XSP_RUNNING_TESTS") != null); Assembly assembly = Assembly.GetExecutingAssembly (); string title = "Mono-XSP Server"; string version = assembly.GetName ().Version.ToString (); object [] att = assembly.GetCustomAttributes (typeof (AssemblyTitleAttribute), false); if (att.Length > 0) title = ((AssemblyTitleAttribute) att [0]).Title; server_software = String.Format ("{0}/{1}", title, version); serverHeader = String.Format ("\r\nServer: {0} {1}\r\n", server_software, Platform.Name); try { string indexes = ConfigurationManager.AppSettings ["MonoServerDefaultIndexFiles"]; SetDefaultIndexFiles (indexes); } catch (Exception ex) { Logger.Write (LogLevel.Error, "Worker initialization exception occurred. Continuing anyway:"); Logger.Write (ex); } } static bool CheckOS () { if (Environment.GetEnvironmentVariable ("XSP_NO_LIBC") != null) return true; bool is_linux = false; try { string os = File.ReadAllText ("/proc/sys/kernel/ostype"); is_linux = os.StartsWith ("Linux"); } catch { } return !is_linux; } static void SetDefaultIndexFiles (string list) { if (list == null) return; indexFiles = SplitAndTrim (list); } public XSPWorkerRequest (int requestId, XSPRequestBroker requestBroker, IApplicationHost appHost, EndPoint localEP, EndPoint remoteEP, string verb, string path, string queryString, string protocol, byte[] inputBuffer, IntPtr socket, bool secure) : base (appHost) { this.socket = socket; this.requestId = requestId; this.requestBroker = requestBroker; this.remoteEP = remoteEP; this.verb = verb; rawUrl = path; if (!String.IsNullOrEmpty (queryString)) rawUrl += "?" + queryString; try { Paths.GetPathsFromUri (appHost, verb, path, out this.path, out pathInfo); } catch { CloseConnection (); throw; } this.protocol = protocol; if (protocol == "HTTP/1.1") { if (!running_tests) this.protocol = "HTTP/1.0"; keepAlive = true; } this.queryString = queryString; this.inputBuffer = inputBuffer; inputLength = inputBuffer.Length; position = 0; this.secure = secure; try { GetRequestHeaders (); } catch { CloseConnection (); throw; } var cncHeader = (string) headers ["Connection"]; if (cncHeader != null) { cncHeader = cncHeader.ToLower (); if (cncHeader.IndexOf ("keep-alive") != -1) keepAlive = true; if (cncHeader.IndexOf ("close") != -1) keepAlive = false; } if (secure) keepAlive = false; //FIXME: until the NetworkStream don't own the socket for ssl streams. responseHeaders = new StringBuilder (); statusCode = 200; statusDescription = "OK"; localPort = ((IPEndPoint) localEP).Port; localAddress = ((IPEndPoint) localEP).Address.ToString(); } public override int RequestId { get { return requestId; } } void FillBuffer () { refilled = true; position = 0; inputLength = requestBroker.Read (requestId, 32*1024, out inputBuffer); } string ReadLine () { var text = new StringBuilder (); do { if (inputBuffer == null || position >= inputLength) FillBuffer (); if (position >= inputLength) break; bool cr = false; int count = 0; byte b = 0; int i; for (i = position; count < 8192 && i < inputLength; i++, count++) { b = inputBuffer [i]; if (b == '\r') { cr = true; count--; } else if (b == '\n' || cr) { count--; break; } } if (position >= inputLength && b == '\r' || b == '\n') count++; if (count >= 8192 || count + text.Length >= 8192) throw new InvalidOperationException ("Line too long."); if (count <= 0) { position = i + 1; break; } text.Append (Encoding.GetString (inputBuffer, position, count)); position = i + 1; if (i >= inputLength) { b = inputBuffer [inputLength - 1]; if (b != '\r' && b != '\n') continue; FillBuffer(); if (b == '\r' && inputLength > 0 && inputBuffer[0] == '\n') position++; } break; } while (true); return text.Length == 0 ? null : text.ToString (); } void GetRequestHeaders () { try { string line; headers = new Hashtable (StringComparer.InvariantCultureIgnoreCase); while ((line = ReadLine ()) != null && line.Length > 0) { int colon = line.IndexOf (':'); if (colon == -1 || line.Length < colon + 2) throw new Exception (); string key = line.Substring (0, colon); string value = line.Substring (colon + 1).Trim (); headers [key] = value; } } catch (IOException) { throw; } catch (Exception e) { throw new Exception ("Error reading headers.", e); } } public override void CloseConnection () { if (requestBroker == null) return; // We check for headersSent as broken user code might call // CloseConnection at an early stage. requestBroker.Close (requestId, headersSent && keepAlive); requestBroker = null; } void AddConnectionHeader () { if (!keepAlive) { responseHeaders.Append ("Connection: close\r\n"); return; } int allowed = requestBroker.GetReuseCount (requestId); if (allowed <= 0) { keepAlive = false; responseHeaders.Append ("Connection: close\r\n"); return; } responseHeaders.Append ("Keep-Alive: timeout=15, max="); responseHeaders.Append (allowed.ToString ()); responseHeaders.Append ("\r\n"); responseHeaders.Append ("Connection: Keep-Alive\r\n"); } byte [] GetHeaders () { var basicHeaders = new StringBuilder(); basicHeaders.Append (protocol); if (statusCode == 200) basicHeaders.Append (" 200 "); else { basicHeaders.Append (' '); basicHeaders.Append (statusCode.ToString (CultureInfo.InvariantCulture)); basicHeaders.Append (' '); } basicHeaders.Append (statusDescription); basicHeaders.Append ("\r\nDate: "); basicHeaders.Append (DateTime.UtcNow.ToString ("r", CultureInfo.InvariantCulture)); basicHeaders.Append (serverHeader); responseHeaders.Insert (0, basicHeaders.ToString ()); if (!sentConnection) { if (!haveContentLength) keepAlive = false; AddConnectionHeader (); } responseHeaders.Append ("\r\n"); return HeaderEncoding.GetBytes (responseHeaders.ToString ()); } public override void FlushResponse (bool finalFlush) { try { if (!headersSent) SendHeaders (); if (finalFlush) CloseConnection (); } catch (Exception) { CloseConnection (); } } public override string GetFilePath () { return path; } public override string GetHttpVerbName () { return verb; } public override string GetHttpVersion () { return protocol; } public override string GetKnownRequestHeader (int index) { if (headers == null) return null; string headerName = GetKnownRequestHeaderName (index); return headers [headerName] as string; } public override string GetUnknownRequestHeader (string name) { if (headers == null) return null; return headers [name] as string; } public override string [][] GetUnknownRequestHeaders () { if (unknownHeaders == null) { if (headers == null) return (unknownHeaders = new string [0][]); ICollection keysColl = headers.Keys; ICollection valuesColl = headers.Values; var keys = new string [keysColl.Count]; var values = new string [valuesColl.Count]; keysColl.CopyTo (keys, 0); valuesColl.CopyTo (values, 0); int count = keys.Length; var pairs = new List (); for (int i = 0; i < count; i++) { int index = GetKnownRequestHeaderIndex (keys [i]); if (index != -1) continue; pairs.Add (new[] { keys [i], values [i]}); } if (pairs.Count != 0) unknownHeaders = pairs.ToArray (); } return unknownHeaders; } public override string GetLocalAddress () { return localAddress; } public override int GetLocalPort () { return localPort; } public override string GetPathInfo () { return pathInfo; } public override byte [] GetPreloadedEntityBody () { if (verb != "POST" || refilled || position >= inputLength) return null; if (inputLength == 0) return null; var content_length = (string) headers ["Content-Length"]; long length = 0; // If not empty parse, if correctly parsed validate if (!String.IsNullOrEmpty (content_length) && Int64.TryParse (content_length, out length) && length > Int32.MaxValue) throw new InvalidOperationException ("Content-Length exceeds the maximum accepted size."); int input_data_length = inputLength - position; if (length < 0 || length > input_data_length) length = input_data_length; var result = new byte [length]; Buffer.BlockCopy (inputBuffer, position, result, 0, (int)length); position = 0; inputLength = 0; inputBuffer = null; return result; } public override string GetQueryString () { return queryString; } public override byte [] GetQueryStringRawBytes () { if (queryString == null) return null; return Encoding.GetBytes (queryString); } public override string GetRawUrl () { return rawUrl; } public override string GetRemoteAddress () { return ((IPEndPoint) remoteEP).Address.ToString (); } public override string GetRemoteName () { string ip = GetRemoteAddress (); string name; try { IPHostEntry entry = Dns.GetHostEntry (ip); name = entry.HostName; } catch { name = ip; } return name; } public override int GetRemotePort () { return ((IPEndPoint) remoteEP).Port; } public override string GetServerVariable (string name) { string result; switch (name) { case "GATEWAY_INTERFACE": result = "CGI/1.1"; break; case "HTTPS": result = (IsSecure ()) ? "on" : "off"; break; case "SERVER_SOFTWARE": result = server_software; break; default: result = base.GetServerVariable (name); break; } return result; } public override string GetUriPath () { string result = path; if (!String.IsNullOrEmpty (pathInfo)) result += pathInfo; return result; } public override bool HeadersSent () { return headersSent; } public override bool IsClientConnected () { return (requestBroker != null && requestBroker.IsConnected (requestId)); } public override bool IsEntireEntityBodyIsPreloaded () { if (verb != "POST" || refilled || position >= inputLength) return false; var content_length = (string) headers ["Content-Length"]; long length; if (!Int64.TryParse (content_length, out length)) return false; return (length <= inputLength); } bool TryDirectory () { string localPath = GetFilePathTranslated (); if (!Directory.Exists (localPath)) return true; string oldPath = path; if (!path.EndsWith ("/")) path += "/"; bool catOne = false; foreach (string indexFile in indexFiles) { string testfile = Path.Combine (localPath, indexFile); if (File.Exists (testfile)) { path += indexFile; catOne = true; break; } } if (!catOne) path = oldPath; return true; } protected override bool GetRequestData () { return TryDirectory (); } int ReadInput (byte [] buffer, int offset, int size) { int length = inputLength - position; if (length > 0) { if (length > size) length = size; Buffer.BlockCopy (inputBuffer, position, buffer, offset, length); position += length; offset += length; size -= length; if (size == 0) return length; } int localsize = 0; while (size > 0) { byte[] readBuffer; int read = requestBroker.Read (requestId, size, out readBuffer); if (read == 0) break; if (read < 0) throw new HttpException (500, "Error reading request."); Buffer.BlockCopy (readBuffer, 0, buffer, offset, read); offset += read; size -= read; localsize += read; } return (length + localsize); } public override int ReadEntityBody (byte [] buffer, int size) { if (verb == "GET" || verb == "HEAD" || size == 0 || buffer == null) return 0; return ReadInput (buffer, 0, size); } public override void SendResponseFromMemory (byte [] data, int length) { if (requestBroker == null || length <= 0) return; if (data.Length < length) length = data.Length; bool uncork = false; if (!headersSent) { Cork (true); uncork = true; SendHeaders (); } int sent = Send (data, 0, length); if (sent != length) throw new IOException ("Blocking send did not send entire buffer"); if (uncork) Cork (false); } public override void SendStatus (int statusCode, string statusDescription) { this.statusCode = statusCode; this.statusDescription = statusDescription; if (statusCode == 400 || statusCode >= 500) { sentConnection = false; keepAlive = false; SendUnknownResponseHeader ("Connection", "close"); } } public override void SendUnknownResponseHeader (string name, string value) { if (String.Compare (name, "connection", true, CultureInfo.InvariantCulture) == 0) { sentConnection = true; if (value.ToLower ().IndexOf ("keep-alive") == -1) { keepAlive = false; } } if (!sentConnection && !haveContentLength && String.Compare (name, "Content-Length", true, CultureInfo.InvariantCulture) == 0) { haveContentLength = true; } if (headersSent) return; responseHeaders.Append (name); responseHeaders.Append (": "); responseHeaders.Append (value); responseHeaders.Append ("\r\n"); } public override bool IsSecure () { return secure; } public override void SendResponseFromFile (string filename, long offset, long length) { using (FileStream fs = File.OpenRead (filename)) { if (secure || no_libc) { // We must not call the SendResponseFromFile overload which // takes IntPtr in this case since it will call the base // implementation of that overload which, in turn, will // close the handle (as it uses FileStream to wrap the // handle we pass). This will cause the handle to be closed // twice (FileStream owns the handle). So we just take a // shortcut to what the base overload does here. SendFromStream (fs, offset, length); } else { SendResponseFromFile (fs.Handle, offset, length); } } } public override void SendResponseFromFile (IntPtr handle, long offset, long length) { if (secure || no_libc) { base.SendResponseFromFile (handle, offset, length); return; } try { Cork (true); SendHeaders (); while (length > 0) { int result = sendfile ((int) socket, (int) handle, ref offset, (IntPtr) length); if (result == -1) throw new System.ComponentModel.Win32Exception (); // sendfile() will set 'offset' for us length -= result; } } finally { Cork (false); } } int SendHeaders () { if (headersSent) return 0; byte [] headers = GetHeaders (); headersSent = true; return Send (headers, 0, headers.Length); } int Cork (bool val) { if (secure || no_libc) return 0; // 6 -> SOL_TCP, 3 -> TCP_CORK bool t = val; return setsockopt ((int) socket, 6, 3, ref t, (IntPtr) IntPtr.Size); } unsafe int Send (byte [] buffer, int offset, int len) { if (secure || no_libc) { requestBroker.Write (requestId, buffer, offset, len); return len; } int total = 0; while (total < len) { fixed (byte *ptr = buffer) { // 0x4000 no sigpipe int n = send ((int) socket, ptr + total, (IntPtr) (len - total), 0x4000); if (n >= 0) { total += n; } else if (Marshal.GetLastWin32Error () != 4 /* EINTR */) { throw new IOException (); } } } return total; } [DllImport ("libc", SetLastError=true)] extern static int setsockopt (int handle, int level, int opt, ref bool val, IntPtr len); [DllImport ("libc", SetLastError=true)] extern static int sendfile (int out_fd, int in_fd, ref long offset, IntPtr count); [DllImport ("libc", SetLastError=true, EntryPoint="send")] unsafe extern static int send (int s, byte *buffer, IntPtr len, int flags); } } xsp-4.2/src/Mono.WebServer.XSP/xsp-2.pc.in0000664000175000017500000000045312627046413015100 00000000000000prefix=@prefix@ assemblies_dir=${prefix}/lib/mono/2.0 Libraries=${assemblies_dir}/Mono.WebServer2.dll Executable=${assemblies_dir}/xsp2.exe Name: xsp2 Description: Mono.WebServer2.dll - ASP.NET hosting support classes for .NET 2.0 Version: @VERSION@ Libs: -r:${assemblies_dir}/Mono.WebServer2.dll xsp-4.2/src/Mono.WebServer.XSP/ConfigurationManager.cs0000664000175000017500000001205412627046413017627 00000000000000// // ConfigurationManager.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Net; using Mono.WebServer.Options.Settings; using TP = Mono.Security.Protocol.Tls; using Mono.WebServer.Options; namespace Mono.WebServer.XSP { class ConfigurationManager : ServerConfigurationManager { #region Backing fields readonly BoolSetting nonstop = new BoolSetting ("nonstop", "Don't stop the server by pressing enter. Must be used when the server has no controlling terminal."); readonly BoolSetting quiet = new BoolSetting ("quiet", "Disable the initial start up information."); readonly BoolSetting randomPort = new BoolSetting ("random-port", "Listen on a randomly assigned port. The port numer will be reported to the caller via a text file."); readonly BoolSetting https = new BoolSetting ("https", "Enable SSL for the server."); readonly BoolSetting httpsClientAccept = new BoolSetting ("https-client-accept", "Enable SSL for the server with optional client certificates."); readonly BoolSetting httpsClientRequire = new BoolSetting ("https-client-require", "Enable SSL for the server with mandatory client certificates."); readonly BoolSetting noHidden = new BoolSetting ("no-hidden", "Allow access to hidden files (see 'man xsp' for details)."); readonly NullableInt32Setting minThreads = new NullableInt32Setting ("minThreads", "The minimum number of threads the thread pool creates on startup. Increase this value to handle a sudden inflow of connections."); readonly UInt16Setting port = new UInt16Setting ("port", Descriptions.Port, "MonoServerPort", "MONO_FCGI_PORT", 9000); readonly StringSetting p12File = new StringSetting ("p12file", "Path to a PKCS#12 file containing the certificate and the private."); readonly StringSetting cert = new StringSetting ("cert", "Path to X.509 certificate file (cer)."); readonly StringSetting pkFile = new StringSetting ("pkfile", "Path to private key file (pvk)."); readonly StringSetting pkPwd = new StringSetting ("pkpwd", "Password to decrypt the private key."); readonly StringSetting pidFile = new StringSetting ("pidfile", "Write the process PID to the specified file."); readonly EnumSetting protocols = new EnumSetting ("protocols", "specify which protocols are available for SSL. Possible values: Default (all), Tls, Ssl2, Ssl3", defaultValue: TP.SecurityProtocolType.Default); #endregion #region Typesafe properties public bool NonStop { get { return nonstop; } } public bool Quiet { get { return quiet; } } public bool RandomPort { get { return randomPort; } } public bool Https { get { return https; } } public bool HttpsClientAccept { get { return httpsClientAccept; } } public bool HttpsClientRequire { get { return httpsClientRequire; } } public bool NoHidden { get { return noHidden; } } public int? MinThreads { get { return minThreads; } } public ushort Port { get { return port; } } public string P12File { get { return p12File; } } public string Cert { get { return cert; } } public string PkFile { get { return pkFile; } } public string PkPwd { get { return pkPwd; } } public string PidFile { get { return pidFile; } } public TP.SecurityProtocolType Protocols { get { return protocols; } } #endregion public override string ProgramName { get { return "xsp"; } } public override string Description { get { return "XSP server is a sample server that hosts the ASP.NET runtime in a minimalistic HTTP server"; } } public ConfigurationManager (string name, bool quietDefault) : base (name) { Add (nonstop, quiet, randomPort, https, httpsClientAccept, httpsClientRequire, noHidden, minThreads, port, p12File, cert, pkFile, pkPwd, pidFile, protocols); address.MaybeUpdate (SettingSource.Default, IPAddress.Any); quiet.MaybeUpdate (SettingSource.Default, quietDefault); } } } xsp-4.2/src/Mono.WebServer.XSP/CompatTuple.cs0000664000175000017500000000273212627046413015764 00000000000000// // CompatTuple.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.XSP { [Serializable] struct CompatTuple { public T1 Item1; public T2 Item2; public T3 Item3; public CompatTuple (T1 item1, T2 item2, T3 item3) { Item1 = item1; Item2 = item2; Item3 = item3; } } } xsp-4.2/src/Mono.WebServer.XSP/XSPRequestBroker.cs0000664000175000017500000000361412627046413016717 00000000000000// // Mono.WebServer.XSPApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.WebServer.XSP; namespace Mono.WebServer { // // XSPRequestBroker: The request broker for XSP. Provides some // additional methods to the BaseRequestBroker from which inherits. // public class XSPRequestBroker: BaseRequestBroker { public int GetReuseCount (int requestId) { var worker = (XSPWorker) GetWorker (requestId); if (worker == null) return 0; return worker.GetRemainingReuses (); } public void Close (int requestId, bool keepAlive) { var worker = (XSPWorker) GetWorker (requestId); if (worker == null) return; try { worker.Close (keepAlive); } catch {} } } } xsp-4.2/src/Mono.WebServer.XSP/AssemblyInfo.cs.in0000664000175000017500000000415212627046413016525 00000000000000// AssemblyInfo.cs.in: // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Copyright (c) 2002-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("@XSP_VERSION@")] [assembly: AssemblyTitle ("Mono.WebServer.XSP")] [assembly: AssemblyDescription ("Minimalistic web server for testing System.Web")] [assembly: AssemblyCopyright ("(C) 2002-2011 Novell, Inc.")] [assembly: AssemblyCompany ("Novell, Inc.")] [assembly: InternalsVisibleTo ("Mono.WebServer.Test, PublicKey = 0024000004800000940000000602000" + "00024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1a" + "fcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fb" + "e2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c508" + "1dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284db" + "dd35f46cdff12a1bd78e4ef0065d016df")] xsp-4.2/src/Mono.WebServer.XSP/xsp-4.pc.in0000664000175000017500000000045312627046413015102 00000000000000prefix=@prefix@ assemblies_dir=${prefix}/lib/mono/4.5 Libraries=${assemblies_dir}/Mono.WebServer2.dll Executable=${assemblies_dir}/xsp4.exe Name: xsp4 Description: Mono.WebServer2.dll - ASP.NET hosting support classes for .NET 4.0 Version: @VERSION@ Libs: -r:${assemblies_dir}/Mono.WebServer2.dll xsp-4.2/src/Mono.WebServer.XSP/XSPWorker.cs0000664000175000017500000001720012627046413015367 00000000000000// // Mono.WebServer.XSPApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; using System.Threading; using Mono.Security.Protocol.Tls; using Mono.WebServer.Log; using SecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType; namespace Mono.WebServer.XSP { // // XSPWorker: The worker that do the initial processing of XSP // requests. // class XSPWorker: Worker { readonly ApplicationServer server; readonly LingeringNetworkStream netStream; readonly Stream stream; readonly IPEndPoint remoteEP; readonly IPEndPoint localEP; readonly Socket sock; readonly SslInformation ssl; InitialWorkerRequest initial; int requestId = -1; XSPRequestBroker broker; int reuses; public XSPWorker (Socket client, EndPoint localEP, ApplicationServer server, bool secureConnection, SecurityProtocolType securityProtocol, X509Certificate cert, PrivateKeySelectionCallback keyCB, bool allowClientCert, bool requireClientCert) { if (secureConnection) { ssl = new SslInformation { AllowClientCertificate = allowClientCert, RequireClientCertificate = requireClientCert, RawServerCertificate = cert.GetRawCertData () }; netStream = new LingeringNetworkStream (client, true); var s = new SslServerStream (netStream, cert, requireClientCert, false); s.PrivateKeyCertSelectionDelegate += keyCB; s.ClientCertValidationDelegate += ClientCertificateValidation; stream = s; } else { netStream = new LingeringNetworkStream (client, false); stream = netStream; } sock = client; this.server = server; remoteEP = (IPEndPoint) client.RemoteEndPoint; this.localEP = (IPEndPoint) localEP; } public override bool IsAsync { get { return true; } } public override void SetReuseCount (int nreuses) { reuses = nreuses; } public override int GetRemainingReuses () { return 100 - reuses; } public override void Run (object state) { initial = new InitialWorkerRequest (stream); byte [] buffer = InitialWorkerRequest.AllocateBuffer (); stream.BeginRead (buffer, 0, buffer.Length, ReadCB, buffer); } void ReadCB (IAsyncResult ares) { var buffer = (byte []) ares.AsyncState; try { int nread = stream.EndRead (ares); // See if we got at least 1 line initial.SetBuffer (buffer, nread); initial.ReadRequestData (); ThreadPool.QueueUserWorkItem (RunInternal); } catch (Exception e) { InitialWorkerRequest.FreeBuffer (buffer); HandleInitialException (e); } } void HandleInitialException (Exception e) { //bool ignore = ((e is RequestLineException) || (e is IOException)); //if (!ignore) // Console.WriteLine (e); try { if (initial != null && initial.GotSomeInput && sock.Connected) { byte [] error = HttpErrors.ServerError (); Write (error, 0, error.Length); } } catch {} try { Close (); } catch {} if (broker != null && requestId != -1) broker.UnregisterRequest (requestId); } void RunInternal (object state) { RequestData rdata = initial.RequestData; initial.FreeBuffer (); string vhost = null; // TODO: read the headers in InitialWorkerRequest int port = localEP.Port; VPathToHost vapp; try { vapp = server.GetApplicationForPath (vhost, port, rdata.Path, true); } catch (Exception e){ // // This happens if the assembly is not in the GAC, so we report this // error here. // Logger.Write (e); return; } XSPApplicationHost host = null; if (vapp != null) host = (XSPApplicationHost) vapp.AppHost; if (host == null) { byte [] nf = HttpErrors.NotFound (rdata.Path); Write (nf, 0, nf.Length); Close (); return; } broker = (XSPRequestBroker) vapp.RequestBroker; requestId = broker.RegisterRequest (this); if (ssl != null) { var s = (stream as SslServerStream); ssl.KeySize = s.CipherStrength; ssl.SecretKeySize = s.KeyExchangeStrength; } try { string redirect; vapp.Redirect (rdata.Path, out redirect); host.ProcessRequest (requestId, localEP, remoteEP, rdata.Verb, rdata.Path, rdata.QueryString, rdata.Protocol, rdata.InputBuffer, redirect, sock.Handle, ssl); } catch (FileNotFoundException fnf) { // We print this one, as it might be a sign of a bad deployment // once we require the .exe and Mono.WebServer in bin or the GAC. Logger.Write (fnf); } catch (IOException) { // This is ok (including EndOfStreamException) } catch (Exception e) { Logger.Write (e); } } public override int Read (byte[] buffer, int position, int size) { int n = stream.Read (buffer, position, size); return (n >= 0) ? n : -1; } public override void Write (byte[] buffer, int position, int size) { try { stream.Write (buffer, position, size); } catch (Exception ex) { Logger.Write (LogLevel.Error, "Peer unexpectedly closed the connection on write. Closing our end."); Logger.Write (ex); Close (); } } public override void Close () { Close (false); } public void Close (bool keepAlive) { if (!keepAlive || !IsConnected ()) { stream.Close (); if (stream != netStream) { netStream.Close (); } else if (!netStream.OwnsSocket) { try { if (sock.Connected && !(sock.Poll (0, SelectMode.SelectRead) && sock.Available == 0)) sock.Shutdown (SocketShutdown.Both); } catch { // ignore } try { sock.Close (); } catch { // ignore } } return; } netStream.EnableLingering = false; stream.Close (); if (stream != netStream) netStream.Close (); server.ReuseSocket (sock, reuses + 1); } public override bool IsConnected () { return netStream.Connected; } public override void Flush () { if (stream != netStream) stream.Flush (); } bool ClientCertificateValidation (X509Certificate certificate, int [] certificateErrors) { if (certificate != null) ssl.RawClientCertificate = certificate.GetRawCertData (); // to avoid serialization // right now we're accepting any client certificate - i.e. it's up to the // web application to check if the certificate is valid (HttpClientCertificate.IsValid) ssl.ClientCertificateValid = (certificateErrors.Length == 0); return !ssl.RequireClientCertificate || (certificate != null); } } } xsp-4.2/src/Mono.WebServer.XSP/XSPApplicationHost.cs0000664000175000017500000001264112627046413017223 00000000000000// // Mono.WebServer.XSPApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Web; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; namespace Mono.WebServer { // // XSPApplicationHost: The application host for XSP. // public class XSPApplicationHost : BaseApplicationHost { // This method is only compatible with IPv4, please use IPEndPoint based overload. public void ProcessRequest(int reqId, long localEPAddr, int localEPPort, long remoteEPAdds, int remoteEPPort, string verb, string path, string queryString, string protocol, byte[] inputBuffer, string redirect, IntPtr socket, SslInformation ssl) { var localEP = new IPEndPoint (localEPAddr, localEPPort); var remoteEP = new IPEndPoint (remoteEPAdds, remoteEPPort); ProcessRequest (reqId, localEP, remoteEP, verb, path, queryString, protocol, inputBuffer, redirect, socket, ssl); } public void ProcessRequest(int reqId, IPEndPoint localEP, IPEndPoint remoteEP, string verb, string path, string queryString, string protocol, byte [] inputBuffer, string redirect, IntPtr socket, SslInformation ssl) { var broker = (XSPRequestBroker) RequestBroker; bool secure = (ssl != null); var mwr = new XSPWorkerRequest (reqId, broker, this, localEP, remoteEP, verb, path, queryString, protocol, inputBuffer, socket, secure); if (secure) { // note: we're only setting what we use (and not the whole lot) mwr.AddServerVariable ("CERT_KEYSIZE", ssl.KeySize.ToString (CultureInfo.InvariantCulture)); mwr.AddServerVariable ("CERT_SECRETKEYSIZE", ssl.SecretKeySize.ToString (CultureInfo.InvariantCulture)); if (ssl.RawClientCertificate != null) { // the worker need to be able to return it (if asked politely) mwr.SetClientCertificate (ssl.RawClientCertificate); // XSPWorkerRequest will answer, as required, for CERT_COOKIE, CERT_ISSUER, // CERT_SERIALNUMBER and CERT_SUBJECT (as anyway it requires the client // certificate - if it was provided) if (ssl.ClientCertificateValid) { // client cert present (bit0 = 1) and valid (bit1 = 0) mwr.AddServerVariable ("CERT_FLAGS", "1"); } else { // client cert present (bit0 = 1) but invalid (bit1 = 1) mwr.AddServerVariable ("CERT_FLAGS", "3"); } } else { // no client certificate (bit0 = 0) ? does bit1 matter ? mwr.AddServerVariable ("CERT_FLAGS", "0"); } if (ssl.RawServerCertificate != null) { X509Certificate server = ssl.GetServerCertificate (); mwr.AddServerVariable ("CERT_SERVER_ISSUER", server.Issuer); mwr.AddServerVariable ("CERT_SERVER_SUBJECT", server.Subject); } } string translated = mwr.GetFilePathTranslated (); if (path [path.Length - 1] != '/' && Directory.Exists (translated)) redirect = path + '/'; if (redirect != null) { Redirect (mwr, redirect); broker.UnregisterRequest (reqId); return; } ProcessRequest (mwr); } const string CONTENT301 = "\n" + "\n301 Moved Permanently\n\n" + "

Moved Permanently

\n" + "

The document has moved to http://{0}{1}.

\n" + "\n"; static void Redirect (HttpWorkerRequest wr, string location) { string host = wr.GetKnownRequestHeader (HttpWorkerRequest.HeaderHost); wr.SendStatus (301, "Moved Permanently"); wr.SendUnknownResponseHeader ("Connection", "close"); wr.SendUnknownResponseHeader ("Date", DateTime.Now.ToUniversalTime ().ToString ("r")); wr.SendUnknownResponseHeader ("Location", String.Format ("http://{0}{1}", host, location)); Encoding enc = Encoding.ASCII; wr.SendUnknownResponseHeader ("Content-Type", "text/html; charset=" + enc.WebName); string content = String.Format (CONTENT301, host, location); byte [] contentBytes = enc.GetBytes (content); wr.SendUnknownResponseHeader ("Content-Length", contentBytes.Length.ToString ()); wr.SendResponseFromMemory (contentBytes, contentBytes.Length); wr.FlushResponse (true); wr.CloseConnection (); } } } xsp-4.2/src/Mono.WebServer.XSP/xsp.pc.in0000664000175000017500000000044612627046413014743 00000000000000prefix=@prefix@ assemblies_dir=${prefix}/lib/mono/1.0 Libraries=${assemblies_dir}/Mono.WebServer.dll Executable=${assemblies_dir}/xsp.exe Name: xsp Description: Mono.WebServer.dll - ASP.NET hosting support classes for .NET 1.1 Version: @VERSION@ Libs: -r:${assemblies_dir}/Mono.WebServer.dll xsp-4.2/src/Mono.WebServer.XSP/SslInformation.cs0000664000175000017500000000366112627046413016500 00000000000000// // Mono.WebServer.SslInfomation // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; namespace Mono.WebServer { [Serializable] public class SslInformation { public bool AllowClientCertificate { get; set; } public bool RequireClientCertificate { get; set; } public bool ClientCertificateValid { get; set; } public int KeySize { get; set; } public byte[] RawClientCertificate { get; set; } public byte[] RawServerCertificate { get; set; } public int SecretKeySize { get; set; } public X509Certificate GetServerCertificate () { return RawServerCertificate == null ? null : new X509Certificate (RawServerCertificate); } } } xsp-4.2/src/Mono.WebServer.XSP/Makefile.am0000664000175000017500000000205212627054367015236 00000000000000builddir=$(top_builddir)/src/Mono.WebServer.XSP pkgconfigdir=$(libdir)/pkgconfig MCSFLAGS= -debug+ -debug:full -nologo -nowarn:618 -unsafe $(WEBTRACING) -keyfile:$(top_srcdir)/src/mono.snk XSP4_EXE = xsp4.exe GACUTIL4=$(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll references4 = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll pkgconfig_DATA = xsp-2.pc pkgconfig_DATA += xsp-4.pc sources = $(shell cat $(srcdir)/Mono.WebServer.XSP.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) Mono.WebServer.XSP.sources AssemblyInfo.cs.in xsp4.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/xsp4.exe uninstall-local: -for i in xsp4 ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done xsp-4.2/src/Mono.WebServer.XSP/main.cs0000664000175000017500000002351312627046413014453 00000000000000// // Mono.WebServer.XSP/main.cs: Web Server that uses ASP.NET hosting // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2009 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Threading; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using Mono.WebServer.Log; using Mono.WebServer.Options; namespace Mono.WebServer.XSP { public class Server : MarshalByRefObject { static RSA key; static readonly CompatTuple success = new CompatTuple (0, null, null); static AsymmetricAlgorithm GetPrivateKey (X509Certificate certificate, string targetHost) { return key; } public static void CurrentDomain_UnhandledException (object sender, UnhandledExceptionEventArgs e) { var ex = (Exception)e.ExceptionObject; Logger.Write (LogLevel.Error, "Handling exception type {0}", ex.GetType ().Name); Logger.Write (LogLevel.Error, "Message is {0}", ex.Message); Logger.Write (LogLevel.Error, "IsTerminating is set to {0}", e.IsTerminating); if (e.IsTerminating) Logger.Write(ex); } public static int Main (string [] args) { return DebugMain (args).Item1; } internal static CompatTuple DebugMain (string [] args) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; bool quiet = false; while (true) { try { return new Server ().DebugMain (args, true, null, quiet); } catch (ThreadAbortException ex) { Logger.Write (ex); // Single-app mode and ASP.NET appdomain unloaded Thread.ResetAbort (); quiet = true; // hush 'RealMain' } } } /// Original args passed to the program. /// If set to true it means the caller is in the root domain. /// Used when single app mode is used, in a recursive call to RealMain from the single app domain. /// If set to true don't show messages. Used to avoid double printing of the banner. public int RealMain (string [] args, bool root, IApplicationHost ext_apphost, bool quiet) { return DebugMain (args, root, ext_apphost, quiet).Item1; } /// Original args passed to the program. /// If set to true it means the caller is in the root domain. /// Used when single app mode is used, in a recursive call to RealMain from the single app domain. /// If set to true don't show messages. Used to avoid double printing of the banner. internal CompatTuple DebugMain (string [] args, bool root, IApplicationHost ext_apphost, bool quiet) { var configurationManager = new ConfigurationManager ("xsp", quiet); var security = new SecurityConfiguration (); if (!ParseOptions (configurationManager, args, security)) return new CompatTuple (1, "Error while parsing options", null); // Show the help and exit. if (configurationManager.Help) { configurationManager.PrintHelp (); #if DEBUG Console.WriteLine ("Press any key..."); Console.ReadKey (); #endif return success; } // Show the version and exit. if (configurationManager.Version) { Version.Show (); return success; } if (!configurationManager.LoadConfigFile ()) return new CompatTuple (1, "Error while loading the configuration file", null); configurationManager.SetupLogger (); WebSource webSource; if (security.Enabled) { try { key = security.KeyPair; webSource = new XSPWebSource (configurationManager.Address, configurationManager.RandomPort ? default(ushort) : configurationManager.Port, security.Protocol, security.ServerCertificate, GetPrivateKey, security.AcceptClientCertificates, security.RequireClientCertificates, !root); } catch (CryptographicException ce) { Logger.Write (ce); return new CompatTuple (1, "Error while setting up https", null); } } else { webSource = new XSPWebSource (configurationManager.Address, configurationManager.Port, !root); } var server = new ApplicationServer (webSource, configurationManager.Root) { Verbose = configurationManager.Verbose, SingleApplication = !root }; if (configurationManager.Applications != null) server.AddApplicationsFromCommandLine (configurationManager.Applications); if (configurationManager.AppConfigFile != null) server.AddApplicationsFromConfigFile (configurationManager.AppConfigFile); if (configurationManager.AppConfigDir != null) server.AddApplicationsFromConfigDirectory (configurationManager.AppConfigDir); if (configurationManager.Applications == null && configurationManager.AppConfigDir == null && configurationManager.AppConfigFile == null) server.AddApplicationsFromCommandLine ("/:."); VPathToHost vh = server.GetSingleApp (); if (root && vh != null) { // Redo in new domain vh.CreateHost (server, webSource); var svr = (Server) vh.AppHost.Domain.CreateInstanceAndUnwrap (GetType ().Assembly.GetName ().ToString (), GetType ().FullName); webSource.Dispose (); return svr.DebugMain (args, false, vh.AppHost, configurationManager.Quiet); } server.AppHost = ext_apphost; if (!configurationManager.Quiet) { Logger.Write(LogLevel.Notice, Assembly.GetExecutingAssembly().GetName().Name); Logger.Write(LogLevel.Notice, "Listening on address: {0}", configurationManager.Address); Logger.Write(LogLevel.Notice, "Root directory: {0}", configurationManager.Root); } try { if (!server.Start (!configurationManager.NonStop, (int)configurationManager.Backlog)) return new CompatTuple (2, "Error while starting server", server); if (!configurationManager.Quiet) { // MonoDevelop depends on this string. If you change it, let them know. Logger.Write(LogLevel.Notice, "Listening on port: {0} {1}", server.Port, security); } if (configurationManager.RandomPort && !configurationManager.Quiet) Logger.Write (LogLevel.Notice, "Random port: {0}", server.Port); if (!configurationManager.NonStop) { if (!configurationManager.Quiet) Console.WriteLine ("Hit Return to stop the server."); while (true) { bool doSleep; try { Console.ReadLine (); break; } catch (IOException) { // This might happen on appdomain unload // until the previous threads are terminated. doSleep = true; } catch (ThreadAbortException) { doSleep = true; } if (doSleep) Thread.Sleep (500); } server.Stop (); } } catch (Exception e) { if (!(e is ThreadAbortException)) Logger.Write (e); else server.ShutdownSockets (); return new CompatTuple (1, "Error running server", server); } return new CompatTuple (0, null, server); } static bool ParseOptions (ConfigurationManager manager, string[] args, SecurityConfiguration security) { if (!manager.LoadCommandLineArgs (args)) return false; // TODO: add mutual exclusivity rules if(manager.Https) security.Enabled = true; if (manager.HttpsClientAccept) { security.Enabled = true; security.AcceptClientCertificates = true; security.RequireClientCertificates = false; } if (manager.HttpsClientRequire) { security.Enabled = true; security.AcceptClientCertificates = true; security.RequireClientCertificates = true; } if (manager.P12File != null) security.Pkcs12File = manager.P12File; if(manager.Cert != null) security.CertificateFile = manager.Cert; if (manager.PkFile != null) security.PvkFile = manager.PkFile; if (manager.PkPwd != null) security.Password = manager.PkPwd; security.Protocol = manager.Protocols; int minThreads = manager.MinThreads ?? 0; if(minThreads > 0) ThreadPool.SetMinThreads (minThreads, minThreads); if(!String.IsNullOrEmpty(manager.PidFile)) try { using (StreamWriter sw = File.CreateText (manager.PidFile)) { sw.Write (Process.GetCurrentProcess ().Id); } } catch (Exception ex) { Logger.Write (LogLevel.Error, "Failed to write pidfile {0}: {1}", manager.PidFile, ex.Message); } if(manager.NoHidden) MonoWorkerRequest.CheckFileAccess = false; return true; } public override object InitializeLifetimeService () { return null; } } } xsp-4.2/src/mono.pub0000664000175000017500000000024012627046413011364 00000000000000$$RSA1yw:kz.tѯ̓t+,4GM$G~hSo&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Mono.WebServer Mono.WebServer.XSP Mono.WebServer.Apache \ Mono.WebServer.FastCgi Mono.WebServer.Fpm am__DIST_COMMON = $(srcdir)/Makefile.in TODO DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @XSP_ONLY_FALSE@SUBDIRS = Mono.WebServer Mono.WebServer.XSP Mono.WebServer.Apache Mono.WebServer.FastCgi Mono.WebServer.Fpm @XSP_ONLY_TRUE@SUBDIRS = Mono.WebServer Mono.WebServer.XSP EXTRA_DIST = mono.pub mono.snk all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer.FastCgi/0000775000175000017500000000000012627055647014133 500000000000000xsp-4.2/src/Mono.WebServer.FastCgi/Obsolete/0000775000175000017500000000000012627055647015707 500000000000000xsp-4.2/src/Mono.WebServer.FastCgi/Obsolete/SocketFactory.cs0000664000175000017500000000445112627046413020731 00000000000000// // SocketFactory.cs: Creates bound sockets of various types to use. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.FastCgi.Sockets; namespace Mono.FastCgi { [Obsolete] public static class SocketFactory { public static Socket CreateTcpSocket (System.Net.IPEndPoint localEndPoint) { if (localEndPoint == null) throw new ArgumentNullException ("localEndPoint"); return new TcpSocket (localEndPoint); } public static Socket CreateTcpSocket (System.Net.IPAddress address, int port) { if (address == null) throw new ArgumentNullException ("address"); return new TcpSocket (address, port); } public static Socket CreateUnixSocket (string path) { if (path == null) throw new ArgumentNullException ("path"); return new UnixSocket (path); } public static Socket CreateUnixSocket (string path, ushort? permissions) { if (path == null) throw new ArgumentNullException ("path"); return new UnixSocket (path, permissions); } public static Socket CreatePipeSocket (IntPtr sock) { return new UnmanagedSocket (sock); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Obsolete/ConfigurationManager.cs0000664000175000017500000000512712627046413022254 00000000000000// // ConfigurationManager.cs: Generic multi-source configuration manager. // // Author: // Brian Nickel (brian.nickel@gmail.com) // Robert Jordan // Leonardo Taglialegne // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Reflection; using System.Xml; using Mono.WebServer.Options; namespace Mono.WebServer { [Obsolete] public class ConfigurationManager { readonly FastCgi.ConfigurationManager configurationManager = new FastCgi.ConfigurationManager ("fastcgi-mono-server"); public ConfigurationManager (Assembly asm, string resource) { if (asm == null) throw new ArgumentNullException ("asm"); if (resource == null) throw new ArgumentNullException ("resource"); var doc = new XmlDocument (); Stream stream = asm.GetManifestResourceStream (resource); if (stream != null) doc.Load (stream); configurationManager.ImportSettings (doc, false); } public bool Contains (string name) { return configurationManager.Contains (name); } [Obsolete] public object this [string name] { get { return configurationManager.GetSetting (name).Value; } set { configurationManager.SetValue (name, value); } } public void PrintHelp () { configurationManager.PrintHelp (); } public void LoadCommandLineArgs (string[] args) { configurationManager.LoadCommandLineArgs (args); } public void LoadXmlConfig (string filename) { configurationManager.TryLoadXmlConfig (filename); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Obsolete/Record.cs0000664000175000017500000001506412627046413017371 00000000000000// // Record.cs: Handles sending and receiving FastCGI records via sockets. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Globalization; using Mono.WebServer.Log; using Mono.WebServer.FastCgi; using Mono.WebServer.FastCgi.Compatibility; using NRecord = Mono.WebServer.FastCgi.Record; namespace Mono.FastCgi { [Obsolete] public struct Record { #region Private Fields readonly byte version; readonly RecordType type; readonly ushort request_id; readonly Buffers buffers; public const int SuggestedBufferSize = 0x08 + 0xFFFF + 0xFF; #endregion #region Public Fields public const int HeaderSize = 8; #endregion #region Constructors public Record (Socket socket) : this (socket, new Buffers()) { } public Record (Socket socket, byte[] buffer) : this (socket, new Buffers (buffer, HeaderSize, buffer.Length - HeaderSize - 8)) { } public Record (Socket socket, Buffers receive_buffer) : this() { if (socket == null) throw new ArgumentNullException ("socket"); CompatArraySegment header_buffer = receive_buffer.EnforceHeaderLength (HeaderSize); // Read the 8 byte record header. NRecord.ReceiveAll (socket, header_buffer, HeaderSize); // Read the values from the data. version = header_buffer [0]; type = (RecordType) header_buffer [1]; request_id = NRecord.ReadUInt16 (header_buffer, 2); BodyLength = NRecord.ReadUInt16 (header_buffer, 4); byte padding_length = header_buffer [6]; CompatArraySegment body_buffer = receive_buffer.EnforceBodyLength (BodyLength); // Read the record data, and throw an exception if the // complete data cannot be read. if (BodyLength > 0) NRecord.ReceiveAll (socket, body_buffer, BodyLength); CompatArraySegment padding_buffer = receive_buffer.EnforcePaddingLength (padding_length); if(padding_length > 0) NRecord.ReceiveAll(socket, padding_buffer, padding_length); buffers = receive_buffer; Logger.Write (LogLevel.Debug, Strings.Record_Received, Type, RequestID, BodyLength); } public Record (byte version, RecordType type, ushort requestID, byte [] bodyData) : this (version, type, requestID, bodyData, 0, -1) { } public Record (byte version, RecordType type, ushort requestID, Buffers buffers, int bodyLength) : this() { this.version = version; this.type = type; request_id = requestID; this.buffers = buffers; BodyLength = (ushort) bodyLength; } public Record (byte version, RecordType type, ushort requestID, byte [] bodyData, int bodyIndex, int bodyLength) : this() { if (bodyData == null) throw new ArgumentNullException ("bodyData"); if (bodyIndex < 0 || bodyIndex > bodyData.Length) throw new ArgumentOutOfRangeException ( "bodyIndex"); if (bodyLength < 0) bodyLength = bodyData.Length - bodyIndex; if (bodyLength > 0xFFFF) throw new ArgumentException ( Strings.Record_DataTooBig, "bodyLength"); this.version = version; this.type = type; request_id = requestID; buffers = new Buffers (bodyData, bodyIndex, bodyLength); BodyLength = (ushort) bodyLength; } #endregion #region Public Properties public byte Version { get {return version;} } public RecordType Type { get {return type;} } public ushort RequestID { get {return request_id;} } public ushort BodyLength { get; private set; } #endregion #region Public Methods internal Buffers GetBuffers () { return buffers; } public void CopyTo (byte[] dest, int destIndex) { if (dest == null) throw new ArgumentNullException ("dest"); if (BodyLength > dest.Length - destIndex) throw new ArgumentOutOfRangeException ("destIndex"); if (buffers.Body.HasValue) buffers.Body.Value.CopyTo (dest, destIndex, BodyLength); } public byte[] GetBody () { var body_data = new byte [BodyLength]; if(buffers.Body.HasValue) buffers.Body.Value.CopyTo (body_data, 0, BodyLength); return body_data; } public void GetBody (out IReadOnlyList body) { if (buffers.Body == null) body = null; else body = buffers.Body.Value.Trimmed (BodyLength); } public override string ToString () { return String.Format (CultureInfo.CurrentCulture, Strings.Record_ToString, Version, Type, RequestID, BodyLength); } public void Send (Socket socket, byte [] buffer) { Send(socket); } public void Send(Socket socket) { var padding_size = (byte) ((8 - (BodyLength % 8)) % 8); CompatArraySegment header = buffers.EnforceHeaderLength (HeaderSize); header [0] = version; header [1] = (byte) type; header [2] = (byte) (request_id >> 8); header [3] = (byte) (request_id & 0xFF); header [4] = (byte) (BodyLength >> 8); header [5] = (byte) (BodyLength & 0xFF); header [6] = padding_size; CompatArraySegment padding = buffers.EnforcePaddingLength (padding_size); for (int i = 0; i < padding_size; i ++) padding [i] = 0; Logger.Write (LogLevel.Debug, Strings.Record_Sent, Type, RequestID, BodyLength); NRecord.SendAll (socket, header, HeaderSize); NRecord.SendAll (socket, buffers.Body, BodyLength); NRecord.SendAll (socket, padding, padding_size); } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/WebSource.cs0000664000175000017500000000403512627046413016271 00000000000000// // WebSource.cs: Provides a shell implementation of Mono.WebServer.WebSource // for ApplicationServer to get the IApplicationHost type from. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.FastCgi { // FIXME: This class could be removed if // Mono.WebServer.ApplicationServer is broken into two classes: // * ApplicationManager to handle application hosts, and // * ApplicationServer, a subclass of ApplicationManager that // adds on server support. public class WebSource : WebServer.WebSource { public override IRequestBroker CreateRequestBroker() { return null; } public override System.Type GetApplicationHostType() { return typeof(ApplicationHost); } public override Worker CreateWorker(System.Net.Sockets.Socket socket, ApplicationServer server) { return null; } public override System.Net.Sockets.Socket CreateSocket() { return null; } } } xsp-4.2/src/Mono.WebServer.FastCgi/Makefile.in0000664000175000017500000003366712627055642016132 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/Mono.WebServer.FastCgi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo.cs CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = $(top_builddir)/src/Mono.WebServer.FastCgi datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MCSFLAGS = -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe+ -keyfile:$(top_srcdir)/src/mono.snk XSP4_EXE = fastcgi-mono-server4.exe GACUTIL4 = $(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:Mono.Posix.dll references4 = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll sources = $(shell cat $(srcdir)/Mono.WebServer.FastCgi.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in $(resources) Mono.WebServer.FastCgi.sources all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.WebServer.FastCgi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.WebServer.FastCgi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile fastcgi-mono-server4.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ \ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/fastcgi-mono-server4.exe uninstall-local: -for i in $(noinst_SCRIPTS) ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer.FastCgi/Server.cs0000664000175000017500000001442012627046413015640 00000000000000// // Server.cs: Accepts connections. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using Mono.WebServer.FastCgi; using Mono.WebServer.Log; namespace Mono.FastCgi { public class Server { public BufferManager BigBufferManager { get; private set; } public BufferManager SmallBufferManager { get; private set; } #region Private Fields readonly IGenericServer backend; int max_requests = Int32.MaxValue; Type responder_type; #endregion #region Constructors public Server (Socket socket) { if (socket == null) throw new ArgumentNullException ("socket"); BigBufferManager = new BufferManager (4 * 1024); //4k SmallBufferManager = new BufferManager (8); backend = new GenericServer (socket, new ServerProxy (this)); backend.RequestReceived += RequestReceived; } public Server (IGenericServer backend) { if (backend == null) throw new ArgumentNullException ("backend"); BigBufferManager = new BufferManager (4 * 1024); //4k SmallBufferManager = new BufferManager (8); this.backend = backend; backend.RequestReceived += RequestReceived; } #endregion #region Public Properties public event EventHandler RequestReceived; public int MaxConnections { get { return backend.MaxConnections; } set { backend.MaxConnections = value; } } public int MaxRequests { get {return max_requests;} set { if (value < 1) throw new ArgumentOutOfRangeException ( "value", Strings.Server_MaxReqsOutOfRange); max_requests = value; } } public bool MultiplexConnections { get; set; } public bool CanAccept { get {return backend.CanAccept; } } public bool CanRequest { get {return backend.Started && RequestCount < max_requests;} } public int ConnectionCount { get { return backend.ConnectionCount; } } public int RequestCount { get { return backend.Connections.Sum(c => c.RequestCount); } } #endregion #region Public Methods internal ConnectionProxy OnAccept (Socket socket) { return new ConnectionProxy (new Connection (socket, this)); } [Obsolete] public void Start (bool background) { Start (background, 500); } public void Start (bool background, int backlog) { backend.Start (background, backlog); } /// /// Stop this instance. Calling Stop multiple times is a no-op. /// public void Stop () { backend.Stop (); } public void EndConnection (Connection connection) { backend.EndConnection (new ConnectionProxy (connection)); } public IDictionary GetValues (IEnumerable names) { if (names == null) throw new ArgumentNullException ("names"); var pairs = new Dictionary (); foreach (string name in names) { // We can't handle null values and we don't need // to store the same value twice. if (name == null || pairs.ContainsKey (name)) continue; string value = null; switch (name) { case "FCGI_MAX_CONNS": value = backend.MaxConnections.ToString (CultureInfo.InvariantCulture); break; case "FCGI_MAX_REQS": value = max_requests.ToString ( CultureInfo.InvariantCulture); break; case "FCGI_MPXS_CONNS": value = MultiplexConnections ? "1" : "0"; break; } if (value == null) { Logger.Write (LogLevel.Warning, Strings.Server_ValueUnknown, name); continue; } pairs.Add (name, value); } return pairs; } [Obsolete("Use BigBufferManager or SmallBufferManager instead.")] public void AllocateBuffers (out byte [] buffer1, out byte [] buffer2) { buffer1 = new byte[Record.SuggestedBufferSize]; buffer2 = new byte[Record.SuggestedBufferSize]; } [Obsolete("Use BigBufferManager or SmallBufferManager instead.")] public void ReleaseBuffers (byte [] buffer1, byte [] buffer2) { } #endregion #region Responder Management public void SetResponder (Type responder) { if (responder == null) throw new ArgumentNullException ("responder"); if (!typeof (IResponder).IsAssignableFrom (responder)) throw new ArgumentException ( Strings.Server_ResponderDoesNotImplement, "responder"); // Checks that the correct constructor is available. if (responder.GetConstructor (new[] {typeof (ResponderRequest)}) == null) { string msg = String.Format ( CultureInfo.CurrentCulture, Strings.Server_ResponderLacksProperConstructor, responder); throw new ArgumentException (msg, "responder"); } responder_type = responder; } public IResponder CreateResponder (ResponderRequest request) { if (!SupportsResponder) throw new InvalidOperationException ( Strings.Server_ResponderNotSupported); return (IResponder) Activator.CreateInstance (responder_type, new object [] {request}); } public bool SupportsResponder { get {return responder_type != null;} } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/NameValuePair.cs0000664000175000017500000002173612627046413017073 00000000000000// // NameValuePair.cs: Handles the parsing of FastCGI name/value pairs. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Text; using System.Collections.Generic; using Mono.WebServer.FastCgi; using Mono.WebServer.Log; using Mono.WebServer.FastCgi.Compatibility; namespace Mono.FastCgi { public struct NameValuePair { #region Private Fields readonly string name; readonly string value; static Encoding encoding = Encoding.Default; #endregion #region Public Fields public static readonly NameValuePair Empty = new NameValuePair ( null, null); #endregion #region Constructors public NameValuePair (string name, string value) { this.name = name; this.value = value; } [Obsolete] public NameValuePair (byte [] data, ref int index) { if (data == null) throw new ArgumentNullException ("data"); // Name/value pairs are stored with their lengths first, // then their contents. // Lengths are stored in 1 or 4 bytes depending on the // size of the contents. int name_length = ReadLength (data.ToReadOnlyList (), ref index); int value_length = ReadLength (data.ToReadOnlyList (), ref index); // Do a sanity check on the size of the data. if (index + name_length + value_length > data.Length) throw new ArgumentOutOfRangeException ("index"); // Make sure the encoding doesn't change while running. Encoding enc = encoding; // Read the name. name = enc.GetString (data, index, name_length); index += name_length; // Read the value. value = enc.GetString (data, index, value_length); index += value_length; Logger.Write (LogLevel.Debug, Strings.NameValuePair_ParameterRead, name, value); } public NameValuePair(IReadOnlyList data, ref int index) { if (data == null) throw new ArgumentNullException("data"); // Name/value pairs are stored with their lengths first, // then their contents. // Lengths are stored in 1 or 4 bytes depending on the // size of the contents. int name_length = ReadLength(data, ref index); int value_length = ReadLength(data, ref index); // Do a sanity check on the size of the data. if (index + name_length + value_length > data.Count) throw new ArgumentOutOfRangeException("index"); // Make sure the encoding doesn't change while running. Encoding enc = encoding; // Read the name. // FIXME: Please, PLEASE fix me var segment = (CompatArraySegment)data; name = enc.GetString(segment.Array, segment.Offset + index, name_length); index += name_length; // Read the value. value = enc.GetString(segment.Array, segment.Offset +index, value_length); index += value_length; Logger.Write(LogLevel.Debug, Strings.NameValuePair_ParameterRead, name, value); } #endregion #region Public Properties public string Name { get {return name;} } public string Value { get {return value;} } #endregion #region Public Static Properties public static Encoding Encoding { get {return encoding;} set {encoding = value ?? Encoding.Default;} } #endregion #region Public Static Methods [Obsolete] public static IDictionary FromData (byte [] data) { if (data == null) throw new ArgumentNullException ("data"); // Specialized.NameValueCollection would probably be // better, but it doesn't implement IDictionary. var pairs = new Dictionary (); int index = 0; // Loop through the array, reading pairs at a specified // position until the end is reached. while (index < data.Length) { var pair = new NameValuePair (data, ref index); if (pairs.ContainsKey (pair.Name)) { Logger.Write (LogLevel.Warning, Strings.NameValuePair_DuplicateParameter, pair.Name); pairs [pair.Name] = pair.Value; } else pairs.Add (pair.Name, pair.Value); } return pairs; } public static IDictionary FromData(IReadOnlyList data) { if (data == null) throw new ArgumentNullException("data"); // Specialized.NameValueCollection would probably be // better, but it doesn't implement IDictionary. var pairs = new Dictionary(); int index = 0; // Loop through the array, reading pairs at a specified // position until the end is reached. while (index < data.Count) { var pair = new NameValuePair(data, ref index); if (pairs.ContainsKey(pair.Name)) { Logger.Write(LogLevel.Warning, Strings.NameValuePair_DuplicateParameter, pair.Name); pairs[pair.Name] = pair.Value; } else pairs.Add(pair.Name, pair.Value); } return pairs; } public static byte [] GetData (IDictionary pairs) { if (pairs == null) throw new ArgumentNullException ("pairs"); // Make sure the encoding doesn't change while running. Encoding enc = encoding; // Get the total size of the new array and validate the // contents of "pairs". int total_size = 0; foreach (string key in pairs.Keys) { string value = pairs [key]; // Sanity check: "pairs" must only contain // strings. if (key == null || value == null) throw new ArgumentException ( Strings.NameValuePair_DictionaryContainsNonString, "pairs"); int name_length = enc.GetByteCount (key); int value_length = enc.GetByteCount (value); total_size += name_length > 0x7F ? 4 : 1; total_size += value_length > 0x7F ? 4 : 1; total_size += name_length + value_length; } var data = new byte [total_size]; // Fill the data array with the data. int index = 0; foreach (string key in pairs.Keys) { string value = pairs [key]; int name_length = enc.GetByteCount (key); int value_length = enc.GetByteCount (value); WriteLength (data, ref index, name_length); WriteLength (data, ref index, value_length); index += enc.GetBytes (key, 0, key.Length, data, index); index += enc.GetBytes (value, 0, value.Length, data, index); } return data; } #endregion #region Private Static Methods static int ReadLength (IReadOnlyList data, ref int index) { if (index < 0) throw new ArgumentOutOfRangeException ("index"); if (index >= data.Count) throw new ArgumentOutOfRangeException ("index"); // Lengths are stored in either 1 or 4 bytes. For // lengths under 128 bytes, which are the most common, a // single byte is used. if (data [index] < 0x80) return data [index++]; // If the MSB for the size byte is set (value >= 0x80), // a 4 byte value is used. However, the MSB in the first // byte is not included, as it was used as an indicator. if (index > data.Count - 4) throw new ArgumentOutOfRangeException ("index"); return (0x7F & data [index++]) * 0x1000000 + data [index++] * 0x10000 + data [index++] *0x100 + data [index++]; // TODO: Returns zero. What gives? //return (0x7F & (int) data [index++]) << 24 // + ((int) data [index++]) << 16 // + ((int) data [index++]) << 8 // + ((int) data [index++]); } static void WriteLength (byte [] data, ref int index, int length) { if (length < 0) throw new ArgumentException ( Strings.NameValuePair_LengthLessThanZero, "length"); if (index < 0 || index > data.Length - (length < 0x80 ? 1 : 4)) throw new ArgumentOutOfRangeException ("index"); if (length < 0x80) { data [index++] = (byte) length; return; } data [index++] = (byte)(((length & 0x7F000000) >> 24) | 0x80); data [index++] = (byte) ((length & 0xFF0000) >> 16); data [index++] = (byte) ((length & 0xFF00) >> 8); data [index++] = (byte) (length & 0xFF); } #endregion } }xsp-4.2/src/Mono.WebServer.FastCgi/BufferManager.cs0000664000175000017500000000503612627046413017101 00000000000000// // BufferManager.cs // // Author: // Leonardo Taglialegne // // Copyright (C) 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.WebServer.FastCgi.Compatibility; namespace Mono.WebServer.FastCgi { public class BufferManager { const int CLIENTS_PER_BUFFER = 100; readonly int segmentSize; /// /// The size of a complete buffer. /// Warning: the code assumes this to be an exact multiple of /// readonly int bufferSize; readonly object bufferLock = new object (); readonly Stack> buffers = new Stack>(); public BufferManager (int segmentSize) { if (segmentSize < 0) throw new ArgumentOutOfRangeException ("segmentSize", segmentSize, "Should be positive"); this.segmentSize = segmentSize; bufferSize = CLIENTS_PER_BUFFER * this.segmentSize; } public void ReturnBuffer(CompatArraySegment buffer) { lock (bufferLock) { buffers.Push(buffer); // TODO: if we have enough buffers we could release some } } void Expand () { var toadd = new byte[bufferSize]; for (int i = 0; i < bufferSize; i += segmentSize) buffers.Push (new CompatArraySegment (toadd, i, segmentSize)); } public CompatArraySegment ClaimBuffer () { lock (bufferLock) { if (buffers.Count < 1) { Expand(); } return buffers.Pop(); } } } } xsp-4.2/src/Mono.WebServer.FastCgi/ApplicationHost.cs0000664000175000017500000001470112627046413017475 00000000000000// // ApplicationHost.cs: Hosts ASP.NET applications in their own AppDomain. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Text; using System.Web; using System.Web.Hosting; using IOPath = System.IO.Path; namespace Mono.WebServer.FastCgi { public class ApplicationHost : BaseApplicationHost { public void ProcessRequest (Responder responder) { var worker = new WorkerRequest (responder, this); string path = responder.Path; if (!String.IsNullOrEmpty(path) && path [path.Length - 1] != '/' && VirtualDirectoryExists (path, worker)) { Redirect (worker, path + '/'); return; } ProcessRequest (worker); } const string CONTENT301 = "\n" + "\n301 Moved Permanently\n\n" + "

Moved Permanently

\n" + "

The document has moved to http://{0}{1}.

\n" + "\n"; static void Redirect (HttpWorkerRequest wr, string location) { string host = wr.GetKnownRequestHeader (HttpWorkerRequest.HeaderHost); wr.SendStatus (301, "Moved Permanently"); wr.SendUnknownResponseHeader ("Connection", "close"); wr.SendUnknownResponseHeader ("Date", DateTime.Now.ToUniversalTime ().ToString ("r")); wr.SendUnknownResponseHeader ("Location", String.Format ("http://{0}{1}", host, location)); Encoding enc = Encoding.ASCII; wr.SendUnknownResponseHeader ("Content-Type", "text/html; charset=" + enc.WebName); string content = String.Format (CONTENT301, host, location); byte [] contentBytes = enc.GetBytes (content); wr.SendUnknownResponseHeader ("Content-Length", contentBytes.Length.ToString ()); wr.SendResponseFromMemory (contentBytes, contentBytes.Length); wr.FlushResponse (true); wr.CloseConnection (); } public void GetPathsFromUri (string verb, string uri, out string realUri, out string pathInfo) { Paths.GetPathsFromUri (this, verb, uri, out realUri, out pathInfo); } public string MapPath (string virtualPath) { string physPath = HostingEnvironment.MapPath ((String.IsNullOrEmpty(virtualPath) || virtualPath.TrimStart().Length == 0) ? "/" : virtualPath); if (!String.IsNullOrEmpty(physPath)) return physPath; // For old .NET 1.x, and as a fallback mechanism until Mono's // HostingEnvironment.MapPath method can perform the mapping // without requiring an HttpContext.Current.Request object // (the MS one can do it), just map the path somewhat similar // to the Mono.WebServer.MonoWorkerRequest.MapPath method (but // unfortunately without the customizable event mechanism)... // TODO: Remove the logic below for NET_2_0 as soon as Mono's // DefaultVirtualPathProvider.MapPath method works properly (and then also // remove the workarounds in ApplicationHost.VirtualFileExists and // ApplicationHost.VirtualDirectoryExists) if (String.IsNullOrEmpty(virtualPath) || virtualPath == VPath) { if (IOPath.DirectorySeparatorChar != '/') return Path.Replace ('/', IOPath.DirectorySeparatorChar); return Path; } physPath = virtualPath; if (physPath[0] == '~' && physPath.Length > 2 && physPath[1] == '/') physPath = physPath.Substring (1); int len = VPath.Length; if (physPath.StartsWith (VPath) && (physPath.Length == len || physPath[len] == '/')) physPath = physPath.Substring (len + 1); int i = 0; len = physPath.Length; while (i < len && physPath [i] == '/') i++; if (i < len) physPath = physPath.Substring (i); else return Path; if (IOPath.DirectorySeparatorChar != '/') physPath = physPath.Replace ('/', IOPath.DirectorySeparatorChar); return IOPath.Combine (Path, physPath); } public bool VirtualFileExists (string virtualPath) { VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider; // TODO: Remove the second condition of the "if" statement (it is only a workaround) involving DefaultVirtualPathProvider as soon as Mono's DefaultVirtualPathProvider.FileExists method works properly (i.e., the indirectly-called HostingEnvironment.MapPath method should not require an HttpContext.Current.Request object to do its work; also see the comment in the ApplicationHost.MapPath method above) if (vpp != null && !vpp.GetType().FullName.Equals("System.Web.Hosting.DefaultVirtualPathProvider", StringComparison.Ordinal)) return vpp.FileExists (virtualPath); return File.Exists (MapPath (virtualPath)); } bool VirtualDirectoryExists (string virtualPath, HttpWorkerRequest worker) { VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider; // TODO: Remove the second condition of the "if" statement (it is only a workaround) involving DefaultVirtualPathProvider as soon as Mono's DefaultVirtualPathProvider.DirectoryExists method works properly (i.e., the indirectly-called HostingEnvironment.MapPath method should not require an HttpContext.Current.Request object to do its work; also see the comment in the ApplicationHost.MapPath method above) if (vpp != null && !vpp.GetType().FullName.Equals("System.Web.Hosting.DefaultVirtualPathProvider", StringComparison.Ordinal)) return vpp.DirectoryExists (virtualPath); string physicalPath = (worker != null) ? worker.MapPath (virtualPath) : MapPath (virtualPath); return Directory.Exists (physicalPath); } } } xsp-4.2/src/Mono.WebServer.FastCgi/ConfigurationManager.cs0000664000175000017500000001052212627046413020473 00000000000000// // ConfigurationManager.cs: Generic multi-source configuration manager. // // Author: // Leonardo Taglialegne // // Copyright (C) 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.WebServer.Options.Settings; using Mono.WebServer.Options; namespace Mono.WebServer.FastCgi { public partial class ConfigurationManager { public ConfigurationManager (string name) : base (name) { Add(stoppable, multiplex, onDemand, maxConns, maxReqs, port, idleTime, filename, socket, onDemandSock); } #region Backing fields readonly BoolSetting stoppable = new BoolSetting ("stoppable", Descriptions.Stoppable); readonly BoolSetting multiplex = new BoolSetting ("multiplex", "Allows multiple requests to be send over a single connection.", "FastCgiMultiplexConnections", "MONO_FCGI_MULTIPLEX"); readonly BoolSetting onDemand = new BoolSetting ("ondemand", "Listen on the socket specified via /ondemandsock and accepts via sendmsg(2). Terminates after it receives no requests for some time"); readonly UInt16Setting maxConns = new UInt16Setting ("maxconns", Descriptions.MaxConns, "FastCgiMaxConnections", "MONO_FCGI_MAXCONNS", 1024); readonly UInt16Setting maxReqs = new UInt16Setting ("maxreqs", "Specifies the maximum number of concurrent requests the server should accept.", "FastCgiMaxRequests", "MONO_FCGI_MAXREQS", 1024); readonly UInt16Setting port = new UInt16Setting ("port", Descriptions.Port, "MonoServerPort", "MONO_FCGI_PORT", 9000); readonly UInt16Setting idleTime = new UInt16Setting ("idle-time", "Time to wait (in seconds) before stopping if --ondemand is set", defaultValue: 60); readonly StringSetting filename = new StringSetting ("filename", "Specifies a unix socket filename to listen on.\n" + "To use this argument, \"socket\" must be set to \"unix\".", "MonoUnixSocket", "MONO_FCGI_FILENAME", "/tmp/fastcgi-mono-server"); readonly StringSetting socket = new StringSetting ("socket", Descriptions.Socket, "MonoSocketType", "MONO_FCGI_SOCKET", "pipe"); readonly StringSetting onDemandSock = new StringSetting ("ondemandsock", "The socket to listen on for ondemand service"); #endregion #region Typesafe properties public bool Stoppable { get { return stoppable; } } public bool Multiplex { get { return multiplex; } } public bool OnDemand { get { return onDemand; } } public ushort MaxConns { get { return maxConns; } } public ushort MaxReqs { get { return maxReqs; } } public ushort Port { get { return port; } } public ushort IdleTime { get { return idleTime; } } public string Filename { get { return filename; } } public string Socket { get { return socket; } } public string OnDemandSock { get { return onDemandSock; } } /* * * * Automatically registers applications as they are * encountered, provided pages exist in standard * locations. * * */ #endregion public override string ProgramName { get { return "mono-fastcgi"; } } public override string Description { get { return "A FastCgi interface for ASP.NET applications."; } } } } xsp-4.2/src/Mono.WebServer.FastCgi/DictionaryExtensions.cs0000664000175000017500000000352712627046413020565 00000000000000// // DictionaryExtensions.cs // // Author: // Leonardo Taglialegne // // Copyright (C) 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Collections.Generic; namespace Mono.WebServer.FastCgi { public static class DictionaryExtensions { /// /// Adds the key/value pair or replaces the value if the key is present. /// /// true, if the key was added, false otherwise. /// public static bool AddOrReplace ( this IDictionary dictionary, TKey key, TValue value) { if (dictionary.ContainsKey (key)) { dictionary [key] = value; return false; } dictionary.Add (key, value); return true; } } } xsp-4.2/src/Mono.WebServer.FastCgi/Buffers.cs0000664000175000017500000001005612627046413015767 00000000000000// // Buffers.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.FastCgi.Compatibility; namespace Mono.WebServer.FastCgi { public class Buffers { public CompatArraySegment? Header { get; private set; } public CompatArraySegment? Body { get; private set; } public CompatArraySegment? Padding { get; private set; } readonly BufferManager bigBufferManager; readonly BufferManager smallBufferManager; public Buffers () { } public Buffers (BufferManager bigBufferManager, BufferManager smallBufferManager) { if (bigBufferManager == null) throw new ArgumentNullException ("bigBufferManager"); if (smallBufferManager == null) throw new ArgumentNullException ("smallBufferManager"); this.bigBufferManager = bigBufferManager; this.smallBufferManager = smallBufferManager; Header = smallBufferManager.ClaimBuffer (); Body = bigBufferManager.ClaimBuffer (); Padding = smallBufferManager.ClaimBuffer (); } public Buffers (byte[] buffer, int headerSize, int bodySize) { Header = MaybeSegment (buffer, 0, headerSize); Body = MaybeSegment (buffer, headerSize, bodySize); Padding = MaybeSegment (buffer, headerSize + bodySize); } public CompatArraySegment EnforceHeaderLength (int length) { if (Header == null || Header.Value.Count < length) { if (Header != null) smallBufferManager.ReturnBuffer (Header.Value); Header = new CompatArraySegment (new byte[length]); } return Header.Value; } public CompatArraySegment EnforceBodyLength (int length) { if (Body == null || Body.Value.Count < length) { if (Body != null) bigBufferManager.ReturnBuffer (Body.Value); Body = new CompatArraySegment (new byte[length]); } return Body.Value; } public CompatArraySegment EnforcePaddingLength (int length) { if (Padding == null || Padding.Value.Count < length) { if (Padding != null) smallBufferManager.ReturnBuffer (Padding.Value); Padding = new CompatArraySegment (new byte[length]); } return Padding.Value; } static CompatArraySegment? MaybeSegment (byte[] buffer, int offset) { return buffer == null ? null : MaybeSegment (buffer, offset, buffer.Length - offset); } static CompatArraySegment? MaybeSegment (byte[] buffer, int offset, int count) { if (buffer == null || offset < 0 || count < 0 || offset + count > buffer.Length) return null; return new CompatArraySegment (buffer, offset, count); } public void Return () { if (smallBufferManager != null) { if (Header != null) { smallBufferManager.ReturnBuffer (Header.Value); Header = null; } if (Padding != null) { smallBufferManager.ReturnBuffer (Padding.Value); Padding = null; } } if (bigBufferManager == null || Body == null) return; bigBufferManager.ReturnBuffer (Body.Value); Body = null; } } } xsp-4.2/src/Mono.WebServer.FastCgi/ResponderRequest.cs0000664000175000017500000000730012627046413017703 00000000000000// // Requests/ResponderRequest.cs: Handles FastCGI requests for a responder. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Globalization; using System.Threading; using Mono.WebServer.FastCgi; namespace Mono.FastCgi { public class ResponderRequest : Request { #region Private Fields byte [] input_data; int write_index; readonly IResponder responder; #endregion #region Constructors public ResponderRequest (ushort requestID, Connection connection) : base (requestID, connection) { if (!Server.SupportsResponder) throw new Exception (); responder = Server.CreateResponder (this); InputDataReceived += OnInputDataReceived; } #endregion #region Public Properties public byte [] InputData { get {return input_data ?? new byte [0];} } #endregion #region Private Methods void OnInputDataReceived (Request sender, DataReceivedArgs args) { // If the data is completed, call the worker and return. if (args.DataCompleted) { DataNeeded = false; if (input_data != null && write_index < input_data.Length) { Abort (Strings.ResponderRequest_IncompleteInput, write_index, input_data.Length); } else if (Server.MultiplexConnections) ThreadPool.QueueUserWorkItem (Worker); else Worker (null); return; } // If input_data is null, create the new array by // reading the length from the CONTENT_LENGTH parameter. if (input_data == null) { string length_text = GetParameter ("CONTENT_LENGTH"); // If the field is missing we can't continue. if (length_text == null) { Abort (Strings.ResponderRequest_NoContentLength); return; } // If the length isn't a number, we can't // continue. int length; if(!Int32.TryParse (length_text, NumberStyles.Integer, CultureInfo.InvariantCulture, out length)){ Abort (Strings.ResponderRequest_NoContentLengthNotNumber); return; } input_data = new byte [length]; } if (write_index + args.DataLength > input_data.Length) { Abort (Strings.ResponderRequest_ContentExceedsLength); return; } args.CopyTo (input_data, write_index); write_index += args.DataLength; } void Worker (object state) { int appStatus = responder.Process (); if (appStatus != Int32.MinValue) CompleteRequest (appStatus, ProtocolStatus.RequestComplete); } #endregion } public interface IResponder { ResponderRequest Request {get;} int Process (); } }xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/0000775000175000017500000000000012627055647015546 500000000000000xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/UnixSocket.cs0000664000175000017500000000724412627046413020107 00000000000000// // UnixSocket.cs: Provides a wrapper around a unix domain socket file. // // Authors: // Brian Nickel (brian.nickel@gmail.com) // Andres G. Aragoneses (andres@7digital.com) // // Copyright (C) 2007 Brian Nickel // Copyright (C) 2013 7digital Media Ltd (http://www.7digital.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Unix; using System.Globalization; using Mono.WebServer.Log; using Mono.Unix.Native; using System.Net; namespace Mono.WebServer.FastCgi.Sockets { class UnixSocket : StandardSocket, IDisposable { string path; long? inode; readonly uint? permissions; protected UnixSocket (EndPoint localEndPoint) : base (System.Net.Sockets.AddressFamily.Unix, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.IP, localEndPoint) { } public UnixSocket (string path, uint? permissions = null) : this (CreateEndPoint (path)) { if (path == null) throw new ArgumentNullException ("path"); this.path = path; this.permissions = permissions; } public override void Listen (int backlog) { base.Listen (backlog); try { if (path.StartsWith("\0", StringComparison.Ordinal)) inode = null; else { var info = new UnixFileInfo (path); inode = info.Inode; if (permissions != null) Syscall.chmod (path, NativeConvert.ToFilePermissions (permissions.Value)); } } catch (InvalidOperationException e) { Logger.Write (LogLevel.Error, e.Message); Logger.Write (LogLevel.Error, "Path \"{0}\" doesn't exist?", path); throw; } } protected static UnixEndPoint CreateEndPoint (string path) { if (path == null) throw new ArgumentNullException ("path"); var ep = new UnixEndPoint (path); if (System.IO.File.Exists (path)) { var conn = new System.Net.Sockets.Socket ( System.Net.Sockets.AddressFamily.Unix, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.IP); try { conn.Connect (ep); conn.Close (); throw new InvalidOperationException ( String.Format (CultureInfo.CurrentCulture, Strings.UnixSocket_AlreadyExists, path)); } catch (System.Net.Sockets.SocketException) { } System.IO.File.Delete (path); } return ep; } public override string ToString () { return string.Format ("[UnixSocket] {0}", path); } public void Dispose () { if (path != null) { string f = path; path = null; if (inode.HasValue && System.IO.File.Exists (f) && inode.Value == new UnixFileInfo (f).Inode) { System.IO.File.Delete (f); } } } ~UnixSocket () { Dispose (); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/TcpSocket.cs0000664000175000017500000000335212627046413017706 00000000000000// // SocketAbstractions/TcpSocket.cs: Provides support for bound TCP sockets. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.FastCgi.Sockets { class TcpSocket : StandardSocket { public TcpSocket (System.Net.IPEndPoint localEndPoint) : base (System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.IP, localEndPoint) { } public TcpSocket (System.Net.IPAddress address, int port) : this (new System.Net.IPEndPoint (Equals(address, System.Net.IPAddress.Any) ? System.Net.IPAddress.Loopback : address, port)) { } } }xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/UnmanagedSocket.cs0000664000175000017500000001775112627046413021067 00000000000000// // SocketAbstractions/UnmanagedSocket.cs: Provides a wrapper around an unmanaged // socket. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.Unix.Native; using System.IO; using System.Runtime.InteropServices; using System.Threading; using Socket = Mono.FastCgi.Socket; namespace Mono.WebServer.FastCgi.Sockets { class UnmanagedSocket : Socket { [DllImport ("libc", SetLastError=true, EntryPoint="close")] extern static int close (IntPtr s); readonly IntPtr socket; bool connected; public override IntPtr Handle { get { return socket; } } unsafe public UnmanagedSocket (IntPtr socket) { if (!supports_libc) throw new NotSupportedException (Strings.UnmanagedSocket_NotSupported); if ((int) socket < 0) throw new ArgumentException ("Invalid socket.", "socket"); var address = new byte [1024]; int size = 1024; fixed (byte* ptr = address) if (getsockname (socket, ptr, ref size) != 0) throw GetException (); this.socket = socket; } unsafe public UnmanagedSocket (IntPtr socket, bool connected) { if (!supports_libc) throw new NotSupportedException (Strings.UnmanagedSocket_NotSupported); if ((int) socket < 0) throw new ArgumentException ("Invalid socket.", "socket"); var address = new byte [1024]; int size = 1024; fixed (byte* ptr = address) if (getsockname (socket, ptr, ref size) != 0) throw GetException (); this.socket = socket; this.connected = connected; } public override void Connect () { throw new NotSupportedException (); } public override void Close () { connected = false; if (shutdown (socket, (int) System.Net.Sockets.SocketShutdown.Both) != 0) throw GetException (); /* lighttpd makes the assumption that the FastCGI handler will close the unix socket */ close(socket); } unsafe public override int Receive (byte [] buffer, int offset, int size, System.Net.Sockets.SocketFlags flags) { if (!connected) return 0; int value; fixed (byte* ptr = buffer) value = recv (socket, ptr + offset, size, (int) flags); if (value >= 0) return value; connected = false; throw GetException (); } unsafe public override int Send (byte [] data, int offset, int size, System.Net.Sockets.SocketFlags flags) { if (!connected) return 0; int value; fixed (byte* ptr = data) value = send (socket, ptr + offset, size, (int) flags); if (value >= 0) return value; connected = false; throw GetException (); } public override void Listen (int backlog) { listen (socket, backlog); } public override IAsyncResult BeginAccept (AsyncCallback callback, object state) { var s = new SockAccept (socket, callback, state); ThreadPool.QueueUserWorkItem (s.Run); return s; } public override Socket EndAccept (IAsyncResult asyncResult) { if (asyncResult == null) throw new ArgumentNullException ("asyncResult"); var s = asyncResult as SockAccept; if (s == null || s.Socket != socket) throw new ArgumentException ( "Result was not produced by current instance.", "asyncResult"); if (!s.IsCompleted) s.AsyncWaitHandle.WaitOne (); if (s.Except != null) throw s.Except; return new UnmanagedSocket (s.Accepted) {connected = true}; } public override bool Connected { get {return connected;} } [DllImport ("libc", SetLastError=true, EntryPoint="shutdown")] extern static int shutdown (IntPtr s, int how); [DllImport ("libc", SetLastError=true, EntryPoint="send")] unsafe extern static int send (IntPtr s, byte *buffer, int len, int flags); [DllImport ("libc", SetLastError=true, EntryPoint="recv")] unsafe extern static int recv (IntPtr s, byte *buffer, int len, int flags); [DllImport ("libc", SetLastError=true, EntryPoint="accept")] unsafe extern static IntPtr accept (IntPtr s, byte *addr, ref int addrlen); [DllImport("libc", SetLastError=true, EntryPoint="getsockname")] unsafe static extern int getsockname(IntPtr s, byte *addr, ref int namelen); [DllImport ("libc", SetLastError=true, EntryPoint="listen")] extern static int listen (IntPtr s, int count); class SockAccept : IAsyncResult { bool completed; readonly object waithandle_lock = new object (); ManualResetEvent waithandle; readonly AsyncCallback callback; readonly object state; public readonly IntPtr Socket; public IntPtr Accepted; public System.Net.Sockets.SocketException Except; public SockAccept (IntPtr socket, AsyncCallback callback, object state) { Socket = socket; this.callback = callback; this.state = state; } unsafe public void Run (object state) { var address = new byte [1024]; int size = 1024; Errno errno; fixed (byte* ptr = address) do { Accepted = accept (Socket, ptr, ref size); errno = Stdlib.GetLastError (); } while ((int) Accepted == -1 && errno == Errno.EINTR); if ((int) Accepted == -1) Except = GetException (errno); completed = true; if (waithandle != null) waithandle.Set (); if (callback != null) callback (this); } public bool IsCompleted { get {return completed;} } public bool CompletedSynchronously { get {return false;} } public WaitHandle AsyncWaitHandle { get { lock (waithandle_lock) if (waithandle == null) waithandle = new ManualResetEvent (completed); return waithandle; } } public object AsyncState { get {return state;} } } static readonly bool supports_libc; static UnmanagedSocket () { try { string os = File.ReadAllText("/proc/sys/kernel/ostype"); supports_libc = os.StartsWith ("Linux"); } catch { } } static System.Net.Sockets.SocketException GetException () { return GetException (Stdlib.GetLastError ()); } static System.Net.Sockets.SocketException GetException (Errno error) { if (error == Errno.EAGAIN || error == Errno.EWOULDBLOCK) // WSAEWOULDBLOCK return new System.Net.Sockets.SocketException (10035); if (error == Errno.EBADF || error == Errno.ENOTSOCK) // WSAENOTSOCK return new System.Net.Sockets.SocketException (10038); if (error == Errno.ECONNABORTED) // WSAENETDOWN return new System.Net.Sockets.SocketException (10050); if (error == Errno.EINVAL) // WSAEINVAL return new System.Net.Sockets.SocketException (10022); return new System.Net.Sockets.SocketException (); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/Socket.cs0000664000175000017500000000354512627046413017243 00000000000000// // SocketAbstractions/Socket.cs: Abstracts socket operations. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.FastCgi { public abstract class Socket { public abstract IntPtr Handle { get; } public abstract void Connect (); public abstract void Close (); public abstract int Receive (byte [] buffer, int offset, int size, System.Net.Sockets.SocketFlags flags); public abstract int Send (byte [] data, int offset, int size, System.Net.Sockets.SocketFlags flags); public abstract void Listen (int backlog); public abstract IAsyncResult BeginAccept (AsyncCallback callback, object state); public abstract Socket EndAccept (IAsyncResult asyncResult); public abstract bool Connected {get;} } }xsp-4.2/src/Mono.WebServer.FastCgi/Sockets/StandardSocket.cs0000664000175000017500000001126012627046413020715 00000000000000// // SocketAbstractions/StandardSocket.cs: Provides a wrapper around a standard // .NET socket. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.FastCgi; namespace Mono.WebServer.FastCgi.Sockets { class StandardSocket : Socket { readonly System.Net.Sockets.Socket socket; readonly System.Net.EndPoint localEndPoint; public override IntPtr Handle { get { return socket.Handle; } } public StandardSocket (System.Net.Sockets.Socket socket) { if (socket == null) throw new ArgumentNullException ("socket"); this.socket = socket; } public StandardSocket (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.EndPoint localEndPoint) { if (localEndPoint == null) throw new ArgumentNullException ("localEndPoint"); socket = new System.Net.Sockets.Socket (addressFamily, socketType, protocolType); this.localEndPoint = localEndPoint; } public override void Connect () { socket.Connect (localEndPoint); } public override void Close () { // Make sure that all remaining data are sent and received // before closing; For example, this ensures that all queued // FCGI_STDOUT stream data are sent to the web server for // forwarding to the web client and also that any lingering // FCGI_END_REQUEST response is indeed sent to the web server try { socket.Shutdown(System.Net.Sockets.SocketShutdown.Both); } catch (System.Net.Sockets.SocketException) { // Ignore } // Only now close the socket socket.Close (); } public override int Receive (byte [] buffer, int offset, int size, System.Net.Sockets.SocketFlags flags) { // According to the MSDN specification, a call to Sockets.Socket.Receive // (http://msdn.microsoft.com/en-us/library/8s4y8aff.aspx) will return // 0 immediately, if the remote end has read all incoming data and // gracefully closed the connection. // // As all calls to this function are synchronous in the current FastCGI // implementation, we can safely assume that a Receive of 0 bytes would // only arise in this case. // All other errors are expected to throw an exception. int received = socket.Receive(buffer, offset, size, flags); if (received == 0) { // Note: a better error message would probably be deemed fit. socket.Close(); throw new System.Net.Sockets.SocketException(); } return received; } public override int Send (byte [] data, int offset, int size, System.Net.Sockets.SocketFlags flags) { return socket.Send (data, offset, size, flags); } public override void Listen (int backlog) { socket.Bind (localEndPoint); socket.Listen (backlog); } public override IAsyncResult BeginAccept (AsyncCallback callback, object state) { return socket.BeginAccept (callback, state); } public override Socket EndAccept (IAsyncResult asyncResult) { return new StandardSocket (socket.EndAccept (asyncResult)); } public override bool Connected { get {return socket.Connected;} } } } xsp-4.2/src/Mono.WebServer.FastCgi/RecordType.cs0000664000175000017500000000301612627046413016451 00000000000000// // RecordType.cs // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.FastCgi { public enum RecordType : byte { None = 0, BeginRequest = 1, AbortRequest = 2, EndRequest = 3, Params = 4, StandardInput = 5, StandardOutput = 6, StandardError = 7, Data = 8, GetValues = 9, GetValuesResult = 10, UnknownType = 11 } } xsp-4.2/src/Mono.WebServer.FastCgi/ConfigurationManager.Obsolete.cs0000664000175000017500000000346012627046413022251 00000000000000// // ConfigurationManager.cs: Generic multi-source configuration manager. // // Author: // Brian Nickel (brian.nickel@gmail.com) // Robert Jordan // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.Options.Settings; using Mono.WebServer.Options; namespace Mono.WebServer.FastCgi { public partial class ConfigurationManager : ServerConfigurationManager { [Obsolete] internal void SetValue (string name, object value) { Settings[name].MaybeParseUpdate (SettingSource.CommandLine, value.ToString ()); } [Obsolete] internal ISetting GetSetting (string name) { return Settings [name]; } [Obsolete] internal bool Contains (string name) { return Settings.Contains (name); } } } xsp-4.2/src/Mono.WebServer.FastCgi/AssemblyInfo.cs.in0000664000175000017500000000042112627046413017366 00000000000000using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("@XSP_VERSION@")] [assembly: AssemblyTitle("Mono.WebServer.FastCGI")] [assembly: AssemblyDescription("FastCGI Backend for XSP")] [assembly: AssemblyCopyright("2007 Brian Nickel")] xsp-4.2/src/Mono.WebServer.FastCgi/Record.cs0000664000175000017500000001346412627046413015617 00000000000000// // Record.cs // // Author: // Brian Nickel (brian.nickel@gmail.com) // Leonardo Taglialegne // // Copyright (C) 2007 Brian Nickel // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Globalization; using Mono.WebServer.Log; using Mono.FastCgi; using Mono.WebServer.FastCgi.Compatibility; namespace Mono.WebServer.FastCgi { struct Record { public readonly byte Version; public readonly RecordType Type; public readonly ushort RequestID; public readonly ushort BodyLength; public readonly Buffers Content; public const int HEADER_SIZE = 8; public Record (byte version, RecordType type, ushort requestID, int bodyLength, Buffers buffers) : this() { Version = version; Type = type; RequestID = requestID; BodyLength = (ushort) bodyLength; Content = buffers; } public static Record Receive (Socket socket, Buffers buffers) { if (socket == null) throw new ArgumentNullException ("socket"); CompatArraySegment header_buffer = buffers.EnforceHeaderLength (HEADER_SIZE); // Read the 8 byte record header. ReceiveAll (socket, header_buffer, HEADER_SIZE); // Read the values from the data. var version = header_buffer [0]; var type = (RecordType) header_buffer [1]; var requestID = ReadUInt16 (header_buffer, 2); var bodyLength = ReadUInt16 (header_buffer, 4); byte padding_length = header_buffer [6]; CompatArraySegment body_buffer = buffers.EnforceBodyLength (bodyLength); // Read the record data, and throw an exception if the // complete data cannot be read. if (bodyLength > 0) ReceiveAll (socket, body_buffer, bodyLength); CompatArraySegment padding_buffer = buffers.EnforcePaddingLength (padding_length); if(padding_length > 0) ReceiveAll(socket, padding_buffer, padding_length); Logger.Write (LogLevel.Debug, Strings.Record_Received, type, requestID, bodyLength); return new Record (version, type, requestID, bodyLength, buffers); } public void Send (Socket socket) { var padding_size = (byte) ((8 - (BodyLength % 8)) % 8); CompatArraySegment header = Content.EnforceHeaderLength (HEADER_SIZE); header [0] = Version; header [1] = (byte) Type; header [2] = (byte) (RequestID >> 8); header [3] = (byte) (RequestID & 0xFF); header [4] = (byte) (BodyLength >> 8); header [5] = (byte) (BodyLength & 0xFF); header [6] = padding_size; CompatArraySegment padding = Content.EnforcePaddingLength (padding_size); for (int i = 0; i < padding_size; i ++) padding [i] = 0; Logger.Write (LogLevel.Debug, Strings.Record_Sent, Type, RequestID, BodyLength); SendAll (socket, header, HEADER_SIZE); SendAll (socket, Content.Body, BodyLength); SendAll (socket, padding, padding_size); } [Obsolete] public static explicit operator Record (Mono.FastCgi.Record source) { return new Record (source.Version, source.Type, source.RequestID, source.BodyLength, source.GetBuffers ()); } public IReadOnlyList GetBody () { if (Content.Body == null) return null; return Content.Body.Value.Trimmed (BodyLength); } [Obsolete] public void CopyTo (byte[] dest, int destIndex) { if (dest == null) throw new ArgumentNullException ("dest"); if (BodyLength > dest.Length - destIndex) throw new ArgumentOutOfRangeException ("destIndex"); if (Content.Body.HasValue) Content.Body.Value.CopyTo (dest, destIndex, BodyLength); } public override string ToString () { return String.Format (CultureInfo.CurrentCulture, Strings.Record_ToString, Version, Type, RequestID, BodyLength); } static internal Role ReadRole(IReadOnlyList array){ return (Role)ReadUInt16 (array, 0); } static internal ushort ReadUInt16 (IReadOnlyList array, int arrayIndex) { ushort value = array [arrayIndex]; value = (ushort) (value << 8); value += array [arrayIndex + 1]; return value; } internal static void SendAll (Socket socket, CompatArraySegment? data, int length) { if (length <= 0 || data == null) return; int total = 0; while (total < length) { total += socket.Send (data.Value.Array, data.Value.Offset + total, length - total, System.Net.Sockets.SocketFlags.None); } } internal static void ReceiveAll (Socket socket, CompatArraySegment data, int length) { if (length <= 0) return; int total = 0; while (total < length) { total += socket.Receive (data.Array, total + data.Offset, length - total, System.Net.Sockets.SocketFlags.None); } } } } xsp-4.2/src/Mono.WebServer.FastCgi/Connection.cs0000664000175000017500000002564012627046413016477 00000000000000// // Connection.cs: Handles a FastCGI connection. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.WebServer.Log; using Mono.WebServer.FastCgi; using NRecord = Mono.WebServer.FastCgi.Record; using Mono.WebServer.FastCgi.Compatibility; namespace Mono.FastCgi { public class Connection { #region Private Fields readonly List requests = new List (); Socket socket; readonly Server server; bool keep_alive; bool stop; readonly object request_lock = new object (); readonly object send_lock = new object (); readonly Buffers receive_buffers; readonly Buffers send_buffers; readonly object connection_teardown_lock = new object (); #endregion #region Constructors public Connection (Socket socket, Server server) { if (socket == null) throw new ArgumentNullException ("socket"); if (server == null) throw new ArgumentNullException ("server"); this.socket = socket; this.server = server; receive_buffers = new Buffers(server.BigBufferManager, server.SmallBufferManager); send_buffers = new Buffers (server.BigBufferManager, server.SmallBufferManager); } #endregion #region Public Properties public event EventHandler RequestReceived; public int RequestCount { get {return requests.Count;} } public bool IsConnected { get { if (socket == null) return false; return socket.Connected; } } public Server Server { get {return server;} } #endregion #region Public Methods public void Run () { Logger.Write (LogLevel.Debug, Strings.Connection_BeginningRun); if (socket == null) { Logger.Write (LogLevel.Notice, Strings.Connection_NoSocketInRun); return; } do { NRecord record; try { record = NRecord.Receive(socket, receive_buffers); } catch (System.Net.Sockets.SocketException) { StopRun (Strings.Connection_RecordNotReceived); Stop (); break; } Request request = GetRequest (record.RequestID); try { if (RequestReceived != null) RequestReceived.BeginInvoke (this, EventArgs.Empty, null, null); } catch(Exception e) { // We don't care if the event handler has problems Logger.Write(LogLevel.Error, "Error while invoking RequestReceived event:"); Logger.Write(e); } Logger.Write(LogLevel.Debug, "Now handling record (with type {0})", record.Type); HandleRequest (record, request); } while (!stop && (UnfinishedRequests || keep_alive)); if (requests.Count == 0) { lock (connection_teardown_lock) { CloseSocket(); if (!stop) server.EndConnection (this); send_buffers.Return (); receive_buffers.Return (); } } Logger.Write (LogLevel.Debug, Strings.Connection_EndingRun); } void CloseSocket () { try { if (socket != null) socket.Close (); } catch (System.Net.Sockets.SocketException e) { // Ignore: "The descriptor is not a socket" // error from UnmanagedSocket.Close if (e.ErrorCode != 10038) throw; // Rethrow other errors } catch (ObjectDisposedException){ // Ignore: already closed } finally { socket = null; } } void HandleRequest (NRecord record, Request request) { switch (record.Type) { // Creates a new request. case RecordType.BeginRequest: HandleBeginRequest (request, record); break; // Gets server values. case RecordType.GetValues: HandleGetValues (record); break; // Sends params to the request. case RecordType.Params: HandleParams (request, record); break; // Sends standard input to the request. case RecordType.StandardInput: HandleStandardInput (request, record); break; // Sends file data to the request. case RecordType.Data: HandleData (request, record); break; // Aborts a request when the server aborts. case RecordType.AbortRequest: HandleAbortRequest (request); break; // Informs the client that the record type is // unknown. default: HandleUnknown (record); break; } } void HandleUnknown (NRecord record) { Logger.Write (LogLevel.Warning, Strings.Connection_UnknownRecordType, record.Type); SendRecord (RecordType.UnknownType, record.RequestID, new UnknownTypeBody (record.Type).GetData ()); } static void HandleAbortRequest (Request request) { if (request == null) return; request.Abort (Strings.Connection_AbortRecordReceived); } void HandleData (Request request, NRecord record) { if (request == null) { StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID); return; } request.AddFileData (record); } void HandleStandardInput (Request request, NRecord record) { if (request == null) { StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID); return; } request.AddInputData (record); } void HandleParams (Request request, NRecord record) { if (request == null) { StopRun (Strings.Connection_RequestDoesNotExist, record.RequestID); return; } IReadOnlyList body = record.GetBody (); request.AddParameterData (body); } void HandleGetValues (NRecord record) { byte[] response_data; // Look up the data from the server. try { IReadOnlyList body = record.GetBody (); IDictionary pairs_in = NameValuePair.FromData (body); IDictionary pairs_out = server.GetValues (pairs_in.Keys); response_data = NameValuePair.GetData (pairs_out); } catch { response_data = new byte[0]; } SendRecord (RecordType.GetValuesResult, record.RequestID, response_data); } void HandleBeginRequest (Request request, NRecord record) { // If a request with the given ID // already exists, there's a bug in the // client. Abort. if (request != null) { StopRun (Strings.Connection_RequestAlreadyExists); return; } // If there are unfinished requests // and multiplexing is disabled, inform // the client and don't begin the // request. if (!server.MultiplexConnections && UnfinishedRequests) { EndRequest (record.RequestID, 0, ProtocolStatus.CantMultiplexConnections); return; } // If the maximum number of requests is // reached, inform the client and don't // begin the request. if (!server.CanRequest) { EndRequest (record.RequestID, 0, ProtocolStatus.Overloaded); return; } var body = new BeginRequestBody (record); // If the role is "Responder", and it is // supported, create a ResponderRequest. if (body.Role == Role.Responder && server.SupportsResponder) request = new ResponderRequest(record.RequestID, this); else { // If the role is not supported inform the client // and don't begin the request. Logger.Write (LogLevel.Warning, Strings.Connection_RoleNotSupported, body.Role); EndRequest (record.RequestID, 0, ProtocolStatus.UnknownRole); return; } lock (request_lock) { requests.Add (request); } keep_alive = (body.Flags & BeginRequestFlags.KeepAlive) != 0; } public void SendRecord (RecordType type, ushort requestID, byte [] bodyData) { SendRecord (type, requestID, bodyData, 0, bodyData.Length); } public void SendRecord (RecordType type, ushort requestID, byte [] bodyData, int bodyIndex, int bodyLength) { if (IsConnected) lock (send_lock) { try { CompatArraySegment body = send_buffers.EnforceBodyLength(bodyLength); Array.Copy(bodyData, bodyIndex, body.Array, body.Offset, bodyLength); var record = new NRecord (1, type, requestID, bodyLength, send_buffers); record.Send (socket); } catch (System.Net.Sockets.SocketException) { } } } public void EndRequest (ushort requestID, int appStatus, ProtocolStatus protocolStatus) { var body = new EndRequestBody (appStatus, protocolStatus); try { if (IsConnected) { byte[] bodyData = body.GetData (); CompatArraySegment bodyBuffer = send_buffers.EnforceBodyLength(bodyData.Length); Array.Copy(bodyData, 0, bodyBuffer.Array, bodyBuffer.Offset, bodyData.Length); var record = new NRecord (1, RecordType.EndRequest, requestID, bodyData.Length, send_buffers); record.Send (socket); } } catch (System.Net.Sockets.SocketException) { } RemoveRequest(requestID); lock (connection_teardown_lock) { if (requests.Count == 0 && (!keep_alive || stop)) { CloseSocket (); if (!stop) server.EndConnection (this); receive_buffers.Return (); send_buffers.Return (); } } } public void Stop () { stop = true; lock(request_lock) foreach (Request req in new List(requests)) EndRequest (req.RequestID, -1, ProtocolStatus.RequestComplete); } #endregion #region Private Properties bool UnfinishedRequests { get { lock(request_lock) foreach (Request request in requests) if (request.DataNeeded) return true; return false; } } #endregion #region Private Methods Request GetRequest (ushort requestID) { lock(request_lock) foreach (Request request in requests) if (request.RequestID == requestID) return request; return null; } void RemoveRequest (ushort requestID) { int i = 0; lock(request_lock) { int count = requests.Count; while (i < count && requests [i].RequestID != requestID) i ++; if (i != count) requests.RemoveAt(i); } } void StopRun (string message, params object [] args) { Logger.Write (LogLevel.Error, message, args); Logger.Write (LogLevel.Error, Strings.Connection_Terminating); Stop (); } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/EndRequestBody.cs0000664000175000017500000000421612627046413017271 00000000000000// // Record.cs: Represents the FastCGI EndRequestBody structure. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.FastCgi { public enum ProtocolStatus : byte { RequestComplete = 0, CantMultiplexConnections = 1, Overloaded = 2, UnknownRole = 3 } public struct EndRequestBody { #region Private Fields readonly int app_status; readonly ProtocolStatus protocol_status; #endregion #region Constructors public EndRequestBody (int appStatus, ProtocolStatus protocolStatus) { app_status = appStatus; protocol_status = protocolStatus; } #endregion #region Public Methods public byte [] GetData () { uint app; unchecked { app = (uint) app_status; } var data = new byte [8]; data [0] = (byte)((app >> 24) & 0xFF); data [1] = (byte)((app >> 16) & 0xFF); data [2] = (byte)((app >> 8) & 0xFF); data [3] = (byte)((app ) & 0xFF); data [4] = (byte) protocol_status; return data; } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/Watchdog.cs0000664000175000017500000000422012627046413016127 00000000000000// // Watchdog.cs: A generic watchdog // // Authors: // Leonardo Taglialegne // // (C) Copyright 2013 Leonardo Taglialegne // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Timers; namespace Mono.WebServer.FastCgi { class Watchdog { /// /// Gets the timeout. /// /// The timeout, in milliseconds. public double Timeout { get; private set; } public event ElapsedEventHandler End; Timer timer; readonly object end_lock = new object (); bool ended; /// Timeout, in milliseconds. public Watchdog(double timeout) { Timeout = timeout; timer = CreateTimer (timeout); } public void Kick() { lock (end_lock) { if (ended) return; timer.Dispose (); timer = CreateTimer (Timeout); } } Timer CreateTimer (double timeout) { var toret = new Timer (timeout) { AutoReset = false }; toret.Elapsed += (sender, args) => { lock (end_lock) { ended = true; } if (End != null) End (sender, args); }; toret.Start (); return toret; } } } xsp-4.2/src/Mono.WebServer.FastCgi/Responder.cs0000664000175000017500000001031512627046413016332 00000000000000// // Responder.cs: Resonds to FastCGI "Responder" requests with an ASP.NET // application. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.FastCgi; using Mono.WebServer.Log; namespace Mono.WebServer.FastCgi { public class Responder : MarshalByRefObject, IResponder { const string ERROR500 = "Status: 500 Internal Server Error\r\n" + "Content-Type: text/html; charset=utf-8\r\n" + "Connection: close\r\n\r\n" + "\r\n" + " \r\n" + " 500 No Application Found\r\n" + " \r\n" + " \r\n" + "

No Application Found

\r\n" + "

Unable to find a matching application for request:

\r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" + "
Host{0}
Port{1}
Request Path{2}
Physical Path{3}
\r\n" + " \r\n" + "\r\n"; readonly ResponderRequest request; public Responder (ResponderRequest request) { this.request = request; } public int Process () { // Uncommenting the following lines will cause the page // + headers to be rendered as plain text. (Pretty sweet // for debugging.) /* request.SendOutputText ("Content-type: text/plain\r\n\r\n"); request.SendOutputText ("Output:\r\n"); request.SendOutputText (Path + "\r\n"); request.SendOutputText (PhysicalPath + "\r\n"); */ ApplicationHost appHost = request.ApplicationHost; // If the application host is null, the server was // unable to determine a sane plan. Alert the client. if (appHost == null) { request.SendOutputText (String.Format (ERROR500, HostName, PortNumber, Path, PhysicalPath)); return -1; } try { appHost.ProcessRequest (this); } catch (Exception e) { Logger.Write (LogLevel.Error, "ERROR PROCESSING REQUEST: " + e); return -1; } // MIN_VALUE means don't close. return Int32.MinValue; } public ResponderRequest Request { get {return request;} } public void SendOutput(string text, System.Text.Encoding encoding) { request.SendOutput (text, encoding); } public void SendOutput (byte [] data, int length) { request.SendOutput (data, length); } public string GetParameter (string name) { return request.GetParameter (name); } public IDictionary GetParameters () { return request.GetParameters (); } public int RequestID { get {return request.RequestID;} } public byte [] InputData { get {return request.InputData;} } public void CompleteRequest (int appStatus) { request.CompleteRequest (appStatus, ProtocolStatus.RequestComplete); } public bool IsConnected { get {return request.IsConnected;} } public string HostName { get {return request.HostName;} } public int PortNumber { get {return request.PortNumber;} } public string Path { get {return request.Path;} } public string PhysicalPath { get {return request.PhysicalPath;} } } } xsp-4.2/src/Mono.WebServer.FastCgi/Strings.cs0000664000175000017500000001270712627046413016031 00000000000000// // String.cs // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.FastCgi { static class Strings { public static string Server_MaxConnsOutOfRange = "At least one connection must be permitted."; public static string Server_MaxReqsOutOfRange = "At least one request must be permitted."; public static string Server_AlreadyStarted = "The server is already started."; public static string Server_NotStarted = "The server has not been started."; public static string Server_ValueUnknown = "Unknown value, {0}, requested by client."; public static string Server_Accepting = "Accepting an incoming connection."; public static string Server_AcceptFailed = "Failed to accept connection. Reason: {0}"; public static string Server_ConnectionFailed = "Failed to process connection."; public static string Server_ConnectionClosed = "The FastCGI connection has been closed."; public static string Server_ResponderDoesNotImplement = "Responder must implement the FastCgi.IResponder interface."; public static string Server_ResponderLacksProperConstructor = "Responder must contain public constructor {0}(ResponderRequest)"; public static string Server_ResponderNotSupported = "Responder role is not supported."; public static string Connection_BeginningRun = "Beginning to receive records on connection."; public static string Connection_EndingRun = "Finished receiving records on connection."; public static string Connection_RecordNotReceived = "Failed to receive record."; public static string Connection_RequestAlreadyExists = "Request with given ID already exists."; public static string Connection_RoleNotSupported = "{0} role not supported by server."; public static string Connection_RequestDoesNotExist = "Request {0} does not exist."; public static string Connection_AbortRecordReceived = "FastCGI Abort Request"; public static string Connection_UnknownRecordType = "Unknown type, {0}, encountered."; public static string Connection_Terminating = "Terminating connection."; public static string Connection_NoSocketInRun = "Run called, but no socket found."; public static string NameValuePair_ParameterRead = "Read parameter. ({0} = {1})"; public static string NameValuePair_DuplicateParameter = "Duplicate name, {0}, encountered. Overwriting existing value."; public static string NameValuePair_DictionaryContainsNonString = "Dictionary must only contain string values."; public static string NameValuePair_LengthLessThanZero = "Length must be greater than or equal to zero."; public static string Record_Received = "Record received. (Type: {0}, ID: {1}, Length: {2})"; public static string Record_Sent = "Record sent. (Type: {0}, ID: {1}, Length: {2})"; public static string Record_DataTooBig = "Data exceeds 65535 bytes and cannot be stored."; public static string Record_ToString = "FastCGI Record:\n Version: {0}\n Type: {0}\n Request ID: {0}\n Content Length: {0}"; public static string BeginRequestBody_WrongType = "The record's type is not BeginRequest."; public static string BeginRequestBody_WrongSize = "8 bytes expected, got {0}."; public static string UnmanagedSocket_NotSupported = "Unmanaged sockets not supported."; public static string UnixSocket_AlreadyExists = "There's already a server listening on {0}"; public static string ResponderRequest_IncompleteInput = "Insufficient input data received. (Expected {0} bytes but got {1}.)"; public static string ResponderRequest_NoContentLength = "Content length parameter missing."; public static string ResponderRequest_NoContentLengthNotNumber = "Content length parameter not an integer."; public static string ResponderRequest_ContentExceedsLength = "Input data exceeds content length."; public static string Request_Aborting = "Aborting request {0}. Reason follows:"; public static string Request_ParametersAlreadyCompleted = "The parameter stream has already been marked as closed. Ignoring record."; public static string Request_StandardInputAlreadyCompleted = "The standard input stream has already been marked as closed. Ignoring record."; public static string Request_FileDataAlreadyCompleted = "The file data stream has already been marked as closed. Ignoring record."; public static string Request_CanNotParseParameters = "Failed to parse parameter data."; public static string Request_NotStandardInput = "The record's type is not StandardInput."; public static string Request_NotFileData = "The record's type is not Data."; } }xsp-4.2/src/Mono.WebServer.FastCgi/BeginRequestBody.cs0000664000175000017500000000553712627046413017616 00000000000000// // Record.cs: Represents the FastCGI BeginRequestBody structure. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.FastCgi; using System.Collections.Generic; using NRecord = Mono.WebServer.FastCgi.Record; namespace Mono.FastCgi { public enum Role : ushort { Responder = 1, Authorizer = 2, Filter = 3 } [Flags] public enum BeginRequestFlags : byte { None = 0, KeepAlive = 1 } public struct BeginRequestBody { #region Private Fields readonly Role role; readonly BeginRequestFlags flags; #endregion #region Constructors internal BeginRequestBody (NRecord record) { if (record.Type != RecordType.BeginRequest) throw new ArgumentException ( Strings.BeginRequestBody_WrongType, "record"); if (record.BodyLength != 8) throw new ArgumentException ( String.Format(Strings.BeginRequestBody_WrongSize, record.BodyLength), "record"); IReadOnlyList body = record.GetBody (); role = NRecord.ReadRole (body); flags = (BeginRequestFlags) body [2]; } [Obsolete] public BeginRequestBody (Record record) { if (record.Type != RecordType.BeginRequest) throw new ArgumentException ( Strings.BeginRequestBody_WrongType, "record"); if (record.BodyLength != 8) throw new ArgumentException ( String.Format(Strings.BeginRequestBody_WrongSize, record.BodyLength), "record"); IReadOnlyList body; record.GetBody (out body); role = NRecord.ReadRole (body); flags = (BeginRequestFlags) body [2]; } #endregion #region Public Properties public Role Role { get {return role;} } public BeginRequestFlags Flags { get {return flags;} } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/WorkerRequest.cs0000664000175000017500000002567312627046413017230 00000000000000// // WorkerRequest.cs: Extends MonoWorkerRequest by getting information from and // writing information to a Responder object. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Globalization; using System.IO; namespace Mono.WebServer.FastCgi { public class WorkerRequest : MonoWorkerRequest { static string [] indexFiles = { "index.aspx", "default.aspx", "index.html", "index.htm" }; static WorkerRequest () { SetDefaultIndexFiles (System.Configuration.ConfigurationManager.AppSettings ["MonoServerDefaultIndexFiles"]); } StringBuilder headers = new StringBuilder (); readonly Responder responder; readonly byte [] input_data; string file_path; string raw_url; bool closed; string uri_path; string [][] unknownHeaders; string [] knownHeaders; readonly string path_info; public WorkerRequest (Responder responder, ApplicationHost appHost) : base (appHost) { this.responder = responder; input_data = responder.InputData; try { Paths.GetPathsFromUri (appHost, GetHttpVerbName (), GetFilePath (), out file_path, out path_info); } catch { path_info = null; file_path = null; } } #region Overrides #region Overrides: Transaction Oriented public override int RequestId { get {return responder.RequestID;} } protected override bool GetRequestData () { return true; } public override bool HeadersSent () { return headers == null; } public override void FlushResponse (bool finalFlush) { if (finalFlush) CloseConnection (); } public override void CloseConnection () { if (closed) return; closed = true; EnsureHeadersSent (); responder.CompleteRequest (0); } public override void SendResponseFromMemory (byte [] data, int length) { EnsureHeadersSent (); responder.SendOutput (data, length); } public override void SendStatus (int statusCode, string statusDescription) { AppendHeaderLine ("Status: {0} {1}", statusCode, statusDescription); } public override void SendUnknownResponseHeader (string name, string value) { AppendHeaderLine ("{0}: {1}", name, value); } public override bool IsClientConnected () { return responder.IsConnected; } public override bool IsEntireEntityBodyIsPreloaded () { return true; } #endregion #region Overrides: Request Oriented public override string GetPathInfo () { string pi = responder.GetParameter ("PATH_INFO"); if (!String.IsNullOrEmpty (pi)) return pi; return path_info ?? String.Empty; } public override string GetRawUrl () { if (raw_url != null) return raw_url; string fcgiRequestUri = responder.GetParameter ("REQUEST_URI"); if (fcgiRequestUri != null) { raw_url = fcgiRequestUri; return raw_url; } var builder = new StringBuilder (GetUriPath ()); string query = GetQueryString (); if (!String.IsNullOrEmpty(query)) { builder.Append ('?'); builder.Append (query); } raw_url = builder.ToString (); return raw_url; } public override bool IsSecure () { return responder.GetParameter ("HTTPS") == "on"; } public override string GetHttpVerbName () { return responder.GetParameter ("REQUEST_METHOD"); } public override string GetHttpVersion () { return responder.GetParameter ("SERVER_PROTOCOL"); } public override string GetLocalAddress () { string address = responder.GetParameter ("SERVER_ADDR"); if (!String.IsNullOrEmpty(address)) return address; address = AddressFromHostName ( responder.GetParameter ("HTTP_HOST")); if (!String.IsNullOrEmpty(address)) return address; address = AddressFromHostName ( responder.GetParameter ("SERVER_NAME")); if (!String.IsNullOrEmpty(address)) return address; return base.GetLocalAddress (); } public override int GetLocalPort () { try { return responder.PortNumber; } catch { return base.GetLocalPort (); } } public override string GetQueryString () { return responder.GetParameter ("QUERY_STRING"); } public override byte [] GetQueryStringRawBytes () { string query_string = GetQueryString (); if (query_string == null) return null; return Encoding.GetBytes (query_string); } public override string GetRemoteAddress () { string addr = responder.GetParameter ("REMOTE_ADDR"); return !String.IsNullOrEmpty(addr) ? addr : base.GetRemoteAddress (); } public override string GetRemoteName () { string ip = GetRemoteAddress (); string name; try { IPHostEntry entry = Dns.GetHostEntry (ip); name = entry.HostName; } catch { name = ip; } return name; } public override int GetRemotePort () { string port = responder.GetParameter ("REMOTE_PORT"); if (String.IsNullOrEmpty(port)) return base.GetRemotePort (); int ret; if (Int32.TryParse (port, out ret)) return ret; return base.GetRemotePort (); } public override string GetServerVariable (string name) { return (responder.GetParameter (name) ?? Environment.GetEnvironmentVariable (name)) ?? base.GetServerVariable (name); } public override string GetUriPath () { if (uri_path != null) return uri_path; uri_path = GetFilePath () + GetPathInfo (); return uri_path; } public override string GetFilePath () { if (file_path != null) return file_path; file_path = responder.Path; // The following will check if the request was made to a // directory, and if so, if attempts to find the correct // index file from the list. Case is ignored to improve // Windows compatability. string path = responder.PhysicalPath; var dir = new DirectoryInfo (path); if (!dir.Exists) return file_path; if (!file_path.EndsWith ("/")) file_path += "/"; FileInfo [] files = dir.GetFiles (); foreach (string file in indexFiles) { foreach (FileInfo info in files) { if (file.Equals (info.Name, StringComparison.InvariantCultureIgnoreCase)) { file_path += info.Name; return file_path; } } } return file_path; } public override string GetUnknownRequestHeader (string name) { foreach (string [] pair in GetUnknownRequestHeaders ()) { if (pair [0] == name) return pair [1]; } return base.GetUnknownRequestHeader (name); } public override string [][] GetUnknownRequestHeaders () { if (unknownHeaders != null) return unknownHeaders; IDictionary pairs = responder.GetParameters (); knownHeaders = new string [RequestHeaderMaximum]; var headers = new string [pairs.Count][]; int count = 0; foreach (string key in pairs.Keys) { if (!key.StartsWith ("HTTP_")) continue; string name = ReformatHttpHeader (key); string value = pairs [key]; int id = GetKnownRequestHeaderIndex (name); if (id >= 0) { knownHeaders [id] = value; continue; } headers [count++] = new[] {name, value}; } unknownHeaders = new string [count][]; Array.Copy (headers, 0, unknownHeaders, 0, count); return unknownHeaders; } public override string GetKnownRequestHeader (int index) { string value; switch (index) { case HeaderContentType: value = responder.GetParameter ("CONTENT_TYPE"); break; case HeaderContentLength: value = responder.GetParameter ("CONTENT_LENGTH"); break; default: GetUnknownRequestHeaders (); value = knownHeaders [index]; break; } return value ?? base.GetKnownRequestHeader (index); } public override string GetServerName () { return (HostNameFromString (responder.GetParameter ("SERVER_NAME")) ?? HostNameFromString (responder.GetParameter ("HTTP_HOST"))) ?? GetLocalAddress (); } public override byte [] GetPreloadedEntityBody () { return input_data; } #endregion #endregion #region Private Methods void AppendHeaderLine (string format, params object [] args) { if (headers == null) return; headers.AppendFormat (CultureInfo.InvariantCulture, format, args); headers.Append ("\r\n"); } void EnsureHeadersSent () { if (headers == null) return; headers.Append ("\r\n"); string str = headers.ToString (); responder.SendOutput (str, HeaderEncoding); headers = null; } #endregion #region Private Static Methods static string AddressFromHostName (string host) { host = HostNameFromString (host); if (host == null || host.Length > 126) return null; IPAddress [] addresses; try { addresses = Dns.GetHostAddresses (host); } catch (System.Net.Sockets.SocketException) { return null; } catch (ArgumentException) { return null; } if (addresses == null || addresses.Length == 0) return null; return addresses [0].ToString (); } static string HostNameFromString (string host) { if (String.IsNullOrEmpty(host)) return null; int colon_index = host.IndexOf (':'); if (colon_index == -1) return host; if (colon_index == 0) return null; return host.Substring (0, colon_index); } static string ReformatHttpHeader (string header) { string [] parts = header.Substring (5).Split ('_'); for (int i = 0; i < parts.Length; i ++) { string s = parts [i]; if (String.IsNullOrEmpty (s)) { parts [i] = String.Empty; continue; } s = s.ToLower (); char [] a = s.ToCharArray (); a [0] = Char.ToUpper (a[0]); parts [i] = new String (a); } return String.Join ("-", parts); } static void SetDefaultIndexFiles (string list) { if (list == null) return; indexFiles = SplitAndTrim (list); } #endregion } } xsp-4.2/src/Mono.WebServer.FastCgi/Makefile.am0000664000175000017500000000207712627054427016110 00000000000000builddir=$(top_builddir)/src/Mono.WebServer.FastCgi MCSFLAGS= -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe+ -keyfile:$(top_srcdir)/src/mono.snk XSP4_EXE = fastcgi-mono-server4.exe GACUTIL4=$(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:Mono.Posix.dll references4 = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll sources = $(shell cat $(srcdir)/Mono.WebServer.FastCgi.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in $(resources) Mono.WebServer.FastCgi.sources fastcgi-mono-server4.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ \ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/fastcgi-mono-server4.exe uninstall-local: -for i in $(noinst_SCRIPTS) ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done xsp-4.2/src/Mono.WebServer.FastCgi/Server/0000775000175000017500000000000012627055647015401 500000000000000xsp-4.2/src/Mono.WebServer.FastCgi/Server/GenericServer.cs0000664000175000017500000001513712627046413020411 00000000000000// // GenericServer.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Threading; using Mono.WebServer.Log; using Mono.FastCgi; namespace Mono.WebServer.FastCgi { public class GenericServer : IGenericServer where T : IConnection { readonly Socket listen_socket; readonly IServerCallback serverCallback; readonly object accept_lock = new object (); readonly object state_lock = new object (); bool accepting; bool stopped; Thread runner; readonly List connections = new List (); readonly object connections_lock = new object (); int max_connections = Int32.MaxValue; readonly AutoResetEvent stop_signal = new AutoResetEvent (false); readonly AutoResetEvent stopped_signal = new AutoResetEvent (false); public event EventHandler RequestReceived; public IEnumerable Connections { get { lock(connections_lock) return new List (connections); } } public bool Started { get; private set; } public bool CanAccept { get { return Started && connections.Count < max_connections; } } public int MaxConnections { get {return max_connections;} set { if (value < 1) throw new ArgumentOutOfRangeException ( "value", Strings.Server_MaxConnsOutOfRange); max_connections = value; } } public int ConnectionCount { get { return connections.Count; } } public GenericServer (Socket socket, IServerCallback callback) { if (socket == null) throw new ArgumentNullException ("socket"); if (callback == null) throw new ArgumentNullException ("callback"); listen_socket = socket; serverCallback = callback; } public bool Start (bool background, int backlog) { lock (state_lock) { if (Started) throw new InvalidOperationException (Strings.Server_AlreadyStarted); try { listen_socket.Listen (backlog); } catch (System.Net.Sockets.SocketException e){ if (e.ErrorCode == 10013) { Logger.Write (LogLevel.Error, "Failed to start server: permission denied for socket {0}", listen_socket); return false; } Logger.Write (LogLevel.Error, "Failed to start server {0}: {1} ({2})", listen_socket, e.Message, e.ErrorCode); throw; } runner = new Thread (RunServer) { IsBackground = background }; runner.Start (); stopped = false; } return true; } public void Stop () { // Avoid acquiring the lock if unneeded if (stopped) return; lock (state_lock) { if (stopped) return; if (!Started) throw new InvalidOperationException (Strings.Server_NotStarted); Started = false; stopped = true; Logger.Write (LogLevel.Debug, "Stopping now"); listen_socket.Close (); lock (connections_lock) foreach (T c in new List (connections)) EndConnection (c); stop_signal.Set (); stopped_signal.WaitOne (); runner = null; } } public void EndConnection (T connection) { if (connection == null) throw new ArgumentNullException ("connection"); connection.Stop (); lock (connections_lock) { if (connections.Contains (connection)) connections.Remove (connection); } if (!accepting && CanAccept) BeginAccept (); } void RunServer () { Logger.Write (LogLevel.Debug, "Server started [callback: {0}]", serverCallback); lock (state_lock) { Started = true; } listen_socket.BeginAccept (OnAccept, null); if (runner.IsBackground) return; stop_signal.WaitOne (); stopped_signal.Set (); } void OnAccept (IAsyncResult ares) { Logger.Write (LogLevel.Debug, Strings.Server_Accepting); T connection = default (T); bool created = false; lock (accept_lock) { accepting = false; } try { try { Socket accepted = listen_socket.EndAccept (ares); if (stopped) { Logger.Write (LogLevel.Debug, "Shutting down..."); accepted.Close(); return; } connection = serverCallback.OnAccept (accepted); created = true; lock (connections_lock) connections.Add (connection); connection.RequestReceived += RequestReceived; } catch (System.Net.Sockets.SocketException e) { Logger.Write (LogLevel.Error, Strings.Server_AcceptFailed, e.Message); if (e.ErrorCode == 10022) Stop (); } catch (ObjectDisposedException) { Logger.Write (LogLevel.Debug, Strings.Server_ConnectionClosed); return; // Already done (e.g., shutdown) } if (CanAccept) BeginAccept (); } catch (Exception e) { Logger.Write (LogLevel.Error, Strings.Server_AcceptFailed, e.Message); throw; } if (!created) return; try { connection.Run (); } catch (Exception e) { Logger.Write (LogLevel.Error, Strings.Server_ConnectionFailed); Logger.Write (e); try { // Upon catastrophic failure, forcefully stop // all remaining connection activity, since no // specific error-handling kicked in to rescue // the connection or its requests and the // connection's main loop has now terminated. // This prevents abandoned FastCGI connections // from staying open indefinitely. EndConnection (connection); Logger.Write (LogLevel.Debug, Strings.Server_ConnectionClosed); } catch { // Ignore at this point -- too bad } } } void BeginAccept () { lock (accept_lock) { if (accepting) return; accepting = true; listen_socket.BeginAccept (OnAccept, null); } } } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/IServer.cs0000664000175000017500000000257312627046413017225 00000000000000// // IServer.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.FastCgi { public interface IServer { event EventHandler RequestReceived; bool Start (bool background, int backlog); void Stop (); } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/FakeGenericServer.cs0000664000175000017500000000423512627046413021175 00000000000000// // OnDemandServer.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; namespace Mono.WebServer.FastCgi { public class FakeGenericServer : IGenericServer where T : IConnection { readonly IGenericServer backend; public event EventHandler RequestReceived; public FakeGenericServer (IGenericServer server) { if (server == null) throw new ArgumentNullException ("server"); backend = server; } public bool Start (bool background, int backlog) { return true; } public void Stop () { } public void EndConnection(T connection) { } public int MaxConnections { get { return backend.MaxConnections; } set { backend.MaxConnections = value; } } public int ConnectionCount { get { return backend.ConnectionCount; } } public bool Started { get { return backend.Started; } } public bool CanAccept { get { return backend.CanAccept; } } public IEnumerable Connections { get { return backend.Connections; } } } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/OnDemandServer.cs0000664000175000017500000000544512627046413020523 00000000000000// // OnDemandServer.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.Log; using Mono.FastCgi; using Mono.WebServer.FastCgi.Sockets; namespace Mono.WebServer.FastCgi { public class OnDemandServer : IServerCallback, IServer { readonly GenericServer backend; readonly Mono.FastCgi.Server server; int max_requests = Int32.MaxValue; public event EventHandler RequestReceived; public int MaxConnections { get { return backend.MaxConnections; } set { backend.MaxConnections = value; } } public int MaxRequests { get {return max_requests;} set { if (value < 1) throw new ArgumentOutOfRangeException ("value", Strings.Server_MaxReqsOutOfRange); max_requests = value; } } public bool MultiplexConnections { get; set; } public OnDemandServer (Socket socket) { if (socket == null) throw new ArgumentNullException ("socket"); backend = new GenericServer (socket, this); var fakeBackend = new FakeGenericServer (backend); server = new Mono.FastCgi.Server (fakeBackend); } public bool Start (bool background, int backlog) { return backend.Start (background, backlog); } public void Stop () { backend.Stop (); } public ConnectionProxy OnAccept (Socket socket) { IntPtr fd = SocketPassing.ReceiveFrom (socket.Handle); Logger.Write (LogLevel.Debug, "Received fd {0} from {1}", fd, socket.Handle); Socket passed = new UnmanagedSocket (fd, true); return new ConnectionProxy (new Connection (passed, server)); } public void SetResponder (Type type) { server.SetResponder (type); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/IServerCallback.cs0000664000175000017500000000252212627046413020634 00000000000000// // IServerCallback.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.FastCgi; namespace Mono.WebServer.FastCgi { public interface IServerCallback { T OnAccept(Socket socket); } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/IConnection.cs0000664000175000017500000000254512627046413020055 00000000000000// // IConnection.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; namespace Mono.WebServer.FastCgi { public interface IConnection { event EventHandler RequestReceived; void Run (); void Stop (); } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/SocketPassing.cs0000664000175000017500000000425212627046413020417 00000000000000// // SocketPassing.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net.Sockets; using System.Runtime.InteropServices; using Mono.Unix; namespace Mono.WebServer.FastCgi { public static class SocketPassing { public static void SendTo (IntPtr connection, IntPtr passing) { send_fd (connection, passing); } public static void SendTo (Socket connection, IntPtr passing) { if (connection == null) throw new ArgumentNullException ("connection"); send_fd (connection.Handle, passing); } public static IntPtr ReceiveFrom (IntPtr connection) { IntPtr fd; recv_fd (connection, out fd); return fd; } public static UnixStream ReceiveFrom (Socket connection) { if (connection == null) throw new ArgumentNullException ("connection"); return new UnixStream (ReceiveFrom (connection.Handle).ToInt32 ()); } [DllImport ("fpm_helper")] static extern void send_fd (IntPtr sock, IntPtr fd); [DllImport ("fpm_helper")] static extern void recv_fd (IntPtr sock, out IntPtr fd); } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/IGenericServer.cs0000664000175000017500000000304112627046413020511 00000000000000// // IGenericServer.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Collections.Generic; namespace Mono.WebServer.FastCgi { public interface IGenericServer : IServer where T : IConnection { int MaxConnections { get; set; } int ConnectionCount { get; } bool Started { get; } bool CanAccept { get; } IEnumerable Connections { get; } void EndConnection (T connectionProxy); } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/ConnectionProxy.cs0000664000175000017500000000354112627046413021003 00000000000000// // ConnectionProxy.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.FastCgi; namespace Mono.WebServer.FastCgi { public struct ConnectionProxy : IConnection { readonly Connection connection; public event EventHandler RequestReceived { add { connection.RequestReceived += value; } remove { connection.RequestReceived -= value; } } public int RequestCount { get { return connection.RequestCount; } } public ConnectionProxy (Connection connection) { if (connection == null) throw new ArgumentNullException ("connection"); this.connection = connection; } public void Run () { connection.Run (); } public void Stop () { connection.Stop (); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Server/ServerProxy.cs0000664000175000017500000000365212627046413020155 00000000000000// // ServerProxy.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.FastCgi; namespace Mono.WebServer.FastCgi { struct ServerProxy : IServerCallback, IServer { readonly Mono.FastCgi.Server server; public event EventHandler RequestReceived { add { server.RequestReceived += value; } remove { server.RequestReceived -= value; } } internal ServerProxy(Mono.FastCgi.Server server) { if (server == null) throw new ArgumentNullException ("server"); this.server = server; } public ConnectionProxy OnAccept (Socket socket) { return server.OnAccept (socket); } public bool Start (bool background, int backlog) { server.Start (background, backlog); return true; } public void Stop () { server.Stop (); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Compatibility/0000775000175000017500000000000012627055647016744 500000000000000xsp-4.2/src/Mono.WebServer.FastCgi/Compatibility/CompatArraySegment.cs0000664000175000017500000001033412627046413022750 00000000000000// // ArraySegment.cs // // Authors: // Ben Maurer (bmaurer@ximian.com) // Jensen Somers // Marek Safar (marek.safar@gmail.com) // // Copyright (C) 2004 Novell // Copyright (C) 2012 Xamarin, Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections; using System.Collections.Generic; namespace Mono.WebServer.FastCgi.Compatibility { [Serializable] public struct CompatArraySegment : IReadOnlyList { readonly T [] array; readonly int offset, count; public T [] Array { get { return array; } } public int Offset { get { return offset; } } public int Count { get { return count; } } T IReadOnlyList.this[int index] { get { return this [index]; } } public T this[int index] { get { if (index < 0 || count <= index) throw new ArgumentOutOfRangeException ("index"); return array[offset + index]; } set { if (index < 0 || count <= index) throw new ArgumentOutOfRangeException ("index"); array[offset + index] = value; } } public CompatArraySegment (T [] array, int offset, int count) { if (array == null) throw new ArgumentNullException ("array"); if (offset < 0) throw new ArgumentOutOfRangeException ("offset", "Non-negative number required."); if (count < 0) throw new ArgumentOutOfRangeException ("count", "Non-negative number required."); if (offset > array.Length) throw new ArgumentException ("out of bounds"); // now offset is valid, or just beyond the end. // Check count -- do it this way to avoid overflow on 'offset + count' if (array.Length - offset < count) throw new ArgumentException ("out of bounds", "offset"); this.array = array; this.offset = offset; this.count = count; } public CompatArraySegment (T [] array, int offset) : this (array, offset, array.Length - offset) { } public CompatArraySegment (T [] array) { if (array == null) throw new ArgumentNullException ("array"); this.array = array; offset = 0; count = array.Length; } public CompatArraySegment Trimmed (int size) { return new CompatArraySegment (array, offset, size); } public override bool Equals (Object obj) { return obj is ArraySegment && Equals ((ArraySegment) obj); } public bool Equals (ArraySegment obj) { return array == obj.Array && offset == obj.Offset && count == obj.Count; } public override int GetHashCode () { // TODO: fix this return array.GetHashCode () ^ offset ^ count; } public static bool operator ==(CompatArraySegment a, CompatArraySegment b) { return a.Equals (b); } public static bool operator !=(CompatArraySegment a, CompatArraySegment b) { return !a.Equals (b); } IEnumerator IEnumerable.GetEnumerator () { for (int i = 0; i < count; ++i) yield return array[offset + i]; } IEnumerator IEnumerable.GetEnumerator () { return ((IEnumerable) this).GetEnumerator (); } public void CopyTo(T[] dest, int destIndex, int count) { if (dest == null) throw new ArgumentNullException ("dest"); System.Array.Copy(array, offset, dest, destIndex, count); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Compatibility/IReadOnlyList.cs0000664000175000017500000000254512627046413021672 00000000000000// // IReadOnlyList.cs // // Authors: // Marek Safar // // Copyright (C) 2011 Xamarin, Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // #if !NET_4_5 namespace System.Collections.Generic { public interface IReadOnlyList : IReadOnlyCollection { T this [int index] { get; } } } #endifxsp-4.2/src/Mono.WebServer.FastCgi/Compatibility/IReadOnlyCollection.cs0000664000175000017500000000254012627046413023045 00000000000000// // IReadOnlyCollection.cs // // Authors: // Marek Safar // // Copyright (C) 2012 Xamarin, Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // #if !NET_4_5 namespace System.Collections.Generic { public interface IReadOnlyCollection : IEnumerable { int Count { get; } } } #endifxsp-4.2/src/Mono.WebServer.FastCgi/Compatibility/ArrayExtensions.cs0000664000175000017500000000276112627046413022346 00000000000000// // ArrayExtensions.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Collections.Generic; namespace Mono.WebServer.FastCgi.Compatibility { public static class ArrayExtensions { public static IReadOnlyList ToReadOnlyList (this T[] array) { // TODO: don't use a segment for this return new CompatArraySegment (array); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Request.cs0000664000175000017500000003413412627046413016026 00000000000000// // Requests/Request.cs: Handles FastCGI requests. // // Author: // Brian Nickel (brian.nickel@gmail.com) // Robert Jordan // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using Mono.WebServer.FastCgi.Compatibility; using Mono.WebServer.Log; using IOPath = System.IO.Path; using Mono.WebServer; using Mono.WebServer.FastCgi; using NRecord = Mono.WebServer.FastCgi.Record; using System.Linq; namespace Mono.FastCgi { public class Request { #region Private Fields readonly Connection connection; #endregion #region Constructors public Request (ushort requestID, Connection connection) { DataNeeded = true; RequestID = requestID; this.connection = connection; } #endregion #region Request Completion Handling // When a request is completed, the output and error streams // must be completed and the final farewell must be send so // the HTTP server can finish its response. public void CompleteRequest (int appStatus, ProtocolStatus protocolStatus) { // Data is no longer needed. DataNeeded = false; // Close the standard output if it was opened. if (stdout_sent) SendStreamData (RecordType.StandardOutput, new byte [0], 0); // Close the standard error if it was opened. if (stderr_sent) SendStreamData (RecordType.StandardError, new byte [0], 0); connection.EndRequest (RequestID, appStatus, protocolStatus); } public void Abort (string message, params object [] args) { SendError (message); Logger.Write (LogLevel.Error, Strings.Request_Aborting, RequestID); Logger.Write (LogLevel.Error, message, args); CompleteRequest (-1, ProtocolStatus.RequestComplete); } public bool DataNeeded { get; protected set; } public Server Server { get {return connection.Server;} } public ushort RequestID { get; private set; } public bool IsConnected { get {return connection.IsConnected;} } #endregion #region Request Details string vhost; int port = -1; string path; string rpath; public string HostName { get { if (String.IsNullOrEmpty(vhost)) vhost = GetParameter ("HTTP_HOST"); return vhost; } } public int PortNumber { get { if (port < 0) Int32.TryParse (GetParameter ("SERVER_PORT"), out port); return port; } } public string Path { get { if (String.IsNullOrEmpty(path)) path = GetParameter ("SCRIPT_NAME"); return path; } } public string PhysicalPath { get { if (String.IsNullOrEmpty(rpath)) rpath = GetParameter ("SCRIPT_FILENAME"); return rpath; } } internal protected ApplicationHost ApplicationHost { get; private set; } #endregion #region Parameter Handling protected event EventHandler ParameterDataCompleted; List parameter_data = new List (); IDictionary parameter_table; public void AddParameterData (byte [] data) { AddParameterData (data.ToReadOnlyList ()); } public void AddParameterData (IReadOnlyList data) { // Validate arguments in public methods. if (data == null) throw new ArgumentNullException ("data"); // When all the parameter data is received, it is acted // on and the parameter_data object is nullified. // Further data suggests a problem with the HTTP server. if (parameter_data == null) { Logger.Write (LogLevel.Warning, Strings.Request_ParametersAlreadyCompleted); return; } // If data was provided, append it to that already // received, and exit. if (data.Count > 0) { parameter_data.AddRange (data); return; } // A zero length record indicates the end of that form // of data. When it is received, the data can then be // examined and worked on. data = parameter_data.ToArray ().ToReadOnlyList (); try { parameter_table = NameValuePair.FromData (data); // The parameter data is no longer needed and // can be sent to the garbage collector. parameter_data = null; // Inform listeners of the completion. if (ParameterDataCompleted != null) ParameterDataCompleted (this, EventArgs.Empty); } catch { Abort (Strings.Request_CanNotParseParameters); } ParseParameterData (); } void ParseParameterData () { string redirectUrl; string pathInfo = GetParameter ("PATH_INFO"); string pathTranslated = GetParameter ("PATH_TRANSLATED"); VPathToHost vapp; if (String.IsNullOrEmpty(pathTranslated) || String.IsNullOrEmpty(pathInfo) || pathInfo [0] != '/' || (null != (redirectUrl = GetParameter ("REDIRECT_URL")) && redirectUrl.Length != 0 && pathInfo != redirectUrl)) { // Only consider REDIRECT_URL if it actually contains // something, since it may not always be present (depending // on installed Apache modules & setup). Also, never allow // PATH_INFO to be null (nor PATH_TRANSLATED), even for // cases where this method is mostly short-circuited. if (pathInfo == null) SetParameter ("PATH_INFO", String.Empty); if (pathTranslated == null) SetParameter ("PATH_TRANSLATED", String.Empty); vapp = WebServer.FastCgi.Server.GetApplicationForPath (HostName, PortNumber, Path, PhysicalPath); if (vapp == null) Logger.Write (LogLevel.Debug, "Couldn't find vapp."); else ApplicationHost = vapp.AppHost as ApplicationHost; return; } // At this point we have: (with REDIRECT_URL being optional) // // REDIRECT_URL=/dir/test.aspx/foo // PATH_INFO=/dir/test.aspx/foo // PATH_TRANSLATED=/srv/www/htdocs/dir/test.aspx/foo // SCRIPT_NAME=/cgi-bin/fastcgi-mono-server // SCRIPT_FILENAME=/srv/www/cgi-bin/fastcgi-mono-server string virtPath = pathInfo; string physPath = pathTranslated; string virtPathInfo = String.Empty; string physPathInfo = String.Empty; try { vapp = WebServer.FastCgi.Server.GetApplicationForPath ( HostName, PortNumber, virtPath, physPath); if (vapp == null) return; // Set values in finally ApplicationHost = vapp.AppHost as ApplicationHost; if (ApplicationHost == null) return; // Set values in finally // Split the virtual path and virtual path-info string verb = GetParameter ("REQUEST_METHOD"); if (String.IsNullOrEmpty(verb)) verb = "GET"; // For the sake of paths, assume a default ApplicationHost.GetPathsFromUri (verb, pathInfo, out virtPath, out virtPathInfo); if (virtPathInfo == null) virtPathInfo = String.Empty; if (virtPath == null) virtPath = String.Empty; // Re-map the physical path physPath = ApplicationHost.MapPath (virtPath) ?? String.Empty; // Re-map the physical path-info string relaPathInfo = virtPathInfo; if (relaPathInfo.Length != 0 && IOPath.DirectorySeparatorChar != '/') relaPathInfo = relaPathInfo.Replace ('/', IOPath.DirectorySeparatorChar); while (relaPathInfo.Length > 0 && relaPathInfo[0] == IOPath.DirectorySeparatorChar) { relaPathInfo = relaPathInfo.Substring (1); } if (physPath.Length == 0) { physPathInfo = relaPathInfo; return; // Set values in finally } string physRoot = physPath; try { if (ApplicationHost.VirtualFileExists (virtPath)) { physRoot = IOPath.GetDirectoryName (physRoot) ?? String.Empty; } } catch { // Assume virtPath, physPath & physRoot // specify directories (and not files) } physPathInfo = IOPath.Combine (physRoot, relaPathInfo); } finally { // Now, if all went well, we set: // // SCRIPT_NAME=/dir/test.aspx // SCRIPT_FILENAME=/srv/www/htdocs/dir/test.aspx // PATH_INFO=/foo // PATH_TRANSLATED=/srv/www/htdocs/dir/foo SetParameter ("SCRIPT_NAME", virtPath); SetParameter ("SCRIPT_FILENAME", physPath); SetParameter ("PATH_INFO", virtPathInfo); SetParameter ("PATH_TRANSLATED", physPathInfo); } } public string GetParameter (string parameter) { if (parameter_table != null && parameter_table.ContainsKey (parameter)) return parameter_table [parameter]; return null; } void SetParameter (string name, string value) { if (parameter_table != null) parameter_table [name] = value; } public IDictionary GetParameters () { return parameter_table; } #endregion #region Standard Input Handling protected event DataReceivedHandler InputDataReceived; bool input_data_completed; [Obsolete] public void AddInputData (Record record) { AddInputData ((NRecord)record); } internal void AddInputData (NRecord record) { // Validate arguments in public methods. if (record.Type != RecordType.StandardInput) throw new ArgumentException ( Strings.Request_NotStandardInput, "record"); // There should be no data following a zero byte record. if (input_data_completed) { Logger.Write (LogLevel.Warning, Strings.Request_StandardInputAlreadyCompleted); return; } if (record.BodyLength == 0) input_data_completed = true; // Inform listeners of the data. if (InputDataReceived != null) InputDataReceived (this, new DataReceivedArgs (record)); } #endregion #region File Data Handling protected event DataReceivedHandler FileDataReceived; bool file_data_completed; [Obsolete] public void AddFileData (Record record) { AddFileData ((NRecord)record); } internal void AddFileData (NRecord record) { // Validate arguments in public methods. if (record.Type != RecordType.Data) throw new ArgumentException ( Strings.Request_NotFileData, "record"); // There should be no data following a zero byte record. if (file_data_completed) { Logger.Write (LogLevel.Warning, Strings.Request_FileDataAlreadyCompleted); return; } if (record.BodyLength == 0) file_data_completed = true; // Inform listeners of the data. if (FileDataReceived != null) FileDataReceived (this, new DataReceivedArgs (record)); } #endregion #region Standard Output Handling bool stdout_sent; public void SendOutput (byte [] data, int length) { if (data == null) throw new ArgumentNullException ("data"); if (data.Length == 0) return; stdout_sent = true; SendStreamData (RecordType.StandardOutput, data, length); } public void SendOutput (byte [] data) { SendOutput (data, data.Length); } public void SendOutputText (string text) { SendOutput (text, System.Text.Encoding.UTF8); } public void SendOutput (string text, System.Text.Encoding encoding) { SendOutput (encoding.GetBytes (text)); } #endregion #region Standard Error Handling bool stderr_sent; public void SendError (byte [] data, int length) { if (data == null) throw new ArgumentNullException ("data"); if (data.Length == 0) return; stderr_sent = true; SendStreamData (RecordType.StandardError, data, length); } public void SendError (byte [] data) { SendError (data, data.Length); } public void SendError (string text) { SendError (text, System.Text.Encoding.UTF8); } public void SendError (string text, System.Text.Encoding encoding) { SendError (encoding.GetBytes (text)); } #endregion #region Private Methods void SendStreamData (RecordType type, byte [] data, int length) { // Records are only able to hold 65535 bytes of data. If // larger data is to be sent, it must be broken into // smaller components. if (length > data.Length) length = data.Length; const int maxSize = 0x7fff; if (length < maxSize) connection.SendRecord (type, RequestID, data, 0, length); else { int index = 0; while (index < length) { int chunkLength = (maxSize < length - index) ? maxSize : (length - index); connection.SendRecord (type, RequestID, data, index, chunkLength); index += chunkLength; } } } #endregion } public delegate void DataReceivedHandler (Request sender, DataReceivedArgs args); public class DataReceivedArgs : EventArgs { readonly NRecord record; [Obsolete] public DataReceivedArgs (Record record) { this.record = (NRecord)record; } internal DataReceivedArgs(NRecord record) { this.record = record; } public bool DataCompleted { get {return record.BodyLength == 0;} } [Obsolete("Use GetBody()")] public byte[] GetData () { return record.GetBody ().ToArray (); } public IReadOnlyList GetBody() { return record.GetBody(); } public int DataLength { get {return record.BodyLength;} } public void CopyTo (byte[] dest, int destIndex) { if (dest == null) throw new ArgumentNullException ("dest"); if (DataLength > dest.Length - destIndex) throw new ArgumentOutOfRangeException ( "destIndex"); record.CopyTo (dest, destIndex); } } } xsp-4.2/src/Mono.WebServer.FastCgi/Mono.WebServer.FastCgi.sources0000664000175000017500000000176412627046413021611 00000000000000./ApplicationHost.cs ./BeginRequestBody.cs ./BufferManager.cs ./Buffers.cs ./Compatibility/ArrayExtensions.cs ./Compatibility/CompatArraySegment.cs ./Compatibility/IReadOnlyCollection.cs ./Compatibility/IReadOnlyList.cs ./ConfigurationManager.cs ./ConfigurationManager.Obsolete.cs ./Connection.cs ./DictionaryExtensions.cs ./EndRequestBody.cs ./main.cs ./NameValuePair.cs ./Obsolete/ConfigurationManager.cs ./Obsolete/Record.cs ./Obsolete/SocketFactory.cs ./Record.cs ./RecordType.cs ./Request.cs ./Responder.cs ./ResponderRequest.cs ./Server/ConnectionProxy.cs ./Server.cs ./Server/FakeGenericServer.cs ./Server/GenericServer.cs ./Server/IConnection.cs ./Server/IGenericServer.cs ./Server/IServerCallback.cs ./Server/IServer.cs ./Server/OnDemandServer.cs ./Server/ServerProxy.cs ./Server/SocketPassing.cs ./Sockets/Socket.cs ./Sockets/StandardSocket.cs ./Sockets/TcpSocket.cs ./Sockets/UnixSocket.cs ./Sockets/UnmanagedSocket.cs ./Strings.cs ./UnknownTypeBody.cs ./Watchdog.cs ./WebSource.cs ./WorkerRequest.cs xsp-4.2/src/Mono.WebServer.FastCgi/main.cs0000664000175000017500000003714612627046413015330 00000000000000// // server.cs: Web Server that uses ASP.NET hosting // // Authors: // Brian Nickel (brian.nickel@gmail.com) // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004 Novell, Inc. (http://www.novell.com) // (C) Copyright 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Reflection; using System.Timers; using Mono.WebServer.Log; using Mono.WebServer.Options; using Mono.FastCgi; using Mono.WebServer.FastCgi.Sockets; using Mono.Unix.Native; namespace Mono.WebServer.FastCgi { public static class Server { const string WRONG_KIND = "Error in argument \"socket\". \"{0}\" is not a supported type. Use \"pipe\", \"tcp\" or \"unix\"."; delegate bool SocketCreator (ConfigurationManager configmanager,string[] socketParts,out Socket socket); static ApplicationServer appserver; public static VPathToHost GetApplicationForPath (string vhost, int port, string path, string realPath) { return appserver.GetApplicationForPath (vhost, port, path, false); } public static int Main (string[] args) { if (Platform.IsUnix) { uint uid = Syscall.geteuid (); uint gid = Syscall.getegid (); Platform.SetIdentity (uid, gid); } var configurationManager = new ConfigurationManager ("fastcgi-mono-server"); if (!configurationManager.LoadCommandLineArgs (args)) return 1; // Show the help and exit. if (configurationManager.Help) { configurationManager.PrintHelp (); #if DEBUG Console.WriteLine ("Press any key..."); Console.ReadKey (); #endif return 0; } // Show the version and exit. if (configurationManager.Version) { Version.Show (); return 0; } if (!configurationManager.LoadConfigFile ()) return 1; configurationManager.SetupLogger (); #if DEBUG // Log everything while debugging Logger.Level = LogLevel.All; #endif Logger.Write (LogLevel.Debug, Assembly.GetExecutingAssembly ().GetName ().Name); Platform.LogIdentity (); string root_dir; if (!TryGetRootDirectory (configurationManager, out root_dir)) return 1; CreateAppServer (configurationManager, root_dir); if (!TryLoadApplicationsConfig (configurationManager)) return 1; IServer server; if (configurationManager.OnDemand) { Socket socket; Uri uri; if (!TryCreateOnDemandSocket (configurationManager.OnDemandSock, out socket, out uri)) return 1; server = CreateOnDemandServer (configurationManager, socket); CreateWatchdog (configurationManager, server); } else { Socket socket; if (!TryCreateSocket (configurationManager, out socket)) return 1; server = new ServerProxy (CreateServer (configurationManager, socket)); } var stoppable = configurationManager.Stoppable; if (!server.Start (stoppable, (int)configurationManager.Backlog)) { Logger.Write (LogLevel.Error, "Failed to start server!"); return 1; } if (stoppable) { Console.WriteLine ( "Hit Return to stop the server."); Console.ReadLine (); server.Stop (); } return 0; } static bool TryCreateOnDemandSocket (string onDemandSock, out Socket socket, out Uri uri) { socket = null; return (Uri.TryCreate (onDemandSock, UriKind.Absolute, out uri) && TryCreateSocketFromUri (uri, out socket)) || TryCreateUnixSocket (onDemandSock, out socket); } static void CreateWatchdog (ConfigurationManager configurationManager, IServer server) { using (var aliveLock = new System.Threading.ReaderWriterLockSlim ()) { bool alive = false; // On a new connection try to set alive to true // If we can't then don't bother, it's not needed server.RequestReceived += (sender, e) => TryRunLocked ( () => aliveLock.TryEnterWriteLock (0), () => alive = true, aliveLock.ExitWriteLock ); var pluto = new Watchdog (configurationManager.IdleTime * 1000); pluto.End += (sender, e) => { Logger.Write (LogLevel.Debug, "The dog bit!"); server.Stop (); Logger.Write (LogLevel.Debug, "Server stopped."); Logger.Write (LogLevel.Debug, "Goodbye!"); Environment.Exit (0); }; // Check every second for hearthbeats var t = new Timer (1000); t.Elapsed += (sender, e) => RunLocked ( aliveLock.EnterUpgradeableReadLock, () => { if (!alive) return; RunLocked ( aliveLock.EnterWriteLock, () => alive = false, aliveLock.ExitWriteLock ); pluto.Kick (); }, aliveLock.ExitUpgradeableReadLock ); t.Start (); } } static void RunLocked (Action takeLock, Action code, Action releaseLock) { if (takeLock == null) throw new ArgumentNullException ("takeLock"); if (code == null) throw new ArgumentNullException ("code"); if (releaseLock == null) throw new ArgumentNullException ("releaseLock"); TryRunLocked (() => { takeLock (); return true; }, code, releaseLock); } static void TryRunLocked (Func takeLock, Action code, Action releaseLock) { if (takeLock == null) throw new ArgumentNullException ("takeLock"); if (code == null) throw new ArgumentNullException ("code"); if (releaseLock == null) throw new ArgumentNullException ("releaseLock"); bool locked = false; try { if (!takeLock ()) return; locked = true; code (); } finally { if (locked) releaseLock (); } } static IServer CreateOnDemandServer (ConfigurationManager configurationManager, Socket socket) { if (configurationManager == null) throw new ArgumentNullException ("configurationManager"); if (socket == null) throw new ArgumentNullException ("socket"); var server = new OnDemandServer (socket) { MaxConnections = configurationManager.MaxConns, MaxRequests = configurationManager.MaxReqs, MultiplexConnections = configurationManager.Multiplex }; server.SetResponder (typeof(Responder)); Logger.Write (LogLevel.Debug, "Max connections: {0}", server.MaxConnections); Logger.Write (LogLevel.Debug, "Max requests: {0}", server.MaxRequests); Logger.Write (LogLevel.Debug, "Multiplex connections: {0}", server.MultiplexConnections); return server; } static Mono.FastCgi.Server CreateServer (ConfigurationManager configurationManager, Socket socket) { var server = new Mono.FastCgi.Server (socket) { MaxConnections = configurationManager.MaxConns, MaxRequests = configurationManager.MaxReqs, MultiplexConnections = configurationManager.Multiplex }; server.SetResponder (typeof(Responder)); Logger.Write (LogLevel.Debug, "Max connections: {0}", server.MaxConnections); Logger.Write (LogLevel.Debug, "Max requests: {0}", server.MaxRequests); Logger.Write (LogLevel.Debug, "Multiplex connections: {0}", server.MultiplexConnections); return server; } static void CreateAppServer (ConfigurationManager configurationManager, string rootDir) { var webSource = new WebSource (); appserver = new ApplicationServer (webSource, rootDir) { Verbose = configurationManager.Verbose }; } static bool TryLoadApplicationsConfig (ConfigurationManager configurationManager) { bool autoMap = false; //(bool) configurationManager ["automappaths"]; var applications = configurationManager.Applications; if (applications != null) appserver.AddApplicationsFromCommandLine (applications); string app_config_file; string app_config_dir; try { app_config_file = configurationManager.AppConfigFile; app_config_dir = configurationManager.AppConfigDir; } catch (ApplicationException e) { Logger.Write (LogLevel.Error, e.Message); return false; } if (app_config_file != null) appserver.AddApplicationsFromConfigFile (app_config_file); if (app_config_dir != null) appserver.AddApplicationsFromConfigDirectory (app_config_dir); if (applications == null && app_config_dir == null && app_config_file == null && !autoMap) { Logger.Write (LogLevel.Error, "There are no applications defined, and path mapping is disabled."); Logger.Write (LogLevel.Error, "Define an application using /applications, /appconfigfile, /appconfigdir"); /* Logger.Write (LogLevel.Error, "or by enabling application mapping with /automappaths=True."); */ return false; } return true; } public static bool TryCreateSocket (ConfigurationManager configurationManager, out Socket socket) { socket = null; // Socket strings are in the format // "type[:ARG1[:ARG2[:...]]]". var socket_type = configurationManager.Socket; Uri uri; if (Uri.TryCreate (socket_type, UriKind.Absolute, out uri)) { Logger.Write (LogLevel.Debug, "Parsed {0} as URI {1}", socket_type, uri); if (TryCreateSocketFromUri (uri, out socket)) { Logger.Write (LogLevel.Debug, "Created socket {0} from URI {1}", socket, uri); return true; } } string[] socket_parts = socket_type.Split (new [] { ':' }, 3); SocketCreator creator; return TryGetSocketCreator (socket_parts [0], out creator) && creator (configurationManager, socket_parts, out socket); } static bool TryCreateSocketFromUri (Uri uri, out Socket socket) { socket = null; switch (uri.Scheme) { case "pipe": return TryCreatePipe (out socket); case "unix": case "file": if (String.IsNullOrEmpty (uri.PathAndQuery)) throw new ArgumentException (String.Format ("Path is null in \"{0}\"", uri)); return TryCreateUnixSocket (uri.PathAndQuery, out socket, uri.UserInfo); case "tcp": return TryCreateTcpSocket (uri.Host, uri.Port, out socket); default: Logger.Write (LogLevel.Error, WRONG_KIND, uri.Scheme); return false; } } static bool TryGetSocketCreator (string socket_kind, out SocketCreator creator) { switch (socket_kind.ToLower ()) { case "pipe": creator = (ConfigurationManager configmanager, string[] socketParts, out Socket socket) => TryCreatePipe (out socket); return true; // The FILE sockets is of the format // "file[:PATH]". case "unix": case "file": creator = TryCreateUnixSocket; return true; // The TCP socket is of the format // "tcp[[:ADDRESS]:PORT]". case "tcp": creator = TryCreateTcpSocket; return true; default: Logger.Write (LogLevel.Error, WRONG_KIND, socket_kind); creator = null; return false; } } static bool TryGetRootDirectory (ConfigurationManager configurationManager, out string rootDir) { rootDir = configurationManager.Root; if (!String.IsNullOrEmpty (rootDir)) { try { Environment.CurrentDirectory = rootDir; } catch (Exception e) { Logger.Write (e); return false; } } rootDir = Environment.CurrentDirectory; Logger.Write (LogLevel.Debug, "Root directory: {0}", rootDir); return true; } static bool TryCreateTcpSocket (string ip, int port, out Socket socket) { socket = null; IPAddress address; if (!IPAddress.TryParse (ip, out address)) return false; socket = new TcpSocket (address, port); return true; } static bool TryCreateTcpSocket (ConfigurationManager configurationManager, string[] socketParts, out Socket socket) { socket = null; ushort port; try { if (socketParts.Length > 1) { if (!UInt16.TryParse (socketParts [socketParts.Length - 1], out port)) { Logger.Write (LogLevel.Error, "Error parsing port number"); return false; } } else { port = configurationManager.Port; } } catch (ApplicationException e) { Logger.Write (LogLevel.Error, e.Message); return false; } IPAddress address = configurationManager.Address; if (socketParts.Length == 3) { string address_str = socketParts [1]; if (address_str == null) address = IPAddress.Loopback; else if (!IPAddress.TryParse (address_str, out address)) { Logger.Write (LogLevel.Error, "Error in argument \"address\". \"{0}\" cannot be converted to an IP address.", address_str); return false; } } try { socket = new TcpSocket (address, port); } catch (System.Net.Sockets.SocketException e) { Logger.Write (LogLevel.Error, "Error creating the socket: {0}", e.Message); return false; } Logger.Write (LogLevel.Debug, "Listening on port: {0}", port); Logger.Write (LogLevel.Debug, "Listening on address: {0}", address); return true; } static bool TryCreateUnixSocket (ConfigurationManager configurationManager, string[] socketParts, out Socket socket) { string path = socketParts.Length == 2 ? socketParts [1] : configurationManager.Filename; return TryCreateUnixSocket (path, out socket); } public static bool TryCreateUnixSocket (string path, out Socket socket, string perm = null) { if (path == null) throw new ArgumentNullException ("path"); if (path.Length == 0) throw new ArgumentException ("path must not be empty", "path"); socket = null; try { string realPath; if (path.StartsWith ("\\0", StringComparison.Ordinal) && path.IndexOf ("\\0", 1, StringComparison.Ordinal) < 0) realPath = '\0' + path.Substring (2); else realPath = path; if (perm == null) { socket = new UnixSocket (realPath); Logger.Write (LogLevel.Debug, "Listening on file {0} with default permissions", realPath); } else { ushort uperm; if (!UInt16.TryParse (perm, out uperm)) { Logger.Write (LogLevel.Error, "Error parsing permissions \"{0}\". Use octal.", perm); return false; } uperm = Convert.ToUInt16 (uperm.ToString (), 8); socket = new UnixSocket (realPath, uperm); Logger.Write (LogLevel.Debug, "Listening on file {0} with permissions {1}", realPath, Convert.ToString (uperm, 8)); } } catch (System.Net.Sockets.SocketException e) { Logger.Write (LogLevel.Error, "Error creating the socket: {0}", e.Message); return false; } return true; } static bool TryCreatePipe (out Socket socket) { socket = null; try { socket = new UnmanagedSocket (IntPtr.Zero); } catch (System.Net.Sockets.SocketException e) { Logger.Write (LogLevel.Error, "Pipe socket is not bound."); Logger.Write (e); var errorcode = e.SocketErrorCode; Logger.Write (LogLevel.Debug, "Errorcode: {0}", errorcode); return false; } catch (NotSupportedException) { Logger.Write (LogLevel.Error, "Error: Pipe sockets are not supported on this system."); return false; } return true; } } } xsp-4.2/src/Mono.WebServer.FastCgi/UnknownTypeBody.cs0000664000175000017500000000326112627046413017512 00000000000000// // Record.cs: Represents the FastCGI BeginRequestBody structure. // // Author: // Brian Nickel (brian.nickel@gmail.com) // // Copyright (C) 2007 Brian Nickel // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.FastCgi { public struct UnknownTypeBody { #region Private Fields readonly RecordType type; #endregion #region Constructors public UnknownTypeBody (RecordType unknownType) { type = unknownType; } #endregion #region Public Methods public byte [] GetData () { // TODO: Investigate caching this var data = new byte [8]; data [0] = (byte) type; return data; } #endregion } } xsp-4.2/src/Mono.WebServer.Fpm/0000775000175000017500000000000012627055647013335 500000000000000xsp-4.2/src/Mono.WebServer.Fpm/ChildConfigurationManager.cs0000664000175000017500000000424112627046413020642 00000000000000// // ChildConfigurationManager.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.Options.Settings; namespace Mono.WebServer.Fpm { class ChildConfigurationManager : FastCgi.ConfigurationManager { readonly StringSetting user = new StringSetting ("user", String.Empty); readonly StringSetting group = new StringSetting ("group", String.Empty, defaultValue: "nobody"); readonly StringSetting shimSocket = new StringSetting ("shimsock", String.Empty); readonly EnumSetting instanceType = new EnumSetting("instance-type", "The kind of instance (static, ondemand or dynamic)", defaultValue:InstanceType.Ondemand); public string User { get { return user; } } public string Group { get { return group; } } public string ShimSocket { get { return shimSocket; } } public InstanceType InstanceType { get { return instanceType; } } public ChildConfigurationManager (string name) : base (name) { Add (user, group, shimSocket, instanceType); } } } xsp-4.2/src/Mono.WebServer.Fpm/Mono.WebServer.Fpm.sources0000664000175000017500000000026212627046413020205 00000000000000./ChildConfigurationManager.cs ./ChildInfo.cs ./ChildrenManager.cs ./ConfigurationManager.cs ./Connection.cs ./InstanceType.cs ./main.cs ./ProcessArgumentBuilder.cs ./Spawner.cs xsp-4.2/src/Mono.WebServer.Fpm/Makefile.in0000664000175000017500000003365612627055642015332 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/Mono.WebServer.Fpm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo.cs CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = $(top_builddir)/src/Mono.WebServer.Fpm datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MCSFLAGS = -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe+ -keyfile:$(top_srcdir)/src/mono.snk XSP_EXE = mono-fpm.exe GACUTIL4 = $(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:Mono.Posix.dll references = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll -r:../Mono.WebServer.FastCgi/fastcgi-mono-server4.exe sources = $(shell cat $(srcdir)/Mono.WebServer.Fpm.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in $(resources) Mono.WebServer.Fpm.sources all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.WebServer.Fpm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.WebServer.Fpm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile mono-fpm.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references) /out:$@ \ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/mono-fpm.exe uninstall-local: -for i in $(noinst_SCRIPTS) ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer.Fpm/ChildrenManager.cs0000664000175000017500000002217312627046413016623 00000000000000// // ChildrenManager.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.IO; using Mono.Unix; using Mono.WebServer.Log; using System.Diagnostics; using Mono.FastCgi; using Mono.WebServer.FastCgi; using System.Threading; using Mono.Unix.Native; namespace Mono.WebServer.Fpm { static class ChildrenManager { static readonly List children = new List(); public static void KillChildren() { foreach (ChildInfo child in children) { try { Process process = child.Process; if (process != null && !process.HasExited) process.Kill(); } catch (InvalidOperationException) { // Died between the if and the kill } } children.RemoveAll(child => child.Process != null && child.Process.HasExited); } public static void TermChildren() { foreach (ChildInfo child in children) { try { Process process = child.Process; if (process != null && !process.HasExited) { //TODO: Write some nice close code } } catch (InvalidOperationException) { // Died between the if and the kill } } children.RemoveAll (child => child.Process != null && child.Process.HasExited); } static void CreateAutomaticDirs (string fpmGroup, string httpdGroup, out string shimSocketDir, out string frontSocketDir, out string backSocketDir) { string socketDir = Path.Combine (Path.GetTempPath (), "mono-fpm-automatic"); CreateWithPerm (socketDir, "755"); shimSocketDir = Path.Combine (socketDir, "shim"); CreateWithPerm (shimSocketDir, "3733", fpmGroup); frontSocketDir = Path.Combine (socketDir, "front"); CreateWithPerm (frontSocketDir, "2730", httpdGroup); backSocketDir = Path.Combine (socketDir, "back"); CreateWithPerm (backSocketDir, "3733", fpmGroup); } public static void StartAutomaticChildren (IEnumerable webDirs, ConfigurationManager configurationManager) { if (webDirs == null) throw new ArgumentNullException ("webDirs"); if (configurationManager == null) throw new ArgumentNullException ("configurationManager"); string shimSocketDir; string frontSocketDir; string backSocketDir; CreateAutomaticDirs (configurationManager.FpmGroup, configurationManager.HttpdGroup, out shimSocketDir, out frontSocketDir, out backSocketDir); foreach (UnixDirectoryInfo directoryInfo in webDirs) { if (directoryInfo == null) continue; var user = directoryInfo.OwnerUser.UserName; var group = directoryInfo.OwnerGroup.GroupName; var dirname = directoryInfo.Name; if (directoryInfo.OwnerUserId < 100) { Logger.Write (LogLevel.Debug, "Directory {0} skipped because owned by {1}:{2} ({3}:{4})", dirname, user, group, directoryInfo.OwnerUserId, directoryInfo.OwnerGroupId); continue; // Skip non-user directories } string shimSocket = Path.Combine (shimSocketDir, dirname); string frontSocket = Path.Combine (frontSocketDir, dirname); string backSocket = Path.Combine (backSocketDir, dirname); Func spawner = () => Spawner.SpawnOndemandChild (shimSocket); UnixDirectoryInfo info = directoryInfo; Action spawnShim = () => Spawner.SpawnShim (configurationManager, shimSocket, info.FullName, backSocket); Spawner.RunAs (user, configurationManager.WebGroup, spawnShim) (); var child = new ChildInfo { Spawner = spawner, OnDemandSock = backSocket, Name = directoryInfo.FullName }; children.Add (child); PrepareAutomaticChild (configurationManager, frontSocket, child, 500); } } static void PrepareAutomaticChild (ConfigurationManager configurationManager, string frontSocket, ChildInfo child, uint backlog) { Socket socket; if (FastCgi.Server.TryCreateUnixSocket (frontSocket, out socket, "660")) { var server = new GenericServer (socket, child); server.Start (configurationManager.Stoppable, (int)backlog); } } static void CreateWithPerm (string path, string permissions, string groupName = null) { Directory.CreateDirectory (path); uint perm = Convert.ToUInt32(permissions, 8); Syscall.chmod (path, NativeConvert.ToFilePermissions (perm)); if (groupName == null) return; var group = new UnixGroupInfo (groupName); Syscall.chown (path, 0, (uint)group.GroupId); } public static void StartChildren(FileInfo[] configFiles, ConfigurationManager configurationManager) { if (configFiles == null) throw new ArgumentNullException ("configFiles"); if (configurationManager == null) throw new ArgumentNullException ("configurationManager"); foreach (FileInfo fileInfo in configFiles) { if (fileInfo == null) continue; var filename = fileInfo.Name; var childConfigurationManager = new ChildConfigurationManager ("child-" + filename); Logger.Write (LogLevel.Debug, "Loaded {0} [{1}]", filename, childConfigurationManager.InstanceType.ToString ().ToLowerInvariant ()); string fullFilename = fileInfo.FullName; if (!childConfigurationManager.TryLoadXmlConfig (fullFilename)) continue; var spawner = GetSpawner (configurationManager, filename, childConfigurationManager, fullFilename); var child = new ChildInfo { Spawner = spawner, OnDemandSock = childConfigurationManager.OnDemandSock, Name = fullFilename }; children.Add (child); PrepareChild (configurationManager, childConfigurationManager, fullFilename, child); } } static void PrepareChild (ConfigurationManager configurationManager, ChildConfigurationManager childConfigurationManager, string fullFilename, ChildInfo child) { if (childConfigurationManager.InstanceType == InstanceType.Static) { if (child.TrySpawn ()) { Logger.Write (LogLevel.Notice, "Started fastcgi daemon [static] with pid {0} and config file {1}", child.Process.Id, Path.GetFileName (fullFilename)); Thread.Sleep (500); // TODO: improve this (it's used to wait for the child to be ready) } else Logger.Write (LogLevel.Error, "Couldn't start child with config file {0}", fullFilename); } else { Socket socket; if (FastCgi.Server.TryCreateSocket (childConfigurationManager, out socket)) { var server = new GenericServer (socket, child); server.Start (configurationManager.Stoppable, (int)childConfigurationManager.Backlog); } } } static Func GetSpawner (ConfigurationManager configurationManager, string filename, ChildConfigurationManager childConfigurationManager, string configFile) { Func spawner; if (childConfigurationManager.InstanceType == InstanceType.Ondemand) { if (String.IsNullOrEmpty (childConfigurationManager.ShimSocket)) throw new Exception ("You must specify a socket for the shim"); spawner = () => Spawner.SpawnOndemandChild (childConfigurationManager.ShimSocket); } else spawner = () => Spawner.SpawnStaticChild (configFile, configurationManager.FastCgiCommand); Action spawnShim = () => Spawner.SpawnShim (configurationManager, childConfigurationManager.ShimSocket, configFile); string user = childConfigurationManager.User; string group = childConfigurationManager.Group; if (String.IsNullOrEmpty (user)) { if (Platform.IsUnix) { Logger.Write (LogLevel.Warning, "Configuration file {0} didn't specify username, defaulting to file owner", filename); string owner = UnixFileSystemInfo.GetFileSystemEntry (configFile).OwnerUser.UserName; if (childConfigurationManager.InstanceType == InstanceType.Ondemand) Spawner.RunAs (owner, group, spawnShim) (); else spawner = Spawner.RunAs (owner, group, spawner); } else { Logger.Write (LogLevel.Warning, "Configuration file {0} didn't specify username, defaulting to the current one", filename); if (childConfigurationManager.InstanceType != InstanceType.Ondemand) spawnShim (); } } else { if (childConfigurationManager.InstanceType == InstanceType.Ondemand) Spawner.RunAs (user, group, spawnShim) (); else spawner = Spawner.RunAs (user, group, spawner); } return spawner; } } } xsp-4.2/src/Mono.WebServer.Fpm/ConfigurationManager.cs0000664000175000017500000001026612627046413017702 00000000000000// // ConfigurationManager.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.WebServer.Options.Settings; using Mono.Unix; using System; using Mono.WebServer.Options; namespace Mono.WebServer.Fpm { class ConfigurationManager : Options.ConfigurationManager, IHelpConfigurationManager { #region Backing fields readonly BoolSetting stoppable = new BoolSetting ("stoppable", Descriptions.Stoppable); readonly UInt16Setting childIdleTime = new UInt16Setting ("child-idle-time", "Time to wait (in seconds) before stopping a child started with --web-dir", defaultValue: 60); readonly StringSetting configDir = new StringSetting ("config-dir|configdir", "Directory containing the configuration files."); readonly StringSetting fastCgiCommand = new StringSetting ("fastcgi-command", "Name (if in PATH) or full path of the fastcgi executable", defaultValue: "fastcgi-mono-server4"); readonly StringSetting shimCommand = new StringSetting ("shim-command", "Name (if in PATH) or full path of the shim executable", defaultValue: "shim"); readonly StringSetting fpmUser = new StringSetting ("fpm-user", "Name of the user to use for the fpm daemon", defaultValue: "fpm"); readonly StringSetting fpmGroup = new StringSetting ("fpm-group", "Name of the group to use for the fpm daemon", defaultValue: "fpm"); readonly StringSetting webDir = new StringSetting ("web-dir|webdir", "Directory containing the user web directories."); readonly StringSetting webGroup = new StringSetting ("web-group", "Name of the group to use for the web directories daemons", defaultValue: "nobody"); readonly StringSetting httpdGroup = new StringSetting ("httpd-group", "Name of the httpd group to use for the web sockets dir", defaultValue: HttpdEuristic ()); #endregion #region Typesafe properties public bool Stoppable { get { return stoppable; } } public ushort ChildIdleTime { get { return childIdleTime; } } public string ConfigDir { get { return configDir; } } public string FastCgiCommand { get { return fastCgiCommand; } } public string ShimCommand { get { return shimCommand; } } public string FpmUser { get { return fpmUser; } } public string FpmGroup { get { return fpmGroup; } } public string WebDir { get { return webDir; } } public string WebGroup { get { return webGroup; } } public string HttpdGroup { get { return httpdGroup; } } #endregion public string ProgramName { get { return "mono-fpm"; } } public string Description { get { return "mono-fpm is a FastCgi process manager."; } } public ConfigurationManager (string name) : base(name) { Add (stoppable, childIdleTime, configDir, fastCgiCommand, fpmUser, fpmGroup, webDir, webGroup, httpdGroup); } static readonly string[] knownHttpdGroups = {"www-data", "nginx", "apache2", "http", "www"}; static string HttpdEuristic () { if (Platform.IsUnix) foreach (string group in knownHttpdGroups) { try { new UnixGroupInfo (group); return group; } catch (ArgumentException) { } } return null; } } } xsp-4.2/src/Mono.WebServer.Fpm/InstanceType.cs0000664000175000017500000000243612627046413016206 00000000000000// // InstanceType.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Fpm { public enum InstanceType { Static, Ondemand } } xsp-4.2/src/Mono.WebServer.Fpm/AssemblyInfo.cs.in0000664000175000017500000000043512627046413016575 00000000000000using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("@XSP_VERSION@")] [assembly: AssemblyTitle("Mono.WebServer.Fpm")] [assembly: AssemblyDescription("FastCGI Process Manager for XSP")] [assembly: AssemblyCopyright("2013 Leonardo Taglialegne")] xsp-4.2/src/Mono.WebServer.Fpm/ChildInfo.cs0000664000175000017500000000665412627046413015445 00000000000000// // ChildInfo.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Diagnostics; using Mono.FastCgi; using Mono.WebServer.FastCgi; using Mono.WebServer.Log; using System.IO; using System.Threading; using Mono.Unix; namespace Mono.WebServer.Fpm { struct ChildInfo : IServerCallback { public string OnDemandSock { get; set; } public Process Process { get; private set; } public Func Spawner { get; set; } public string Name { get; set; } public bool TrySpawn () { Process = Spawner (); return Process != null && !Process.HasExited; } public Connection OnAccept (Socket socket) { if (socket == null) throw new ArgumentNullException ("socket"); Logger.Write (LogLevel.Debug, "ChildInfo.OnAccept"); if (Process == null || Process.HasExited) { if (TrySpawn ()) { var process = Process; int id = process.Id; Logger.Write (LogLevel.Notice, "Started fastcgi daemon [dynamic] with pid {0} and config file {1}", id, Path.GetFileName (Name)); process.EnableRaisingEvents = true; process.Exited += (sender, e) => Logger.Write (LogLevel.Notice, "Fastcgi daemon [dynamic] with pid {0} exited [it is {1}ly dead]", id, process.HasExited.ToString ().ToLowerInvariant ()); // Let the daemon start Thread.Sleep (300); } else throw new Exception ("Couldn't spawn child!"); } else Logger.Write (LogLevel.Debug, "Recycling child with pid {0}", Process.Id); Logger.Write (LogLevel.Debug, "Will connect to backend"); var onDemandSocket = new UnixClient (); Logger.Write (LogLevel.Debug, "Connecting to backend on {0}", OnDemandSock); if (OnDemandSock.StartsWith ("\\0", StringComparison.Ordinal)) onDemandSocket.Connect ('\0' + OnDemandSock.Substring (2)); else { Uri uri; if (Uri.TryCreate (OnDemandSock, UriKind.Absolute, out uri)) onDemandSocket.Connect (uri.PathAndQuery); else onDemandSocket.Connect (OnDemandSock); } SocketPassing.SendTo (onDemandSocket.Client.Handle, socket.Handle); Logger.Write (LogLevel.Debug, "Sent fd {0} via fd {1}", socket.Handle, onDemandSocket.Client.Handle); onDemandSocket.Close (); return new Connection (socket); } public override string ToString () { return string.Format ("[ChildInfo: Name={0}]", Name); } } } xsp-4.2/src/Mono.WebServer.Fpm/Spawner.cs0000664000175000017500000002130712627046413015215 00000000000000// // Spawner.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Diagnostics; using Mono.WebServer.Log; using System.Text; using Mono.WebServer.FastCgi; using Mono.Unix; using System.Net.Sockets; using Mono.WebServer.FastCgi.Compatibility; using System.IO; using MonoDevelop.Core.Execution; namespace Mono.WebServer.Fpm { static class Spawner { static readonly byte[] spawnString = Encoding.UTF8.GetBytes ("SPAWN\n"); static readonly BufferManager buffers = new BufferManager (100); public static Action RunAs(string user, string group, Action action) { if (user == null) throw new ArgumentNullException ("user"); if (action == null) throw new ArgumentNullException ("action"); return () => { try{ using (Platform.Impersonate (user, group)) action (); } catch (ArgumentException e) { Logger.Write (LogLevel.Error, "Couldn't run as {0} {1}!", user, group); Logger.Write (e); } }; } public static Func RunAs(string user, string group, Func action) { if (user == null) throw new ArgumentNullException ("user"); if (action == null) throw new ArgumentNullException ("action"); return () => { try{ using (Platform.Impersonate (user, group)) return action (); } catch (ArgumentException e) { Logger.Write (LogLevel.Error, "Couldn't run as {0} {1}!", user, group); Logger.Write (e); return default (T); } }; } public static Process SpawnStaticChild (string configFile, string fastCgiCommand) { if (configFile == null) throw new ArgumentNullException ("configFile"); if (configFile.Length == 0) throw new ArgumentException ("Config file name can't be empty", "configFile"); if (fastCgiCommand == null) throw new ArgumentNullException ("fastCgiCommand"); var process = new Process { StartInfo = new ProcessStartInfo { FileName = fastCgiCommand, Arguments = String.Format ("--configfile \"{0}\"", configFile), UseShellExecute = true } }; process.Start (); return process; } public static Process SpawnOndemandChild (string socketFile) { CompatArraySegment? torelease = null; try { Logger.Write (LogLevel.Debug, "Spawning via the shim {0}", socketFile); var client = new UnixClient (); client.Connect (socketFile); CompatArraySegment buffer = buffers.ClaimBuffer (); torelease = buffer; int receivedCount; using (NetworkStream socket = client.GetStream()) { socket.Write (spawnString, 0, spawnString.Length); receivedCount = socket.Read (buffer.Array, buffer.Offset, buffer.Count); if (receivedCount < 0) throw new Exception ("Didn't receive the child pid"); } string received = Encoding.UTF8.GetString (buffer.Array, buffer.Offset, receivedCount); string clean = received.Trim (); int pid; if (!Int32.TryParse (clean, out pid)) throw new Exception ("Couldn't parse the pid \"" + clean + "\""); if (pid < 0) throw new Exception ("Invalid pid: " + pid); return Process.GetProcessById (pid); } catch (Exception e) { Logger.Write (LogLevel.Error, "Error while talking to the shim for socket file {0}", socketFile); Logger.Write (e); return null; } finally { if (torelease != null) buffers.ReturnBuffer (torelease.Value); } } public static void SpawnShim (ConfigurationManager configurationManager, string socket, string configFile) { if (configurationManager == null) throw new ArgumentNullException ("configurationManager"); if (socket == null) throw new ArgumentNullException ("socket"); if (configFile == null) throw new ArgumentNullException ("configFile"); if (configFile.Length == 0) throw new ArgumentException ("Config file name can't be empty", "configFile"); var builder = new ProcessArgumentBuilder (); builder.AddSingle (socket, GetFastCgiCommand (configurationManager.FastCgiCommand)); builder.Add ("--ondemand"); builder.AddFormatSafe ("--configfile '{0}'", configFile); var arguments = builder.ToString(); var startInfo = new ProcessStartInfo { FileName = configurationManager.ShimCommand, Arguments = arguments, UseShellExecute = false }; if ((configurationManager.LogLevels & LogLevel.Debug) != LogLevel.None) startInfo.EnvironmentVariables.Add ("DEBUG", "y"); if (configurationManager.Verbose) startInfo.EnvironmentVariables.Add ("VERBOSE", "y"); var process = new Process { StartInfo = startInfo }; Logger.Write (LogLevel.Debug, "Spawning shim \"{0} {1}\"", configurationManager.ShimCommand, process.StartInfo.Arguments); process.Start (); } public static void SpawnShim (ConfigurationManager configurationManager, string shimSocket, string root, string onDemandSock) { if (configurationManager == null) throw new ArgumentNullException ("configurationManager"); if (shimSocket == null) throw new ArgumentNullException ("shimSocket"); if (root == null) throw new ArgumentNullException ("root"); if (onDemandSock == null) throw new ArgumentNullException ("onDemandSock"); var arguments = BuildArguments (configurationManager, shimSocket, root, onDemandSock); var startInfo = new ProcessStartInfo { FileName = configurationManager.ShimCommand, Arguments = arguments, UseShellExecute = false }; if ((configurationManager.LogLevels & LogLevel.Debug) != LogLevel.None) startInfo.EnvironmentVariables.Add ("DEBUG", "y"); if (configurationManager.Verbose) startInfo.EnvironmentVariables.Add ("VERBOSE", "y"); var process = new Process { StartInfo = startInfo }; Logger.Write (LogLevel.Debug, "Spawning shim \"{0} {1}\"", configurationManager.ShimCommand, process.StartInfo.Arguments); process.Start (); } static string GetFastCgiCommand (string filename) { if (filename == null) throw new ArgumentNullException ("filename"); if (filename.Length == 0) throw new ArgumentException ("Filename can't be null for the fastcgi command", "filename"); if (filename.StartsWith (Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) return filename; if (filename.Contains (Path.DirectorySeparatorChar.ToString())) return Path.Combine (Environment.CurrentDirectory, filename); string paths = Environment.GetEnvironmentVariable ("PATH"); foreach (var path in paths.Split(Path.PathSeparator)) { string combined = Path.Combine (path, filename); if (File.Exists (combined) && IsExecutable (combined)) return combined; } throw new ArgumentException (String.Format ("Couldn't find fastcgi executable at {0}", filename), "filename"); } static bool IsExecutable (string path) { return Platform.IsUnix ? new UnixFileInfo (path).CanAccess (Mono.Unix.Native.AccessModes.X_OK) : path.EndsWith (".exe", StringComparison.Ordinal); } static string BuildArguments (ConfigurationManager configurationManager, string shimSocket, string root, string onDemandSock) { var builder = new ProcessArgumentBuilder (); builder.AddSingle (shimSocket, GetFastCgiCommand (configurationManager.FastCgiCommand)); if (configurationManager.Verbose) builder.Add ("--verbose"); builder.Add ("--ondemand"); builder.AddFormatSafe ("--applications /:'{0}'", root); builder.Add ("--idle-time", configurationManager.ChildIdleTime); builder.AddFormatSafe ("--ondemandsock 'unix://660@{0}'", onDemandSock); builder.AddFormat ("--loglevels {0}", configurationManager.LogLevels); builder.AddFormatSafe ("--name '{0}'", Path.GetFileName (root)); var arguments = builder.ToString (); return arguments; } } } xsp-4.2/src/Mono.WebServer.Fpm/Connection.cs0000664000175000017500000000336112627046413015675 00000000000000// // Connection.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using Mono.WebServer.FastCgi; using Mono.FastCgi; using Mono.WebServer.Log; namespace Mono.WebServer.Fpm { public class Connection : IConnection { readonly Socket socket; public event EventHandler RequestReceived; public Connection (Socket socket) { if (socket == null) throw new ArgumentNullException ("socket"); this.socket = socket; } public void Run () { } public void Stop () { try { if (socket.Connected) socket.Close (); } catch (Exception e) { Logger.Write (e); } } } } xsp-4.2/src/Mono.WebServer.Fpm/ProcessArgumentBuilder.cs0000664000175000017500000001514012627046413020224 00000000000000// // ProcessArgumentBuilder.cs // // Author: // Michael Hutchinson // // Copyright (c) 2010 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Text; using System.Collections.Generic; using System.Linq; namespace MonoDevelop.Core.Execution { /// /// Builds a process argument string. /// public class ProcessArgumentBuilder { readonly StringBuilder sb = new StringBuilder (); public string ProcessPath { get; private set; } // .NET doesn't allow escaping chars other than " and \ inside " quotes const string ESCAPE_DOUBLE_QUOTE_CHARS_STR = "\\\""; public ProcessArgumentBuilder () { } public ProcessArgumentBuilder (string processPath) { ProcessPath = processPath; } /// /// Adds an argument without escaping or quoting. /// public void Add (object argument) { if (sb.Length > 0) sb.Append (' '); sb.Append (argument); } /// /// Adds multiple arguments without escaping or quoting. /// public void Add (params object[] args) { foreach (var a in args) Add (a); } public void AddSingle (params string[] args) { foreach (var a in args) AddFormat ("'{0}'", a); } public void AddFormat (string argumentFormat, params object[] values) { Add (string.Format (argumentFormat, values)); } public void AddFormatSafe (string argumentFormat, params string[] values) { Add (string.Format (argumentFormat, values.Select (QuoteSingleQuotes).ToArray ())); } static string QuoteSingleQuotes (string val) { return val.IndexOf ('\'') < 0 ? val : val.Replace ("'", "\\'"); } /// /// Adds a formatted argument, quoting and escaping as necessary. /// public void AddQuotedFormat (string argumentFormat, params object[] values) { AddQuoted (string.Format (argumentFormat, values)); } public void AddQuotedFormat (string argumentFormat, object val0) { AddQuoted (string.Format (argumentFormat, val0)); } /// Adds an argument, quoting and escaping as necessary. /// The .NET process class does not support escaped /// arguments, only quoted arguments with escaped quotes. public void AddQuoted (string argument) { if (argument == null) return; if (sb.Length > 0) sb.Append (' '); sb.Append ('"'); AppendEscaped (sb, ESCAPE_DOUBLE_QUOTE_CHARS_STR, argument); sb.Append ('"'); } /// /// Adds multiple arguments, quoting and escaping each as necessary. /// public void AddQuoted (params string[] args) { foreach (var a in args) AddQuoted (a); } /// Quotes a string, escaping if necessary. /// The .NET process class does not support escaped /// arguments, only quoted arguments with escaped quotes. public static string Quote (string s) { var sb = new StringBuilder (); sb.Append ('"'); AppendEscaped (sb, ESCAPE_DOUBLE_QUOTE_CHARS_STR, s); sb.Append ('"'); return sb.ToString (); } public override string ToString () { return sb.ToString (); } static void AppendEscaped (StringBuilder sb, string escapeChars, string s) { for (int i = 0; i < s.Length; i++) { char c = s[i]; if (escapeChars.IndexOf (c) > -1) sb.Append ('\\'); sb.Append (c); } } static string GetArgument (StringBuilder builder, string buf, int startIndex, out int endIndex, out Exception ex) { bool escaped = false; char qchar, c = '\0'; int i = startIndex; builder.Clear (); switch (buf[startIndex]) { case '\'': qchar = '\''; i++; break; case '"': qchar = '"'; i++; break; default: qchar = '\0'; break; } while (i < buf.Length) { c = buf[i]; if (c == qchar && !escaped) { // unescaped qchar means we've reached the end of the argument i++; break; } if (c == '\\') { escaped = true; } else if (escaped) { builder.Append (c); escaped = false; } else if (qchar == '\0' && (c == ' ' || c == '\t')) { break; } else if (qchar == '\0' && (c == '\'' || c == '"')) { string sofar = builder.ToString (); string embedded; if ((embedded = GetArgument (builder, buf, i, out endIndex, out ex)) == null) return null; i = endIndex; builder.Clear (); builder.Append (sofar); builder.Append (embedded); continue; } else { builder.Append (c); } i++; } if (escaped || (qchar != '\0' && c != qchar)) { ex = new FormatException (escaped ? "Incomplete escape sequence." : "No matching quote found."); endIndex = -1; return null; } endIndex = i; ex = null; return builder.ToString (); } static bool TryParse (string commandline, out string[] argv, out Exception ex) { var builder = new StringBuilder (); var args = new List (); string argument; int i = 0, j; char c; while (i < commandline.Length) { c = commandline[i]; if (c != ' ' && c != '\t') { if ((argument = GetArgument (builder, commandline, i, out j, out ex)) == null) { argv = null; return false; } args.Add (argument); i = j; } i++; } argv = args.ToArray (); ex = null; return true; } public static bool TryParse (string commandline, out string[] argv) { Exception ex; return TryParse (commandline, out argv, out ex); } public static string[] Parse (string commandline) { string[] argv; Exception ex; if (!TryParse (commandline, out argv, out ex)) throw ex; return argv; } } } xsp-4.2/src/Mono.WebServer.Fpm/Makefile.am0000664000175000017500000000210112627054433015273 00000000000000builddir=$(top_builddir)/src/Mono.WebServer.Fpm MCSFLAGS= -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -unsafe+ -keyfile:$(top_srcdir)/src/mono.snk XSP_EXE = mono-fpm.exe GACUTIL4=$(GACUTIL) -package 4.5 noinst_SCRIPTS = $(XSP_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Security.dll -r:Mono.Posix.dll references = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll -r:../Mono.WebServer.FastCgi/fastcgi-mono-server4.exe sources = $(shell cat $(srcdir)/Mono.WebServer.Fpm.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in $(resources) Mono.WebServer.Fpm.sources mono-fpm.exe: $(build_sources) $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references) /out:$@ \ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/mono-fpm.exe uninstall-local: -for i in $(noinst_SCRIPTS) ; do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done xsp-4.2/src/Mono.WebServer.Fpm/main.cs0000664000175000017500000001226012627046413014520 00000000000000// // main.cs: // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Reflection; using Mono.WebServer.Log; using Mono.WebServer.Options; using System.Threading; using Mono.Unix; using System.Linq; using System.Collections.Generic; namespace Mono.WebServer.Fpm { public static class Server { public static int Main (string [] args) { var configurationManager = new ConfigurationManager ("mono-fpm"); if (!configurationManager.LoadCommandLineArgs (args)) return 1; // Show the help and exit. if (configurationManager.Help) { configurationManager.PrintHelp (); #if DEBUG Console.WriteLine ("Press any key..."); Console.ReadKey (); #endif return 0; } // Show the version and exit. if (configurationManager.Version) { Version.Show (); return 0; } if (!configurationManager.LoadConfigFile ()) return 1; configurationManager.SetupLogger (); #if DEBUG // Log everything while debugging Logger.Level = LogLevel.All; #endif Logger.Write (LogLevel.Debug, Assembly.GetExecutingAssembly ().GetName ().Name); string configDir = configurationManager.ConfigDir; string webDir = configurationManager.WebDir; if (String.IsNullOrEmpty (configDir) && (!Platform.IsUnix || String.IsNullOrEmpty (webDir))) { if(Platform.IsUnix) Logger.Write (LogLevel.Error, "You MUST provide a configuration directory with the --config-dir parameter or web directories with the --web-dir parameter."); else Logger.Write (LogLevel.Error, "You MUST provide a configuration directory with the --config-dir parameter."); return 1; } if (!String.IsNullOrEmpty (configDir)) { var configDirInfo = new DirectoryInfo (configDir); if (!configDirInfo.Exists) { Logger.Write (LogLevel.Error, "The configuration directory \"{0}\" does not exist!", configDir); } else { Logger.Write (LogLevel.Debug, "Configuration directory {0} exists, loading configuration files", configDir); FileInfo[] configFiles = configDirInfo.GetFiles ("*.xml"); ChildrenManager.StartChildren (configFiles, configurationManager); } } if (Platform.IsUnix && !String.IsNullOrEmpty (webDir)) { var webDirInfo = new UnixDirectoryInfo (Path.GetFullPath (webDir)); if (!webDirInfo.Exists) { Logger.Write (LogLevel.Error, "The web directory \"{0}\" does not exist!", webDir); } else { Logger.Write (LogLevel.Debug, "Web directory {0} exists, starting children", webDir); IEnumerable webDirs = from entry in webDirInfo.GetFileSystemEntries () let dir = entry as UnixDirectoryInfo where dir != null select dir; if (configurationManager.HttpdGroup == null) { Logger.Write (LogLevel.Error, "Couldn't autodetect the httpd group, you must specify it explicitly with --httpd-group"); return 1; } if (!CheckGroupExists (configurationManager.FpmGroup) || !CheckGroupExists (configurationManager.HttpdGroup) || !CheckUserExists (configurationManager.FpmUser)) return 1; ChildrenManager.StartAutomaticChildren (webDirs, configurationManager); } } Platform.SetIdentity (configurationManager.FpmUser, configurationManager.FpmGroup); if (!configurationManager.Stoppable) { var sleep = new ManualResetEvent (false); sleep.WaitOne (); // Do androids dream of electric sheep? } Console.WriteLine ("Hit Return to stop the server."); Console.ReadLine (); ChildrenManager.TermChildren(); ChildrenManager.KillChildren(); return 0; } static bool CheckUserExists (string user) { try { new UnixUserInfo (user); return true; } catch (ArgumentException) { Logger.Write (LogLevel.Error, "User {0} doesn't exist, but it's needed for automatic mode", user); return false; } } static bool CheckGroupExists (string group) { try { new UnixGroupInfo (group); return true; } catch (ArgumentException) { Logger.Write (LogLevel.Error, "Group {0} doesn't exist, but it's needed for automatic mode", group); return false; } } } } xsp-4.2/src/Makefile.am0000664000175000017500000000031512627046413011743 00000000000000if XSP_ONLY SUBDIRS=Mono.WebServer Mono.WebServer.XSP else SUBDIRS=Mono.WebServer Mono.WebServer.XSP Mono.WebServer.Apache Mono.WebServer.FastCgi Mono.WebServer.Fpm endif EXTRA_DIST = mono.pub mono.snk xsp-4.2/src/Mono.WebServer.Apache/0000775000175000017500000000000012627055647013774 500000000000000xsp-4.2/src/Mono.WebServer.Apache/ChangeLog0000664000175000017500000000175312627046413015463 000000000000002010-06-02 Marek Habersack * ModMonoWorkerRequest.cs: avoid double handle close when sending response from a file in certain cases. 2010-04-13 Marek Habersack * ModMonoRequest.cs: SendResponseFromMemory must advance the pointer when not on Linux. 2010-03-31 Marek Habersack * main.cs: added --pidfile argument, which puts mod-mono-server's PID in the specified file. 2010-03-09 Marek Habersack * ModMonoRequest.cs: better fix for bug #580086. Patch from Asgeir Halldorsson , thanks! 2010-03-01 Marek Habersack * main.cs: added some documentation on RealMain. Added code to make sure single app mode is not used when running a non-stop server. In single app mode, when ThreadAbortException is thrown, make sure to shutdown up all the accepted sockets, or we'll end up with sockets with filled receive/send queues. xsp-4.2/src/Mono.WebServer.Apache/ModMonoConfig.cs0000664000175000017500000000317012627046413016731 00000000000000// // Mono.WebServer.ModMonoConfig // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Apache { struct ModMonoConfig { bool outputBuffering; public bool Changed { get; set; } public bool OutputBuffering { get { return outputBuffering; } set { Changed |= (value != outputBuffering); outputBuffering = value; } } } } xsp-4.2/src/Mono.WebServer.Apache/ModMonoApplicationHost.cs0000664000175000017500000001031012627046413020617 00000000000000// // Mono.WebServer.ModMonoApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Security.Cryptography.X509Certificates; namespace Mono.WebServer { // // ModMonoApplicationHost: The application host for mod_mono. // public class ModMonoApplicationHost : BaseApplicationHost { static byte[] FromPEM (string pem) { int start = pem.IndexOf ("-----BEGIN CERTIFICATE-----"); if (start < 0) return null; start += 27; // 27 being the -----BEGIN CERTIFICATE----- length int end = pem.IndexOf ("-----END CERTIFICATE-----", start); if (end < start) return null; string base64 = pem.Substring (start, (end - start)); return Convert.FromBase64String (base64); } public void ProcessRequest (int reqId, string verb, string queryString, string path, string protocol, string localAddress, int serverPort, string remoteAddress, int remotePort, string remoteName, string [] headers, string [] headerValues, object worker) { ModMonoWorkerRequest mwr = null; try { if (reqId > -1) { mwr = new ModMonoWorkerRequest (reqId, (ModMonoRequestBroker) RequestBroker, this, verb, path, queryString, protocol, localAddress, serverPort, remoteAddress, remotePort, remoteName, headers, headerValues); } else { mwr = new ModMonoWorkerRequest (worker, this, verb, path, queryString, protocol, localAddress, serverPort, remoteAddress, remotePort, remoteName, headers, headerValues); } if (mwr.IsSecure ()) { // note: we're only setting what we use (and not the whole lot) mwr.AddServerVariable ("CERT_KEYSIZE", mwr.GetServerVariable (reqId, "SSL_CIPHER_USEKEYSIZE")); mwr.AddServerVariable ("CERT_SECRETKEYSIZE", mwr.GetServerVariable (reqId, "SSL_CIPHER_ALGKEYSIZE")); string pem_cert = mwr.GetServerVariable (reqId, "SSL_CLIENT_CERT"); // 52 is the minimal PEM size for certificate header/footer if ((pem_cert != null) && (pem_cert.Length > 52)) { byte[] certBytes = FromPEM (pem_cert); mwr.SetClientCertificate (certBytes); // check client certificate validity with Apache and/or Mono if (mwr.IsClientCertificateValid (certBytes)) { // client cert present (bit0 = 1) and valid (bit1 = 0) mwr.AddServerVariable ("CERT_FLAGS", "1"); } else { // client cert present (bit0 = 1) but invalid (bit1 = 1) mwr.AddServerVariable ("CERT_FLAGS", "3"); } } else { mwr.AddServerVariable ("CERT_FLAGS", "0"); } pem_cert = mwr.GetServerVariable (reqId, "SSL_SERVER_CERT"); // 52 is the minimal PEM size for certificate header/footer if ((pem_cert != null) && (pem_cert.Length > 52)) { byte[] certBytes = FromPEM (pem_cert); var cert = new X509Certificate (certBytes); mwr.AddServerVariable ("CERT_SERVER_ISSUER", cert.Issuer); mwr.AddServerVariable ("CERT_SERVER_SUBJECT", cert.Subject); } } } catch (Exception) { EndOfRequest (mwr); throw; } ProcessRequest (mwr); } } } xsp-4.2/src/Mono.WebServer.Apache/ModMonoTCPWebSource.cs0000664000175000017500000000530512627046413017773 00000000000000// // Mono.WebServer.ModMonoTCPWebSource // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) Copyright 2004 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Net; using System.Net.Sockets; using Mono.WebServer.Log; namespace Mono.WebServer { public class ModMonoTCPWebSource: ModMonoWebSource { IPEndPoint bindAddress; public ModMonoTCPWebSource (IPAddress address, int port, string lockfile) : base (lockfile) { if (address == IPAddress.Any) address = IPAddress.Loopback; SetListenAddress (address, port); } public void SetListenAddress (int port) { SetListenAddress (IPAddress.Any, port); } public void SetListenAddress (IPAddress address, int port) { SetListenAddress (new IPEndPoint (address, port)); } public void SetListenAddress (IPEndPoint bindAddress) { if (bindAddress == null) throw new ArgumentNullException ("bindAddress"); this.bindAddress = bindAddress; } public override bool GracefulShutdown () { EndPoint ep = bindAddress; var sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); try { sock.Connect (ep); } catch (Exception e) { Logger.Write (LogLevel.Error, "Cannot connect to {0}: {1}", ep, e.Message); return false; } return SendShutdownCommandAndClose (sock); } public override Socket CreateSocket () { if (bindAddress == null) throw new InvalidOperationException ("No address/port to listen"); var listen_socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); listen_socket.Bind (bindAddress); return listen_socket; } } } xsp-4.2/src/Mono.WebServer.Apache/ModMonoCmd.cs0000664000175000017500000000327112627046413016231 00000000000000// // Mono.WebServer.ModMonoCmd // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // namespace Mono.WebServer.Apache { enum ModMonoCmd { FIRST_COMMAND, SEND_FROM_MEMORY = 0, GET_SERVER_VARIABLES, SET_RESPONSE_HEADERS, GET_LOCAL_PORT, CLOSE, SHOULD_CLIENT_BLOCK, SETUP_CLIENT_BLOCK, GET_CLIENT_BLOCK, SET_STATUS, DECLINE_REQUEST, NOT_FOUND, IS_CONNECTED, SEND_FILE, SET_CONFIGURATION, LAST_COMMAND } } xsp-4.2/src/Mono.WebServer.Apache/ModMonoRequest.cs0000664000175000017500000003455712627046413017171 00000000000000// // ModMonoRequest.cs // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2009 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections; using System.IO; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Text; using System.Collections.Generic; using Mono.WebServer.Apache; using Mono.WebServer.Log; namespace Mono.WebServer { public class ModMonoRequest : IDisposable { const int MAX_STRING_SIZE = 1024 * 10; const int INITIAL_MEMORY_STREAM_SIZE = 1024 * 2; const int MAX_MEMORY_STREAM_SIZE = 1024 * 128; readonly BinaryReader reader; readonly BinaryWriter writer; readonly MemoryStream reader_ms; readonly MemoryStream writer_ms; byte[] fill_buffer; bool got_server_vars; readonly Dictionary serverVariables; string verb; string queryString; string protocol; string uri; string vServerName; string localAddress; string remoteAddress; string remoteName; int localPort; int remotePort; int serverPort; bool setupClientBlockCalled; Dictionary headers; int clientBlock; StringBuilder out_headers = new StringBuilder (); string physical_path; ModMonoConfig mod_mono_config; readonly Socket client; readonly static bool use_libc; public bool HeadersSent { get; private set; } public bool ShuttingDown { get; private set; } static ModMonoRequest () { if (Environment.GetEnvironmentVariable ("XSP_NO_LIBC") != null) return; try { string os = File.ReadAllText ("/proc/sys/kernel/ostype"); use_libc = os.StartsWith ("Linux"); } catch { } } public ModMonoRequest (Socket client) { mod_mono_config.OutputBuffering = true; this.client = client; reader_ms = new MemoryStream (INITIAL_MEMORY_STREAM_SIZE); writer_ms = new MemoryStream (INITIAL_MEMORY_STREAM_SIZE); reader = new BinaryReader (reader_ms); writer = new BinaryWriter (writer_ms); serverVariables = new Dictionary (StringComparer.OrdinalIgnoreCase); GetInitialData (); } static void Dispose (Action disposer, string name) { if (disposer == null) return; try { disposer (); } catch (Exception ex) { Logger.Write (LogLevel.Error, "While disposing ModMonoRequest. {0} disposing failed with exception:", name); Logger.Write (ex); } } public void Dispose () { fill_buffer = null; Dispose (() => { if (headers != null) headers.Clear (); }, "headers"); Dispose (() => { if (reader != null) ((IDisposable)reader).Dispose (); }, "reader"); Dispose (() => { if (reader_ms != null) reader_ms.Dispose (); }, "reader_ms"); Dispose (() => { if (writer != null) ((IDisposable)writer).Dispose (); }, "writer"); Dispose (() => { if (writer_ms != null) writer_ms.Dispose (); }, "writer_ms"); GC.SuppressFinalize (this); } void FillBuffer (uint count) { if (count == 0) return; // This will "reset" the stream reader_ms.SetLength (0); reader_ms.Position = 0; var read_count = (int)count; int fill_buffer_length = fill_buffer == null ? 0 : fill_buffer.Length; if ((uint)fill_buffer_length < count) { if (fill_buffer == null && count <= INITIAL_MEMORY_STREAM_SIZE) { // Use slightly more memory initially, but save on time. fill_buffer = new byte [INITIAL_MEMORY_STREAM_SIZE]; } else if (fill_buffer_length < MAX_MEMORY_STREAM_SIZE) { fill_buffer = new byte [System.Math.Min (count, MAX_MEMORY_STREAM_SIZE)]; read_count = fill_buffer.Length; } else read_count = fill_buffer_length; } int total_received = 0; int received; do { received = client.Receive (fill_buffer, read_count, SocketFlags.None); total_received += received; } while (received == read_count && total_received < count && client.Available > 0); reader_ms.Write (fill_buffer, 0, received); reader_ms.Seek (0, SeekOrigin.Begin); } void Send () { int sent = client.Send (writer_ms.GetBuffer (), (int) writer_ms.Length, SocketFlags.None); if (sent != (int) writer_ms.Length) throw new IOException ("Blocking send did not send entire buffer"); writer_ms.Position = 0; writer_ms.SetLength (0); } // KEEP IN SYNC WITH mod_mono.h!! const byte PROTOCOL_VERSION = 9; void GetInitialData () { FillBuffer (5); byte cmd = reader.ReadByte (); ShuttingDown = (cmd == 0); if (ShuttingDown) { Logger.Write (LogLevel.Notice, "mod-mono-server received a shutdown message"); return; } if (cmd != PROTOCOL_VERSION) { string msg = String.Format ("mod_mono and xsp have different versions. Expected '{0}', got {1}", PROTOCOL_VERSION, cmd); Logger.Write (LogLevel.Error, msg); throw new InvalidOperationException (msg); } Int32 dataSize = reader.ReadInt32 (); FillBuffer ((uint)dataSize); verb = ReadString (); vServerName = ReadString (); uri = ReadString (); queryString = ReadString (); protocol = ReadString (); localAddress = ReadString (); serverPort = reader.ReadInt32 (); remoteAddress = ReadString (); remotePort = reader.ReadInt32 (); remoteName = ReadString (); reader.ReadInt32 (); // This is autoApp!!! (unused!? int nheaders = reader.ReadInt32 (); headers = new Dictionary (StringComparer.OrdinalIgnoreCase); for (int i = 0; i < nheaders; i++) { string key = ReadString (); if (String.IsNullOrEmpty (key)) continue; if (headers.ContainsKey (key)) { Logger.Write (LogLevel.Warning, "Duplicate header '{0}' found! Overwriting old value with the new one.", key); headers [key] = ReadString (); } else headers.Add (key, ReadString ()); } if (reader.ReadByte () != 0) physical_path = ReadString (); } string ReadString () { int size = reader.ReadInt32 (); if (size < 0 || size > MAX_STRING_SIZE) throw new ArgumentOutOfRangeException ("size", "Abnormal string size " + size); var buf = new byte [size]; if (size == 0) return String.Empty; int chunk; int total = 0; do { chunk = reader.Read (buf, total, size - total); if (chunk == 0) throw new IOException ("Lost connection with mod_mono"); if (chunk > 0) total += chunk; } while ((chunk > 0 && total < size)); return Encoding.UTF8.GetString (buf); } void WriteString (string s) { byte [] bytes = Encoding.UTF8.GetBytes (s); writer.Write (bytes.Length); writer.Write (bytes); } public void Decline () { writer.Write ((int) ModMonoCmd.DECLINE_REQUEST); Send (); } public void NotFound () { writer.Write ((int) ModMonoCmd.NOT_FOUND); Send (); } public string GetProtocol () { return protocol; } public string GetHttpVerbName () { return verb; } public void SendResponseFromMemory (IntPtr ptr, int length) { BufferConfig (); BufferHeaders (); writer.Write ((int) ModMonoCmd.SEND_FROM_MEMORY); writer.Write (length); Send (); if (use_libc) { int sent = Send (ptr, length); if (sent != length) throw new IOException ("Blocking send did not send entire buffer"); return; } while (length > 0) { if (writer_ms.Position != 0) throw new Exception ("Should not happen... We called Send()!"); int size = System.Math.Min (16384, length); if (writer_ms.Capacity < size) writer_ms.Capacity = size; byte [] buf = writer_ms.GetBuffer (); Marshal.Copy (ptr, buf, 0, size); length -= size; unsafe { ptr = (IntPtr)((byte*)ptr.ToPointer () + size); } int sent = client.Send (buf, size, SocketFlags.None); if (sent != size) throw new IOException ("Blocking send did not send entire buffer"); } } // FIXME: the return value is never used unsafe int Send (IntPtr ptr, int len) { int total = 0; var bptr = (byte *) ptr.ToPointer (); while (total < len) { // 0x4000 no sigpipe int n = send_libc (client.Handle.ToInt32 (), bptr + total, (IntPtr) (len - total), 0x4000); if (n >= 0) { total += n; } else if (Marshal.GetLastWin32Error () != 4 /* EINTR */) { throw new IOException (); } } return total; } [DllImport ("libc", SetLastError=true, EntryPoint="send")] unsafe extern static int send_libc (int s, byte *buffer, IntPtr len, int flags); public void SendResponseFromMemory (byte [] data, int position, int length) { BufferConfig (); BufferHeaders (); writer.Write ((int) ModMonoCmd.SEND_FROM_MEMORY); writer.Write (length); Send (); int sent = client.Send (data, position, length, SocketFlags.None); if (sent != length) throw new IOException ("Blocking send did not send entire buffer"); } public void SendFile (string filename) { BufferConfig (); BufferHeaders (); writer.Write ((int) ModMonoCmd.SEND_FILE); WriteString (filename); Send (); } void BufferConfig () { if (!mod_mono_config.Changed) return; mod_mono_config.Changed = false; writer.Write ((int) ModMonoCmd.SET_CONFIGURATION); writer.Write (Convert.ToByte (mod_mono_config.OutputBuffering)); } void BufferHeaders () { if (HeadersSent) return; writer.Write ((int) ModMonoCmd.SET_RESPONSE_HEADERS); WriteString (out_headers.ToString ()); out_headers = null; HeadersSent = true; } public void SetResponseHeader (string name, string value) { if (!HeadersSent) out_headers.AppendFormat ("{0}\0{1}\0", name, value); } public void SetOutputBuffering (bool doBuffer) { mod_mono_config.OutputBuffering = doBuffer; } public string [] GetAllHeaders () { ICollection k = headers.Keys; var keys = new string [k.Count]; k.CopyTo (keys, 0); return keys; } public string [] GetAllHeaderValues () { ICollection v = headers.Values; var values = new string [v.Count]; v.CopyTo (values, 0); return values; } public string GetRequestHeader (string name) { if (headers.ContainsKey (name)) return headers [name]; return null; } void GetServerVariables () { writer.Write ((int) ModMonoCmd.GET_SERVER_VARIABLES); Send (); FillBuffer (4); int blockSize = reader.ReadInt32 (); FillBuffer ((uint)blockSize); int nvars = reader.ReadInt32 (); while (nvars > 0) { string key = ReadString (); nvars--; if (String.IsNullOrEmpty (key)) continue; if (serverVariables.ContainsKey (key)) { Logger.Write(LogLevel.Warning, "Duplicate server variable '{0}' found. Overwriting old value with the new one.", key); serverVariables [key] = ReadString (); } else serverVariables.Add (key, ReadString ()); } got_server_vars = true; } public string GetServerVariable (string name) { if (!got_server_vars) GetServerVariables (); if (serverVariables.ContainsKey (name)) return serverVariables [name]; return null; } public string GetPhysicalPath () { return physical_path; } public string GetUri () { return uri; } public string GetVirtualServerName () { return vServerName; } public string GetQueryString () { return queryString; } // May be different from Connection.GetLocalPort depending on Apache configuration, // for things like self referential URLs, etc. public int GetServerPort () { return serverPort; } public string GetRemoteAddress () { return remoteAddress; } public string GetRemoteName () { return remoteName; } public string GetLocalAddress () { return localAddress; } public int GetLocalPort () { if (localPort != 0) return localPort; writer.Write ((int) ModMonoCmd.GET_LOCAL_PORT); Send (); FillBuffer (4); localPort = reader.ReadInt32 (); return localPort; } public int GetRemotePort () { return remotePort; } public void Close () { BufferHeaders (); writer.Write ((int) ModMonoCmd.CLOSE); Send (); } public int SetupClientBlock () { if (setupClientBlockCalled) return clientBlock; BufferConfig (); setupClientBlockCalled = true; writer.Write ((int) ModMonoCmd.SETUP_CLIENT_BLOCK); Send (); FillBuffer (4); int i = reader.ReadInt32 (); clientBlock = i; return i; } public bool IsConnected () { writer.Write ((int) ModMonoCmd.IS_CONNECTED); Send (); FillBuffer (4); int i = reader.ReadInt32 (); return (i != 0); } public bool ShouldClientBlock () { writer.Write ((int) ModMonoCmd.SHOULD_CLIENT_BLOCK); Send (); FillBuffer (4); int i = reader.ReadInt32 (); return (i == 0); } public int GetClientBlock ([Out] byte [] bytes, int position, int size) { if (SetupClientBlock () != 0) return 0; /* * turns out that that GET_CLIENT_BLOCK (ap_get_client_block) can * return -1 if a socket is closed */ writer.Write ((int) ModMonoCmd.GET_CLIENT_BLOCK); writer.Write (size); Send (); FillBuffer (4); int i = reader.ReadInt32 (); if (i == -1) return -1; if (i > size) throw new Exception ("Houston..."); FillBuffer ((uint)i); return reader.Read (bytes, position, i); } public void SetStatusCodeLine (int code, string status) { writer.Write ((int) ModMonoCmd.SET_STATUS); writer.Write (code); WriteString (status); Send (); } } } xsp-4.2/src/Mono.WebServer.Apache/Makefile.in0000664000175000017500000003401212627055642015754 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @PLATFORM_WIN32_TRUE@am__append_1 = -lib:"$(prefix)/lib" subdir = src/Mono.WebServer.Apache ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = AssemblyInfo.cs CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/AssemblyInfo.cs.in $(srcdir)/Makefile.in \ ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = $(top_builddir)/src/Mono.WebServer.Apache datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MCSFLAGS = -unsafe -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -keyfile:$(top_srcdir)/src/mono.snk MODMONOSERVER4_EXE = mod-mono-server4.exe GACUTIL4 = $(GACUTIL) -package 4.5 noinst_SCRIPTS = $(MODMONOSERVER4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Posix.dll -r:Mono.Security.dll references4 = $(references_common) \ -r:../Mono.WebServer/4.0/Mono.WebServer2.dll $(am__append_1) sources = $(shell cat $(srcdir)/Mono.WebServer.Apache.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in Mono.WebServer.Apache.sources all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Mono.WebServer.Apache/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Mono.WebServer.Apache/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): AssemblyInfo.cs: $(top_builddir)/config.status $(srcdir)/AssemblyInfo.cs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile mod-mono-server4.exe: $(sources) AssemblyInfo.cs $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/mod-mono-server4.exe uninstall-local: -for i in $(noinst_SCRIPTS); do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/src/Mono.WebServer.Apache/ConfigurationManager.cs0000664000175000017500000000733612627046413020345 00000000000000// // ConfigurationManager.cs // // Author: // Leonardo Taglialegne // // Copyright (c) 2013 Leonardo Taglialegne. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.IO; using Mono.WebServer.Options; using Mono.WebServer.Options.Settings; namespace Mono.WebServer.Apache { class ConfigurationManager : ServerConfigurationManager { #region Backing fields readonly BoolSetting nonstop = new BoolSetting ("nonstop", "Don't stop the server by pressing enter. Must be used when the server has no controlling terminal."); readonly BoolSetting quiet = new BoolSetting ("quiet", "Disable the initial start up information."); readonly BoolSetting noHidden = new BoolSetting ("no-hidden", "Allow access to hidden files (see 'man xsp' for details)."); readonly BoolSetting terminate = new BoolSetting ("terminate", Descriptions.Terminate); readonly BoolSetting master = new BoolSetting ("master", Descriptions.Master); readonly NullableUInt16Setting port = new NullableUInt16Setting ("port", Descriptions.Port, "MonoServerPort", "MONO_FCGI_PORT"); readonly NullableInt32Setting minThreads = new NullableInt32Setting ("minThreads", "The minimum number of threads the thread pool creates on startup. Increase this value to handle a sudden inflow of connections."); readonly StringSetting filename = new StringSetting ("filename", "A unix socket filename to listen on.", "MonoUnixSocket", "MONO_UNIX_SOCKET", Path.Combine (Path.GetTempPath (), "mod_mono_server")); readonly StringSetting pidFile = new StringSetting ("pidfile", "Write the process PID to the specified file."); #endregion #region Typesafe properties public bool NonStop { get { return nonstop; } } public bool Quiet { get { return quiet; } } public bool NoHidden { get { return noHidden; } } public bool Terminate { get { return terminate; } } public bool Master { get { return master; } } public ushort? Port { get { return port; } } public int? MinThreads { get { return minThreads; } } public string Filename { get { return filename; } } public string PidFile { get { return pidFile; } } #endregion public override string ProgramName { get { return "mod-mono-server.exe"; } } public override string Description { get { return "mod-mono-server.exe is a ASP.NET server used from mod_mono."; } } public ConfigurationManager (string name, bool quietDefault, string rootDefault) : base(name) { Add (nonstop, quiet, noHidden, terminate, master, port, minThreads, filename, pidFile); quiet.MaybeUpdate (SettingSource.Default, quietDefault); if (rootDefault != null) root.MaybeUpdate (SettingSource.Default, rootDefault); } } }xsp-4.2/src/Mono.WebServer.Apache/RequestReader.cs0000664000175000017500000000411412627046413017005 00000000000000// // RequestReader.cs // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2008 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Net.Sockets; namespace Mono.WebServer { public class RequestReader { public ModMonoRequest Request { get; private set; } public RequestReader (Socket client) { Request = new ModMonoRequest (client); } public string GetUriPath () { string path = Request.GetUri (); int dot = path.LastIndexOf ('.'); int slash = (dot != -1) ? path.IndexOf ('/', dot) : 0; if (dot > 0 && slash > 0) path = path.Substring (0, slash); return path; } public string GetPhysicalPath () { return Request.GetPhysicalPath (); } public void Decline () { Request.Decline (); } public void NotFound () { Request.NotFound (); } public bool ShuttingDown { get { return Request.ShuttingDown; } } } } xsp-4.2/src/Mono.WebServer.Apache/ModMonoWorker.cs0000664000175000017500000002153412627046413017001 00000000000000// // Mono.WebServer.ModMonoWorker // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Net.Sockets; using Mono.WebServer.Log; namespace Mono.WebServer.Apache { // // ModMonoWorker: The worker that does the initial processing of mod_mono // requests. // class ModMonoWorker: Worker, IDisposable { public NetworkStream Stream; readonly ApplicationServer server; ModMonoRequest modRequest; bool closed; int requestId = -1; ModMonoRequestBroker broker; readonly Socket client; public ModMonoWorker (Socket client, ApplicationServer server) { Stream = new NetworkStream (client, true); this.client = client; this.server = server; } static void Dispose (Action disposer, string name) { if (disposer == null) return; try { disposer (); } catch (Exception ex) { Logger.Write (LogLevel.Error, "While disposing ModMonoWorker. {0} disposing failed with exception:", name); Logger.Write (ex); } } public void Dispose () { Dispose (() => { if (Stream != null) Stream.Dispose (); }, "Stream"); Dispose (() => { if (modRequest != null) modRequest.Dispose (); }, "modRequest"); GC.SuppressFinalize (this); } public override void Run (object state) { try { InnerRun (); } catch (Exception e) { // FileNotFoundException might be a sign of a bad deployment // once we require the .exe and Mono.WebServer in bin or the GAC. // IOException, like EndOfStreamException, might be ok. if (!(e is EndOfStreamException)) Logger.Write (e); try { // Closing is enough for mod_mono. the module will return a 50x if (Stream != null){ Stream.Close (); Stream = null; } } catch {} if (!server.SingleApplication && broker != null && requestId != -1) { broker.UnregisterRequest (requestId); requestId = -1; } } } VPathToHost GetOrCreateApplication (string vhost, int port, string filepath, string virt) { string final_vdir; string final_pdir; GetPhysicalDirectory (virt, filepath, out final_vdir, out final_pdir); //Logger.Write (LogLevel.Error, "final_pdir: {0} final_vdir: {1}", final_pdir, final_vdir); VPathToHost vapp = server.GetApplicationForPath (vhost, port, virt, false); if (vapp == null) { // Don't know why this breaks mod-mono-server2.exe, but not mod-mono-server.exe //final_pdir = "file://" + final_pdir; if (final_vdir [0] != '/') final_vdir = "/" + final_vdir; server.AddApplication (vhost, port, final_vdir, final_pdir); vapp = server.GetApplicationForPath (vhost, port, virt, false); } return vapp; } internal static void GetPhysicalDirectory (string vfile, string pfile, out string final_vdir, out string final_pdir) { string vdir = Path.GetDirectoryName (vfile); string pdir = Path.GetDirectoryName (pfile); var vinfo = new DirectoryInfo (vdir); var pinfo = new DirectoryInfo (pdir); final_pdir = null; final_vdir = null; while (vinfo != null && pinfo != null) { if (IsRootDirectory (pinfo)) { final_pdir = pinfo.ToString (); final_vdir = vinfo.ToString (); break; } if (pinfo.Name != vinfo.Name) { final_vdir = vinfo.ToString (); break; } pinfo = pinfo.Parent; vinfo = vinfo.Parent; } if (final_pdir == null) { final_pdir = pinfo.ToString (); } if (final_vdir == null) { final_vdir = vinfo.ToString (); } } static bool IsRootDirectory (DirectoryInfo info) { if (!info.Exists) return false; return File.Exists (Path.Combine (info.FullName, "Global.asax")) || File.Exists (Path.Combine (info.FullName, "global.asax")) || Directory.Exists (Path.Combine (info.FullName, "bin")); } void InnerRun () { requestId = -1; broker = null; var rr = new RequestReader (client); if (rr.ShuttingDown) { Close (); server.Stop (); return; } string vhost = rr.Request.GetRequestHeader ("Host"); int port = -1; if (vhost != null) { int lead = vhost.IndexOf('['); int follow = lead >= 0 ? vhost.IndexOf(']') : -1; if (follow > lead) { //ipv6 address int colon = vhost.IndexOf("]:", StringComparison.Ordinal); if (colon != -1) { Int32.TryParse (vhost.Substring (colon + 2), out port); vhost = vhost.Substring(0, colon + 1); } } else { //ipv4 or hostname int colon = vhost.IndexOf (':'); if (colon != -1) { Int32.TryParse (vhost.Substring (colon + 1), out port); vhost = vhost.Substring (0, colon); } } if (port <= 0 || port > 65535) { //No port specified, Int32.TryParse failed or invalid port number port = 80; } } string vServerName = rr.Request.GetVirtualServerName () ?? vhost; VPathToHost vapp; string vpath = rr.GetUriPath (); string path = rr.GetPhysicalPath (); if (path == null) { vapp = server.GetApplicationForPath (vServerName, port, vpath, false); } else { vapp = GetOrCreateApplication (vServerName, port, path, vpath); } if (vapp == null) { rr.NotFound (); Stream.Close (); Stream = null; return; } var host = (ModMonoApplicationHost) vapp.AppHost; if (host == null) { rr.NotFound (); Stream.Close (); Stream = null; return; } modRequest = rr.Request; if (!server.SingleApplication) { broker = (ModMonoRequestBroker) vapp.RequestBroker; broker.UnregisterRequestEvent += OnUnregisterRequest; requestId = broker.RegisterRequest (this); } host.ProcessRequest (requestId, modRequest.GetHttpVerbName(), modRequest.GetQueryString(), modRequest.GetUri(), modRequest.GetProtocol(), modRequest.GetLocalAddress(), modRequest.GetServerPort(), modRequest.GetRemoteAddress(), modRequest.GetRemotePort(), modRequest.GetRemoteName(), modRequest.GetAllHeaders(), modRequest.GetAllHeaderValues(), (requestId == -1) ? this : null); } void OnUnregisterRequest (object sender, UnregisterRequestEventArgs args) { var broker = sender as BaseRequestBroker; if (broker != null) broker.UnregisterRequestEvent -= OnUnregisterRequest; if (requestId == -1 || requestId != args.RequestId) return; requestId = -1; } public override int Read (byte[] buffer, int position, int size) { return modRequest.GetClientBlock (buffer, position, size); } public override void Write (byte[] buffer, int position, int size) { modRequest.SendResponseFromMemory (buffer, position, size); } public void Write (IntPtr ptr, int size) { modRequest.SendResponseFromMemory (ptr, size); } public override void Close () { if (closed) return; closed = true; try { modRequest.Close (); } catch {} // ignore any error try { if (Stream != null) { Stream.Close (); Stream = null; } } catch {} } public override void Flush () { //modRequest.Flush (); No-op } public override bool IsConnected () { return modRequest.IsConnected (); } public void SendFile (string filename) { modRequest.SendFile (filename); } public string GetServerVariable (string name) { return modRequest.GetServerVariable (name); } public void SetStatusCodeLine (int code, string status) { modRequest.SetStatusCodeLine (code, status); } public void SetResponseHeader (string name, string value) { modRequest.SetResponseHeader (name, value); } public void SetOutputBuffering (bool doBuffer) { modRequest.SetOutputBuffering (doBuffer); } public bool HeadersSent { get { return modRequest.HeadersSent; } } } } xsp-4.2/src/Mono.WebServer.Apache/AssemblyInfo.cs.in0000664000175000017500000000412612627046413017235 00000000000000// AssemblyInfo.cs.in: // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // Copyright (c) 2002-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyVersion("@XSP_VERSION@")] [assembly: AssemblyTitle ("Mono.WebServer.Apache")] [assembly: AssemblyDescription ("Mod_mono backend for XSP")] [assembly: AssemblyCopyright ("(c) 2002-2011 Novell, Inc.")] [assembly: AssemblyCompany ("Novell, Inc.")] [assembly: InternalsVisibleTo ("Mono.WebServer.Test, PublicKey = 0024000004800000940000000602000" + "00024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1af" + "cc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2" + "ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081db" + "ea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35" + "f46cdff12a1bd78e4ef0065d016df")]xsp-4.2/src/Mono.WebServer.Apache/ModMonoWebSource.cs0000664000175000017500000001042312627046413017421 00000000000000// // Mono.WebServer.ModMonoApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.IO; using System.Net; using System.Net.Sockets; using Mono.Unix; using Mono.WebServer.Apache; using Mono.WebServer.Log; namespace Mono.WebServer { // // ModMonoWebSource: Provides methods to get objects and types specific // to mod_mono. // public class ModMonoWebSource: WebSource { string filename; bool file_bound; Stream locker; readonly string lockfile; protected ModMonoWebSource (string lockfile) { this.lockfile = lockfile; try { locker = File.OpenWrite (lockfile); } catch { // Silently exit. Many people confused about this harmless message. //Logger.Write (LogLevel.Error, "Another mod-mono-server with the same arguments is already running."); Environment.Exit (1); } } public ModMonoWebSource (string filename, string lockfile) : this (lockfile) { if (filename == null) throw new ArgumentNullException ("filename"); this.filename = filename; } public virtual bool GracefulShutdown () { EndPoint ep = new UnixEndPoint (filename); var sock = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP); try { sock.Connect (ep); } catch (Exception e) { Logger.Write (LogLevel.Error, "Cannot connect to {0}: {1}", filename, e.Message); return false; } return SendShutdownCommandAndClose (sock); } protected bool SendShutdownCommandAndClose (Socket sock) { var b = new byte [] {0}; bool result = true; try { int sent = sock.Send (b); if (sent != b.Length) throw new IOException ("Blocking send did not send entire buffer"); } catch { result = false; } sock.Close (); return result; } public override Socket CreateSocket () { if (filename == null) throw new InvalidOperationException ("filename not set"); EndPoint ep = new UnixEndPoint (filename); if (File.Exists (filename)) { var conn = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP); try { conn.Connect (ep); conn.Close (); throw new InvalidOperationException ("There's already a server listening on " + filename); } catch (SocketException) { } File.Delete (filename); } var listen_socket = new Socket (AddressFamily.Unix, SocketType.Stream, ProtocolType.IP); listen_socket.Bind (ep); file_bound = true; return listen_socket; } public override Worker CreateWorker (Socket client, ApplicationServer server) { return new ModMonoWorker (client, server); } public override Type GetApplicationHostType () { return typeof (ModMonoApplicationHost); } public override IRequestBroker CreateRequestBroker () { return new ModMonoRequestBroker (); } protected override void Dispose (bool expl) { if (filename != null) { string f = filename; filename = null; if (file_bound) File.Delete (f); } if (locker != null) { Stream l = locker; locker = null; l.Close (); File.Delete (lockfile); } } ~ModMonoWebSource () { Dispose (false); } } } xsp-4.2/src/Mono.WebServer.Apache/Mono.WebServer.Apache.sources0000664000175000017500000000035012627046413021301 00000000000000ConfigurationManager.cs ModMonoApplicationHost.cs ModMonoCmd.cs ModMonoConfig.cs ModMonoRequest.cs ModMonoRequestBroker.cs ModMonoTCPWebSource.cs ModMonoWebSource.cs ModMonoWorker.cs ModMonoWorkerRequest.cs RequestReader.cs main.cs xsp-4.2/src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs0000664000175000017500000004010412627046413020344 00000000000000// // ModMonoWorkerRequest.cs // // Authors: // Daniel Lopez Ridruejo // Gonzalo Paniagua Javier // Marek Habersack // // Copyright (c) 2002 Daniel Lopez Ridruejo. // (c) 2002,2003 Ximian, Inc. // All rights reserved. // (C) Copyright 2004-2008 Novell, Inc. (http://www.novell.com) // Copyright 2012 Xamarin, Inc (http://xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Web; using System.Collections; using System.Globalization; using System.IO; using Mono.Security.X509; using Mono.Security.X509.Extensions; using Mono.WebServer.Apache; using Mono.WebServer.Log; using ConfigurationManager = System.Configuration.ConfigurationManager; namespace Mono.WebServer { public class ModMonoWorkerRequest : MonoWorkerRequest { bool closed; readonly string verb; readonly string queryString; readonly string protocol; string path; string pathInfo; readonly string rawUrl; readonly string localAddress; readonly int serverPort; readonly string remoteAddress; readonly int remotePort; readonly string remoteName; readonly ModMonoRequestBroker requestBroker; readonly ModMonoWorker worker; readonly string[] headers; int [] headersHash; readonly string[] headerValues; readonly int requestId; bool gotSecure; bool isSecure; readonly IApplicationHost appHost; // client certificate validity support string cert_hash; bool cert_validity; readonly static bool cert_check_apache; readonly static bool cert_check_mono; string [][] unknownHeaders; static string [] indexFiles = { "index.aspx", "Default.aspx", "default.aspx", "index.html", "index.htm" }; static ModMonoWorkerRequest () { try { string indexes = ConfigurationManager.AppSettings ["MonoServerDefaultIndexFiles"]; SetDefaultIndexFiles (indexes); } catch (Exception ex) { Logger.Write (LogLevel.Error, "Worker initialization exception occurred. Continuing anyway:\n{0}", ex); } // by default the client certificate validity (CCV) checks are done by both Apache and Mono // but this can be limited to either Apache or Mono using the MOD_MONO_CCV environment variable string ccv = Environment.GetEnvironmentVariable ("MOD_MONO_CCV"); if (ccv != null) ccv = ccv.ToLower (CultureInfo.InvariantCulture); switch (ccv) { case "mono": cert_check_mono = true; break; case "apache": cert_check_apache = true; break; default: // both cert_check_apache = true; cert_check_mono = true; break; } } static void SetDefaultIndexFiles (string list) { if (list == null) return; indexFiles = SplitAndTrim (list); } public ModMonoWorkerRequest (int requestId, ModMonoRequestBroker requestBroker, IApplicationHost appHost, string verb, string path, string queryString, string protocol, string localAddress, int serverPort, string remoteAddress, int remotePort, string remoteName, string[] headers, string[] headerValues) : base (appHost) { this.requestId = requestId; this.requestBroker = requestBroker; this.verb = verb; this.appHost = appHost; rawUrl = path; if (!String.IsNullOrEmpty (queryString)) rawUrl += "?" + queryString; //this.protocol = protocol; // Don't let System.Web know if it's 1.1. This way apache handles the chunked // encoding for us, without sys.web interfering. this.protocol = "HTTP/1.0"; this.queryString = queryString; this.path = path; this.localAddress = localAddress; this.serverPort = serverPort; this.remoteAddress = remoteAddress; this.remotePort = remotePort; this.remoteName = remoteName; this.headers = headers; this.headerValues = headerValues; } public ModMonoWorkerRequest (object worker, IApplicationHost appHost, string verb, string path, string queryString, string protocol, string localAddress, int serverPort, string remoteAddress, int remotePort, string remoteName, string[] headers, string[] headerValues) : this (-1, null, appHost, verb, path, queryString, protocol, localAddress, serverPort, remoteAddress, remotePort, remoteName, headers, headerValues) { this.worker = (ModMonoWorker) worker; } public override int RequestId { get { return requestId; } } public override string GetPathInfo () { return pathInfo; } public override string GetRawUrl () { return rawUrl; } bool TryDirectory () { string localPath = GetFilePathTranslated (); if (!Directory.Exists (localPath)) return false; string oldPath = path; if (!path.EndsWith ("/")) path += "/"; bool catOne = false; foreach (string indexFile in indexFiles) { string testfile = Path.Combine (localPath, indexFile); if (File.Exists (testfile)) { path += indexFile; catOne = true; break; } } if (!catOne) path = oldPath; return true; } protected override bool GetRequestData () { if (TryDirectory ()) { pathInfo = String.Empty; return true; } string old_path = path; Paths.GetPathsFromUri (appHost, verb, old_path, out path, out pathInfo); return true; } public override bool HeadersSent () { if (requestId == -1) return worker.HeadersSent; return requestBroker.GetHeadersSent (requestId); } public override void FlushResponse (bool finalFlush) { // FLUSH is a no-op in mod_mono. Apache takes care of it. // requestBroker.Flush (requestId); if (finalFlush) CloseConnection (); } public override bool IsSecure () { if (!gotSecure) { string val = GetServerVariable (requestId, "SERVER_PORT_SECURE"); isSecure = !String.IsNullOrEmpty (val); gotSecure = true; } return isSecure; } public string GetServerVariable (int requestId, string name) { if (requestId == -1) return worker.GetServerVariable (name); if (requestBroker != null) return requestBroker.GetServerVariable (requestId, name); return null; } bool IsClientCertificateValidForApache () { string val = GetServerVariable (requestId, "SSL_CLIENT_VERIFY"); if (String.IsNullOrEmpty (val)) return false; return (val.Trim () == "SUCCESS"); } static bool CheckClientCertificateExtensions (X509Certificate cert) { const KeyUsages ku = KeyUsages.digitalSignature | KeyUsages.keyEncipherment | KeyUsages.keyAgreement; KeyUsageExtension kux = null; ExtendedKeyUsageExtension eku = null; X509Extension xtn = cert.Extensions["2.5.29.15"]; if (xtn != null) kux = new KeyUsageExtension (xtn); xtn = cert.Extensions["2.5.29.37"]; if (xtn != null) eku = new ExtendedKeyUsageExtension (xtn); if ((kux != null) && (eku != null)) { // RFC3280 states that when both KeyUsageExtension and // ExtendedKeyUsageExtension are present then BOTH should // be valid return (kux.Support (ku) && eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.2")); } if (kux != null) { return kux.Support (ku); } if (eku != null) { // Client Authentication (1.3.6.1.5.5.7.3.2) return eku.KeyPurpose.Contains ("1.3.6.1.5.5.7.3.2"); } // last chance - try with older (deprecated) Netscape extensions xtn = cert.Extensions["2.16.840.1.113730.1.1"]; if (xtn != null) { var ct = new NetscapeCertTypeExtension (xtn); return ct.Support (NetscapeCertTypeExtension.CertTypes.SslClient); } // certificate isn't valid for SSL client usage return false; } static bool CheckChain (X509Certificate cert) { return new X509Chain ().Build (cert); } bool IsCertificateValidForMono (byte[] der) { var cert = new X509Certificate (der); // invalidate cache if the certificate validity period has ended if (cert.ValidUntil > DateTime.UtcNow) cert_hash = null; // heavyweight process, cache result string hash = BitConverter.ToString (cert.Hash); if (hash != cert_hash) { try { cert_validity = CheckClientCertificateExtensions (cert) && CheckChain (cert); cert_hash = hash; } catch { cert_validity = false; } } return cert_validity; } // apache: Client certificate is valid if Apache is satisfied (SSL_CLIENT_VERIFY). // mono: Client certificate is valid if Mono is satisfied. // both: (Default) Client certificate is valid if BOTH Apache and Mono agree it is. public bool IsClientCertificateValid (byte[] der) { bool apache = true; // both or apache-only if (cert_check_apache) { apache = IsClientCertificateValidForApache (); } bool mono = true; // both or mono-only if (cert_check_mono) { mono = IsCertificateValidForMono (der); } return (apache && mono); } public override void CloseConnection () { if (closed) return; if (requestId == -1) { try { worker.Close (); } finally { worker.Dispose (); } } else requestBroker.Close (requestId); closed = true; } public override string GetHttpVerbName () { return verb; } public override string GetHttpVersion () { return protocol; } public override string GetLocalAddress () { return localAddress; } public override int GetLocalPort () { return serverPort; } public override string GetQueryString () { return queryString; } public override string GetRemoteAddress () { return remoteAddress; } public override int GetRemotePort () { return remotePort; } readonly Hashtable server_vars = new Hashtable (StringComparer.InvariantCultureIgnoreCase); public override string GetServerVariable (string name) { object o = server_vars [name]; if (o is bool) return null; if (o != null) return (string) o; string result = GetServerVariable (requestId, name); if (!String.IsNullOrEmpty (result)) { server_vars [name] = result; return result; } switch (name) { case "HTTPS": result = (IsSecure ()) ? "on" : "off"; server_vars ["HTTPS"] = result; break; default: result = base.GetServerVariable (name); if (String.IsNullOrEmpty (result)) server_vars [name] = false; else server_vars [name] = result; break; } return result; } void UpdateModMonoConfig () { // Reconfigure apache to be in synch with current application settings HttpContext ctx = HttpContext.Current; HttpResponse response = ctx != null ? ctx.Response : null; if (response == null) return; if (requestId == -1) worker.SetOutputBuffering (response.BufferOutput); else requestBroker.SetOutputBuffering (requestId, response.BufferOutput); } public override void SendResponseFromMemory (IntPtr data, int length) { if (requestId > -1) { base.SendResponseFromMemory (data, length); return; } worker.Write (data, length); } public override void SendResponseFromMemory (byte [] data, int length) { UpdateModMonoConfig (); if (requestId > -1 && data.Length > length * 2) { // smaller buffer when using remoting var tmpbuffer = new byte [length]; Buffer.BlockCopy (data, 0, tmpbuffer, 0, length); requestBroker.Write (requestId, tmpbuffer, 0, length); } else { if (requestId == -1) worker.Write (data, 0, length); else requestBroker.Write (requestId, data, 0, length); } } public override void SendStatus (int statusCode, string statusDescription) { UpdateModMonoConfig (); string line = String.Format("{0} {1}", statusCode, statusDescription); if (requestId == -1) worker.SetStatusCodeLine (statusCode, line); else requestBroker.SetStatusCodeLine (requestId, statusCode, line); } public override void SendUnknownResponseHeader (string name, string value) { if (requestId == -1) worker.SetResponseHeader (name, value); else requestBroker.SetResponseHeader (requestId, name, value); } public override bool IsClientConnected () { if (requestId == -1) return worker.IsConnected (); return (requestBroker != null && requestBroker.IsConnected (requestId)); } public override string GetUriPath () { string result = path; if (!String.IsNullOrEmpty (pathInfo)) result += pathInfo; return result; } public override string GetFilePath () { return path; } public override string GetRemoteName () { return remoteName; } public override string GetUnknownRequestHeader (string name) { return GetRequestHeader (name); } public override string [][] GetUnknownRequestHeaders () { if (unknownHeaders == null) { int count = headers.Length; var pairs = new List (); for (int i = 0; i < count; i++) { if (GetKnownRequestHeaderIndex (headers [i]) != -1) continue; pairs.Add (new[] { headers [i], headerValues [i]}); } if (pairs.Count != 0) { unknownHeaders = new string [pairs.Count][]; for (int i = 0; i < pairs.Count; i++) unknownHeaders [i] = pairs [i]; } } return unknownHeaders; } public override string GetKnownRequestHeader (int index) { return GetRequestHeader (GetKnownRequestHeaderName (index)); } string GetRequestHeader (string name) { StringComparer hp = StringComparer.InvariantCultureIgnoreCase; if (headersHash == null) { headersHash = new int [headers.Length]; for (int i = 0; i < headers.Length; i++) { headersHash [i] = hp.GetHashCode (headers [i]); } } int k = Array.IndexOf (headersHash, hp.GetHashCode (name)); return (k == -1) ? null : headerValues [k]; } public override void SendCalculatedContentLength (int contentLength) { // Do nothing } public override int ReadEntityBody (byte [] buffer, int size) { if (buffer == null || size <= 0) return 0; if (requestId > -1) { byte [] readBuffer; int nr = requestBroker.Read (requestId, size, out readBuffer); if (nr > 0 && readBuffer != null) Buffer.BlockCopy (readBuffer, 0, buffer, 0, nr); return nr; } return worker.Read (buffer, 0, size); } public override void SendResponseFromFile (string filename, long offset, long length) { if (offset == 0) { var info = new FileInfo (filename); if (info.Length == length) { if (requestId == -1) worker.SendFile (filename); else requestBroker.SendFile (requestId, filename); return; } } FileStream file = null; try { file = File.OpenRead (filename); // We must not call the SendResponseFromFile overload which // takes IntPtr in this case since it will callthe base // implementation of that overload which, in turn, will // close the handle (as it uses FileStream to wrap the // handle we pass). This will cause the handle to be closed // twice (FileStream owns the handle). So we just take a // shortcut to what the base overload does here. SendFromStream (file, offset, length); } finally { if (file != null) file.Close (); } } public override void SendResponseFromFile (IntPtr handle, long offset, long length) { Stream file = null; try { file = new FileStream (handle, FileAccess.Read); SendFromStream (file, offset, length); } finally { if (file != null) file.Close (); } } } } xsp-4.2/src/Mono.WebServer.Apache/Makefile.am0000664000175000017500000000217212627054440015740 00000000000000builddir=$(top_builddir)/src/Mono.WebServer.Apache MCSFLAGS= -unsafe -debug+ -debug:full -nologo -nowarn:618 $(WEBTRACING) -keyfile:$(top_srcdir)/src/mono.snk MODMONOSERVER4_EXE = mod-mono-server4.exe GACUTIL4=$(GACUTIL) -package 4.5 noinst_SCRIPTS = $(MODMONOSERVER4_EXE) CLEANFILES = *.exe *.mdb references_common = -r:System.Web.dll -r:System.Configuration.dll -r:Mono.Posix.dll -r:Mono.Security.dll references4 = $(references_common) -r:../Mono.WebServer/4.0/Mono.WebServer2.dll if PLATFORM_WIN32 references4 += -lib:"$(prefix)/lib" endif sources = $(shell cat $(srcdir)/Mono.WebServer.Apache.sources) build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = $(sources) AssemblyInfo.cs.in Mono.WebServer.Apache.sources mod-mono-server4.exe: $(sources) AssemblyInfo.cs $(DMCS) -d:NET_2_0 -d:NET_4_0 $(MCSFLAGS) $(references4) /out:$@ $(build_sources) $(SN) -q -R $(builddir)/$@ $(srcdir)/../mono.snk install-data-local: $(GACUTIL4) $(GACUTIL_FLAGS) -i $(builddir)/mod-mono-server4.exe uninstall-local: -for i in $(noinst_SCRIPTS); do \ $(GACUTIL) $(GACUTIL_FLAGS) -u $$(basename $$i .exe) ; \ done xsp-4.2/src/Mono.WebServer.Apache/ModMonoRequestBroker.cs0000664000175000017500000000532012627046413020320 00000000000000// // Mono.WebServer.ModMonoApplicationHost // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2007 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Mono.WebServer.Apache; namespace Mono.WebServer { // // ModMonoRequestBroker: The request broker for mod_mono. Provides some // additional methods to the BaseRequestBroker from which inherits. // public class ModMonoRequestBroker: BaseRequestBroker { public string GetServerVariable (int requestId, string name) { var worker = GetWorker (requestId) as ModMonoWorker; if (worker == null) return null; return worker.GetServerVariable (name); } public void SetStatusCodeLine (int requestId, int code, string status) { var worker = GetWorker (requestId) as ModMonoWorker; if (worker == null) return; worker.SetStatusCodeLine (code, status); } public void SetResponseHeader (int requestId, string name, string value) { var worker = GetWorker (requestId) as ModMonoWorker; if (worker == null) return; worker.SetResponseHeader (name, value); } public void SetOutputBuffering (int requestId, bool doBuffer) { var worker = GetWorker (requestId) as ModMonoWorker; if (worker == null) return; worker.SetOutputBuffering (doBuffer); } public void SendFile (int requestId, string filename) { var worker = GetWorker (requestId) as ModMonoWorker; if (worker == null) return; worker.SendFile (filename); } public bool GetHeadersSent (int requestId) { var worker = GetWorker (requestId) as ModMonoWorker; return (worker != null) && worker.HeadersSent; } } } xsp-4.2/src/Mono.WebServer.Apache/main.cs0000664000175000017500000001630012627046413015156 00000000000000// // Mono.WebServer.Apache/main.cs: Mod_mono Backend for XSP. // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // // (C) 2002,2003 Ximian, Inc (http://www.ximian.com) // (C) Copyright 2004-2009 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Threading; using Mono.WebServer.Log; using Mono.WebServer.Options; namespace Mono.WebServer.Apache { public class Server : MarshalByRefObject { public static void CurrentDomain_UnhandledException (object sender, UnhandledExceptionEventArgs e) { var ex = (Exception)e.ExceptionObject; Logger.Write (LogLevel.Error, "Handling exception type {0}", ex.GetType ().Name); Logger.Write (LogLevel.Error, "Message is {0}", ex.Message); Logger.Write (LogLevel.Error, "IsTerminating is set to {0}", e.IsTerminating); if (e.IsTerminating) Logger.Write (ex); } public static int Main (string [] args) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; try { var svr = new Server (); return svr.RealMain (args, true, null, false); } catch (ThreadAbortException) { // Single-app mode and ASP.NET appdomain unloaded Thread.ResetAbort (); } return 1; } // // Parameters: // // args - original args passed to the program // root - true means caller is in the root domain // ext_apphost - used when single app mode is used, in a recursive call to // RealMain from the single app domain // quiet - don't show messages. Used to avoid double printing of the banner // public int RealMain (string [] args, bool root, IApplicationHost ext_apphost, bool v_quiet) { var configurationManager = new ConfigurationManager ("mod_mono", v_quiet, ext_apphost == null ? null : ext_apphost.Path); if (!configurationManager.LoadCommandLineArgs (args)) return 1; // Show the help and exit. if (configurationManager.Help) { configurationManager.PrintHelp (); #if DEBUG Console.WriteLine("Press any key..."); Console.ReadKey (); #endif return 0; } // Show the version and exit. if (configurationManager.Version) { Version.Show (); return 0; } var hash = GetHash (args); if (hash == -1) { Logger.Write(LogLevel.Error, "Couldn't calculate hash - should have left earlier - something is really wrong"); return 1; } if (hash == -2) { Logger.Write(LogLevel.Error, "Couldn't calculate hash - unrecognized parameter"); return 1; } if (!configurationManager.LoadConfigFile ()) return 1; configurationManager.SetupLogger (); ushort port = configurationManager.Port ?? 0; bool useTCP = port != 0; string lockfile = useTCP ? Path.Combine (Path.GetTempPath (), "mod_mono_TCP_") : configurationManager.Filename; lockfile = String.Format ("{0}_{1}", lockfile, hash); ModMonoWebSource webSource = useTCP ? new ModMonoTCPWebSource (configurationManager.Address, port, lockfile) : new ModMonoWebSource (configurationManager.Filename, lockfile); if(configurationManager.Terminate) { if (configurationManager.Verbose) Logger.Write (LogLevel.Notice, "Shutting down running mod-mono-server..."); bool res = webSource.GracefulShutdown (); if (configurationManager.Verbose) if (res) Logger.Write (LogLevel.Notice, "Done"); else Logger.Write (LogLevel.Error, "Failed."); return res ? 0 : 1; } var server = new ApplicationServer (webSource, configurationManager.Root) { Verbose = configurationManager.Verbose, SingleApplication = !root }; #if DEBUG Console.WriteLine (Assembly.GetExecutingAssembly ().GetName ().Name); #endif if (configurationManager.Applications != null) server.AddApplicationsFromCommandLine (configurationManager.Applications); if (configurationManager.AppConfigFile != null) server.AddApplicationsFromConfigFile (configurationManager.AppConfigFile); if (configurationManager.AppConfigDir != null) server.AddApplicationsFromConfigDirectory (configurationManager.AppConfigDir); if (!configurationManager.Master && configurationManager.Applications == null && configurationManager.AppConfigDir == null && configurationManager.AppConfigFile == null) server.AddApplicationsFromCommandLine ("/:."); // TODO: do we really want this? VPathToHost vh = server.GetSingleApp (); if (root && vh != null) { // Redo in new domain vh.CreateHost (server, webSource); var svr = (Server)vh.AppHost.Domain.CreateInstanceAndUnwrap (GetType ().Assembly.GetName ().ToString (), GetType ().FullName); webSource.Dispose (); return svr.RealMain (args, false, vh.AppHost, configurationManager.Quiet); } if (ext_apphost != null) { ext_apphost.Server = server; server.AppHost = ext_apphost; } if (!configurationManager.Quiet) { if (!useTCP) Logger.Write (LogLevel.Notice, "Listening on: {0}", configurationManager.Filename); else { Logger.Write (LogLevel.Notice, "Listening on port: {0}", port); Logger.Write (LogLevel.Notice, "Listening on address: {0}", configurationManager.Address); } Logger.Write (LogLevel.Notice, "Root directory: {0}", configurationManager.Root); } try { if (!server.Start (!configurationManager.NonStop, (int)configurationManager.Backlog)) return 2; if (!configurationManager.NonStop) { Logger.Write (LogLevel.Notice, "Hit Return to stop the server."); while (true) { try { Console.ReadLine (); break; } catch (IOException) { // This might happen on appdomain unload // until the previous threads are terminated. Thread.Sleep (500); } } server.Stop (); } } catch (Exception e) { if (!(e is ThreadAbortException)) Logger.Write (e); else server.ShutdownSockets (); return 1; } return 0; } static int GetHash (IEnumerable args) { int hash = args.Aggregate (23, (current, arg) => current * 37 + arg.GetHashCode ()); if (hash < 0) return -hash; return hash; } public override object InitializeLifetimeService () { return null; } } } xsp-4.2/aclocal.m40000664000175000017500000130071712627055641010775 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([build/m4/shave/shave.m4]) m4_include([build/m4/shamrock/expansions.m4]) m4_include([build/m4/shamrock/mono.m4]) m4_include([build/m4/shamrock/monodoc.m4]) m4_include([build/m4/shamrock/programs.m4]) xsp-4.2/test/0000775000175000017500000000000012627055650010163 500000000000000xsp-4.2/test/web.config0000664000175000017500000000430012627046413012041 00000000000000 xsp-4.2/test/global.asax0000664000175000017500000000172412627046413012222 00000000000000<%@ Import Namespace="System.IO" %> xsp-4.2/test/small-icon.png0000664000175000017500000000112712627046413012645 00000000000000PNG  IHDRa pHYs  ~tIME }tEXtCommentCreated with The GIMPd%nIDATx͓OHq?!=H#A^Fq).!tx-lۤQfo @A~PU|DFKs8,Fcp*9(,o_Yevf qn~ \Ea /H$~LnLs#|9ZypN+ ȋNK~rl5R-'u]@l~nZW]'x {.K}udd+pXo}ƶ-~Jp8tȳ^{wo `_ #ýXvRS=rRn:(,SFtGW7ߡXIENDB`xsp-4.2/test/mod-mono-server.exe.config0000664000175000017500000000107712627046413015105 00000000000000 xsp-4.2/test/controls/0000775000175000017500000000000012627055647012034 500000000000000xsp-4.2/test/controls/Makefile.in0000664000175000017500000003560512627055643014026 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/controls ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplesdir = $(pkglibdir)/test/controls/ testfiles = BreadCrumbs_2.0.ascx \ MonoSamplesHeader.ascx \ FileList.ascx samples_DATA = $(testfiles) EXTRA_DIST = $(testfiles) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/controls/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/controls/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/controls/FileList.ascx0000664000175000017500000000201112627046413014330 00000000000000<%@ Control Language="C#" %> <%@ Import Namespace="System.Collections" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Text" %> <% ArrayList dirs = new ArrayList (); ArrayList files = new ArrayList (); string physPath = Path.GetDirectoryName (Request.PhysicalPath); DirectoryInfo dir = new DirectoryInfo (physPath); foreach (string d in Directory.GetDirectories (physPath)) dirs.Add (d); foreach (string f in Directory.GetFiles (physPath)) { if (f == "index.aspx" || f == "default.aspx") continue; files.Add (f); } StringBuilder sb = new StringBuilder ("
    "); dirs.Sort (); foreach (string d in dirs) sb.AppendFormat ("
  • {0}
  • ", Path.GetFileName (d)); files.Sort (); foreach (string f in files) sb.AppendFormat ("
  • {0}
  • ", Path.GetFileName (f)); Response.Write (sb.ToString ()); %> xsp-4.2/test/controls/BreadCrumbs_2.0.ascx0000664000175000017500000000010012627046413015362 00000000000000<%@ Control Language="C#" %> xsp-4.2/test/controls/MonoSamplesHeader.ascx0000664000175000017500000000133112627046413016167 00000000000000<%@ Control Language="C#" %>
    Mono site

    Welcome to Mono XSP!

    XSP is a simple web server written in C# that can be used to run your ASP.NET <% Response.Write ("2.0"); %> applications

    xsp-4.2/test/controls/Makefile.am0000664000175000017500000000026612627046413014003 00000000000000samplesdir = $(pkglibdir)/test/controls/ testfiles = BreadCrumbs_2.0.ascx \ MonoSamplesHeader.ascx \ FileList.ascx samples_DATA = $(testfiles) EXTRA_DIST = $(testfiles) xsp-4.2/test/Makefile.in0000664000175000017500000005252512627055643012163 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = controls 1.1 2.0 App_Code testfiles = \ mod-mono-server.exe.config \ index.aspx \ xsp.exe.config \ web.config \ global.asax \ mono.png \ monobutton.png \ mono-powered-big.png \ small-icon.png \ sample.webapp \ favicon.ico \ mono-xsp.css \ Web.sitemap \ missing_components.aspx samplesdir = $(pkglibdir)/test samples_DATA = $(testfiles) EXTRA_DIST = $(testfiles) $(sitemapreader_build) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-samplesDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/0000775000175000017500000000000012627055650010462 500000000000000xsp-4.2/test/2.0/Makefile.in0000664000175000017500000005207212627055642012456 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/2.0 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = menu treeview masterpages gridview samplesdir = $(pkglibdir)/test/2.0/ samples_DATA = index.aspx EXTRA_DIST = $(samples_DATA) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/2.0/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/2.0/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-samplesDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/masterpages/0000775000175000017500000000000012627055650012775 500000000000000xsp-4.2/test/2.0/masterpages/frame.master0000664000175000017500000000171412627046413015224 00000000000000<%@ Master Language="C#"%> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Simple Master Page
    This a common page footer.
    xsp-4.2/test/2.0/masterpages/Makefile.in0000664000175000017500000003565012627055642014774 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/2.0/masterpages ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplesdir = $(pkglibdir)/test/2.0/masterpages samples_DATA = \ simple.master \ simple.aspx \ frame.master \ content1.aspx \ content2.aspx \ index.aspx EXTRA_DIST = $(samples_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/2.0/masterpages/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/2.0/masterpages/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/masterpages/simple.aspx0000664000175000017500000000026512627046413015103 00000000000000<%@ Page Language="C#" MasterPageFile="simple.master" %> Contents go here xsp-4.2/test/2.0/masterpages/content2.aspx0000664000175000017500000000062112627046413015342 00000000000000<%@ Page Language="C#" MasterPageFile="frame.master" %> Welcome again!

    This is another content page for the same master page file.

    Click here to see another content page.

    xsp-4.2/test/2.0/masterpages/content1.aspx0000664000175000017500000000075412627046413015350 00000000000000<%@ Page Language="C#" MasterPageFile="frame.master" %> Welcome to Master Pages!

    This is the content of the master page file.

    This sample master page has two placeholders, one for the content and one for the title.

    Click here to see another content page.

    xsp-4.2/test/2.0/masterpages/index.aspx0000664000175000017500000000126712627046413014724 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> <%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %> Directory index

    The following directories and files are found in this directory:

    xsp-4.2/test/2.0/masterpages/Makefile.am0000664000175000017500000000030212627046413014741 00000000000000samplesdir = $(pkglibdir)/test/2.0/masterpages samples_DATA = \ simple.master \ simple.aspx \ frame.master \ content1.aspx \ content2.aspx \ index.aspx EXTRA_DIST = $(samples_DATA) xsp-4.2/test/2.0/masterpages/simple.master0000664000175000017500000000140312627046413015416 00000000000000<%@ Master Language="C#"%> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Simple Master Page
    What's inside the following box is a placeholder:
    That's all! xsp-4.2/test/2.0/gridview/0000775000175000017500000000000012627055650012302 500000000000000xsp-4.2/test/2.0/gridview/Makefile.in0000664000175000017500000003557612627055642014310 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/2.0/gridview ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplesdir = $(pkglibdir)/test/2.0/gridview samples_DATA = \ BasicGrid.aspx \ data.xml \ index.aspx \ ObjectBoundGrid.aspx EXTRA_DIST = $(samples_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/2.0/gridview/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/2.0/gridview/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/gridview/index.aspx0000664000175000017500000000126712627046413014231 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> <%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %> Directory index

    The following directories and files are found in this directory:

    xsp-4.2/test/2.0/gridview/BasicGrid.aspx0000775000175000017500000000306112627046413014746 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Untitled Page

    Simple GridView

    This grid reads the data from data.xml.

    xsp-4.2/test/2.0/gridview/ObjectBoundGrid.aspx0000775000175000017500000000465112627046413016131 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Untitled Page

    Object Bound GridView

    This grid takes data from an ArrayList of objects. Columns are autogenerated from object's properties.

    xsp-4.2/test/2.0/gridview/Makefile.am0000664000175000017500000000024112627046413014250 00000000000000samplesdir = $(pkglibdir)/test/2.0/gridview samples_DATA = \ BasicGrid.aspx \ data.xml \ index.aspx \ ObjectBoundGrid.aspx EXTRA_DIST = $(samples_DATA) xsp-4.2/test/2.0/gridview/data.xml0000775000175000017500000000131312627046413013653 00000000000000 xsp-4.2/test/2.0/index.aspx0000664000175000017500000000126712627046413012411 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> <%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %> Directory index

    The following directories and files are found in this directory:

    xsp-4.2/test/2.0/treeview/0000775000175000017500000000000012627055650012314 500000000000000xsp-4.2/test/2.0/treeview/populate.cs0000775000175000017500000000160312627046413014414 00000000000000using System; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; public class Populate: Page { public void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { if (e.Node.Depth > 4) return; for (int n = 0; n < (e.Node.Depth+1) * 2; n++) { string label = string.Empty; if (e.Node.Depth < 1) label = "Node"; else label = e.Node.Text; if (Char.IsDigit(label.ToCharArray()[label.Length-1])) { label += " " + (char)(n + 65); } else { label += " " + n; } TreeNode nod = new TreeNode(label); //TreeNode nod = new TreeNode("Node " + e.Node.Depth + " " + n); nod.PopulateOnDemand = true; e.Node.ChildNodes.Add(nod); } } } xsp-4.2/test/2.0/treeview/treeview.aspx0000664000175000017500000000474212627046413014767 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> TreeView

    ASP.NET 2.0 TreeView Example

    xsp-4.2/test/2.0/treeview/populate-on-demand.aspx0000775000175000017500000000205612627046413016625 00000000000000<%@ Page Language="C#" Inherits="Populate"%> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Treeview - populate-on-demand

    A sample tree populated on demand using callback (no postback).
    The code that generates the nodes can be found in populate.cs

    xsp-4.2/test/2.0/treeview/treeview-databound.aspx0000664000175000017500000000336312627046413016724 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> TreeView - DataBound
    xsp-4.2/test/2.0/treeview/TreeLineImages/0000755000175000017500000000000012627055650015147 500000000000000xsp-4.2/test/2.0/treeview/TreeLineImages/tminus.gif0000775000175000017500000000157112627046413017103 00000000000000GIF89a{{{!,V8*LhpÇB0/:01FC.Ie& JJ#Q\Ẍ́RJp&ѣF" ;xsp-4.2/test/2.0/treeview/TreeLineImages/rminus.gif0000775000175000017500000000156412627046413017103 00000000000000GIF89a{{{!,QH*\ȰCD(Q30ƌ,~1G(QY@˂GDqdȄ1?&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/2.0/treeview ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesbindir)" \ "$(DESTDIR)$(samplesdir)" SCRIPTS = $(samplesbin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ testfiles = \ populate-on-demand.aspx \ populate.cs \ treeview.aspx \ treeview-databound.aspx \ index.aspx treeview_src = populate.cs treeview_build = $(addprefix $(srcdir)/, $(treeview_src)) samplesdir = $(pkglibdir)/test/2.0/treeview samples_DATA = $(testfiles) samplesbindir = $(pkglibdir)/test/bin samplesbin_SCRIPTS = treeview.dll EXTRA_DIST = $(testfiles) \ $(treeview_src) CLEANFILES = $(samplesbin_SCRIPTS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/2.0/treeview/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/2.0/treeview/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-samplesbinSCRIPTS: $(samplesbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(samplesbin_SCRIPTS)'; test -n "$(samplesbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesbindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(samplesbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(samplesbindir)$$dir" || exit $$?; \ } \ ; done uninstall-samplesbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(samplesbin_SCRIPTS)'; test -n "$(samplesbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(samplesbindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesbindir)" "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-samplesbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA uninstall-samplesbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-samplesDATA \ install-samplesbinSCRIPTS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-hook uninstall-samplesDATA \ uninstall-samplesbinSCRIPTS .PRECIOUS: Makefile treeview.dll: $(treeview_build) $(DMCS) -r:System.Web.dll -t:library -out:$@ $^ dist-hook: $(mkinstalldirs) $(distdir)/TreeLineImages cp -p $(srcdir)/TreeLineImages/*gif $(distdir)/TreeLineImages install-data-hook: $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages cp $(srcdir)/TreeLineImages/*gif $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages uninstall-hook: rm -f $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages/*gif # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/treeview/index.aspx0000664000175000017500000000126712627046413014243 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> <%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %> Directory index

    The following directories and files are found in this directory:

    xsp-4.2/test/2.0/treeview/Makefile.am0000664000175000017500000000161712627046413014272 00000000000000testfiles = \ populate-on-demand.aspx \ populate.cs \ treeview.aspx \ treeview-databound.aspx \ index.aspx treeview_src = populate.cs treeview_build = $(addprefix $(srcdir)/, $(treeview_src)) samplesdir = $(pkglibdir)/test/2.0/treeview samples_DATA = $(testfiles) samplesbindir = $(pkglibdir)/test/bin samplesbin_SCRIPTS = treeview.dll EXTRA_DIST = $(testfiles) \ $(treeview_src) CLEANFILES = $(samplesbin_SCRIPTS) treeview.dll: $(treeview_build) $(DMCS) -r:System.Web.dll -t:library -out:$@ $^ dist-hook: $(mkinstalldirs) $(distdir)/TreeLineImages cp -p $(srcdir)/TreeLineImages/*gif $(distdir)/TreeLineImages install-data-hook: $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages cp $(srcdir)/TreeLineImages/*gif $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages uninstall-hook: rm -f $(DESTDIR)$(pkglibdir)/test/2.0/treeview/TreeLineImages/*gif xsp-4.2/test/2.0/Makefile.am0000664000175000017500000000021212627046413012426 00000000000000SUBDIRS = menu treeview masterpages gridview samplesdir = $(pkglibdir)/test/2.0/ samples_DATA = index.aspx EXTRA_DIST = $(samples_DATA) xsp-4.2/test/2.0/menu/0000775000175000017500000000000012627055650011426 500000000000000xsp-4.2/test/2.0/menu/stock_copy_24.png0000664000175000017500000000120612627046413014532 00000000000000PNG  IHDRw=gAMA abKGD pHYs  ~tIME IDATxڽP?y}- t+Ac1A݊n% A.DG I6K͋-\=ss?@\蟁 F/c5B*B>t:ac& it(Jݡ( 2 fI,|}4MCAVq.zM+9 z'5h4Vvl3UX뺘y m\.(_*|R V(x#Dk]$/o` 쁛ЌRtY~VQGܗSrX$O 'FIcMDߖ&)@Mp*g\5őC}gIENDB`xsp-4.2/test/2.0/menu/Makefile.in0000664000175000017500000003562512627055643013430 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/2.0/menu ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplesdir = $(pkglibdir)/test/2.0/menu samples_DATA = \ menu1.aspx \ menu2.aspx \ stock_copy_24.png \ stock_cut_24.png \ stock_paste_24.png \ index.aspx EXTRA_DIST = $(samples_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/2.0/menu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/2.0/menu/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/2.0/menu/stock_paste_24.png0000664000175000017500000000170312627046413014676 00000000000000PNG  IHDRw=gAMA abKGD pHYs  ~tIME(+#Q@IDATxڵKHq?aiR%!=DJ @%ZA #^PfaYk wr8iY%00~`j_JJ-ޮaV,@4w˗܌$I Jrs7v}\ p9LJ7 '~FxBkiV^N 1 +$qD,AFr088ьV :;;ꢦE~~>Ifz~3= f࣡ }2a^n6UUU#-- 8q|YtyƔ1 יK<~3?#Id(\e2tr߷]ECC`PWO? n^ ')_y*4IAvV099i9璡fdYAUmFlrfHwU!_ f^Ed@zLz5- "scF!P8u>W?][lAC`kJbFCe  s/IENDB`xsp-4.2/test/2.0/menu/menu2.aspx0000664000175000017500000001046012627046413013267 00000000000000<%@ Page Language="c#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Simple Menu










    xsp-4.2/test/2.0/menu/index.aspx0000664000175000017500000000126712627046413013355 00000000000000<%@ Page Language="C#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> <%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %> Directory index

    The following directories and files are found in this directory:

    xsp-4.2/test/2.0/menu/Makefile.am0000664000175000017500000000030412627046413013374 00000000000000samplesdir = $(pkglibdir)/test/2.0/menu samples_DATA = \ menu1.aspx \ menu2.aspx \ stock_copy_24.png \ stock_cut_24.png \ stock_paste_24.png \ index.aspx EXTRA_DIST = $(samples_DATA) xsp-4.2/test/2.0/menu/menu1.aspx0000664000175000017500000000442012627046413013265 00000000000000<%@ Page Language="c#" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Simple Menu

    This is a vertical menu sample


    xsp-4.2/test/2.0/menu/stock_cut_24.png0000664000175000017500000000143712627046413014361 00000000000000PNG  IHDRw=gAMA abKGD pHYs  ~tIME2%e2IDATx͕OHTQ3c"m$VRQT(NP6*DAe(6cPY"hiis7Mw{?h8S,ޱL26?Uib`-@"OVNHR- VxF8I>n*ܬ M τdtd؜JD"{g5<2hho%[`5]W2$=bQ}FzM#SȜ ųo:o~Ȑo$ʀ#:4tu UUU21ёa9tT_.[M~!m-DXRsxoE ޾W/ۀR ?U]tŷn Y.% @)q):LƁWw3@崧MUN{hӂ+Y}?VIG^Ṭ:(ƀ;Z:ؠeTP/x+a7$>GT4☎ PQc:vXm\[N:?)h(;5ϩ;fK:5&&"LR:9ESUuqj+&pj4A|)?KF5IENDB`xsp-4.2/test/monobutton.png0000664000175000017500000000535312627046413013020 00000000000000PNG  IHDR(0c{8bKGD pHYsnn [tIME("肓 xIDATx͙[l̬׻ )BM TH)I%KGi&MHTh)I R!HRmvwvgav1Dj{3;g.on$`%Yg([5lݺuQ[[RuyjyBrm{Rj` N?^M93۶]e)˲TXTbQ e2MSyT6Ua(0T&QtZ%I522y[3Qm7oMu}QF7J)'4Z-b܄H)R]H(B@TvA:EqtmbΜ9(hnn& 5|Q^z%lB$q(@HYᚳBo'Q>|/^vXE+ .JwKx֕T"Yyv.콀mhVr?v,T )e-(---D"rEˢ`r9 #K.ñmPsF/4d2D̚5Β`۶:M4 ]*y7,T*ի\W7F"4cm!0: XjH&M6+{1&O N}Α#G@!(a$ Rg"ↁ k:ll6W|d@>/r9$Hu'ߜZ4fl70]#67Mt:18AMSJ^cLL@>g+u,VUqq0 \. ~MM1Wo~)(G7 iXE (5vgSRJ|, D)ѣ8eYUF,4 ( e*/ 3RJ8::;;io&h۶I44B X( ^x!5,hYdsyBupƍټysMnXsTkhZ#Dk# cd I,!1Mb9b!nK196$A^RLb{#3Xp'j7WkӦOEF5.}~3ޫL% ˉJI|yx#n_<05!Tk7CCꗽ4E';Yzb*6IewRjHJ'4y/X FwG\DaΞHi{%w1c-%8J@ꠗ2XOep?]ۑZ%GFi8r_|z;@IŢőC'5j $&o`:9>+>>p]ױm)k4䖴5.hwyIPG"V T@*!V )=-.ض3+!fB^8/\utf!+E{BxҦRTUk%zC]XQuSSwS,+* .]%Knp3ޙ=^wd2^*؋rlRʪMlc^mWU Μ9S-[>T͛7 hoogϞ=̝;n^{54O>$<CCCܹ~s=<!&tRvE[[/2gf ¶mذa .t_yMzzzVOVpXCM2E*9s樁vZ7u)@_^?~\a%P˗/W P?U8VhTرC)MoN믿NWWW~2nm{۷ 6pEZ[[h׋ O<RJ k׮eԩ^`0O?M8&SOl2>iYիWNy*Xb< ˗/^˗ٴiׯ'as=۷zqʿR$Ilr:LP'M˲|7׽ƛޱO8A:PJ4`ҥKex\!(UP(7~{y;FOOH6}#/ bhGp~DmvREweqgŅF)!DcBRyqFʟc{,IENDB`xsp-4.2/test/README0000664000175000017500000000643412627046413010767 00000000000000xsp/test --------- This directory contains little sample ASP.NET pages. About Web Services samples -------------------------- Summary of files: TestService.asmx: A simple web service ConverterService.asmx: Currency converter web service DumpExtension.cs: Soap extension that dumps all requests to a file. EncryptExtension.cs: Soap extension that encrypts all requests. TraceExtension.cs: Soap extension that logs the soap messages. ServiceClient.cs: Simple web service client Reference.cs: Web service client proxies. ServiceClient.exe.config: Configuration file for ServiceClient. There are two sample web services, implemented in TestService.asmx and ConverterService.asmx. TestService.asmx is a very simple web services with two methods. It shows how simple is to implement web services using ASP.NET. The ConverterService implements a simple currency converter. With it you can make conversions between a limited set of currencies, get a list of currency rates, get the rate of a given currency or change the rate of a currency. This sample shows most of the functionality you can get from ASP.NET web services. The service uses Soap headers to keep information about the currently logged user. Before calling any other method, the client must call Login(). This method generates an Out header with user information that is sent and stored in the client. All subsequent calls will include that header so the server will be able to validate the user. This WS also makes extensive use of Soap extensions. There are three of them: - DumpExtension (DumpExtension.cs): This is a global extension that must be configured in the web.config file. It dumps all requests and responses to the file dump.log. It will only dump the calls of classes that have the [Dump] attribute. - EncryptExtension (EncryptExtension.cs): This extension uses the Rijndael algorithm to encrypt all information exchanged between the server and the client. For it to work, the web service class must have the [Encrypt] attribute. The client proxy class used to connect to the service must also have that attribute (see Reference.cs). This is also a global extension that must be configured in web.config. - TraceExtension (TraceExtension.cs): This extensions logs the soap requests and responses to the file trace.log. The difference between TraceExtension and DumpExtension is that TraceExtension logs requests after it's been deserialized, so it can log the method name and parameter types and values. On the other hand DumpExtension just does a raw dump of the received stream. Another difference is that TraceExtension can be applied to individual methods, using the attribute [TraceExtension]. In the client side, the client proxies are implemented in Reference.cs. There is a sample client implemented in ServiceClient.cs that makes some calls to the services. How to test ----------- Build XSP and start the server as usual. cd to xsp/test and run ServiceClient.exe passing the hostname and port: For example: mono ServiceClient.exe localhost:8080 After execution, you should see the files trace.log and dump.log in xsp/server/test with the traces of the requests. You can try to add and remove the encrypt extension from web.config and ServiceClient.exe.config and see in dump.log the information being sent in each case. xsp-4.2/test/xsp.exe.config0000664000175000017500000000051012627046413012655 00000000000000 xsp-4.2/test/Web.sitemap0000664000175000017500000001667412627046413012217 00000000000000 xsp-4.2/test/favicon.ico0000664000175000017500000000257612627046413012233 00000000000000h( oookkkiiiSSSOOOMMM999777111nnnjjjbbbFFF<<<444...***((( %722222222222/%6 8%%#1,%.%%%  *%%%-%%%%'%%%%0!%%%%%%%%%*9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% <,*%%%%%5&%%%%%%7%%%%%%%%%%%%%%%%%(")%%:$8;4338++++++++++++++xsp-4.2/test/App_Code/0000775000175000017500000000000012627055650011635 500000000000000xsp-4.2/test/App_Code/Application.cs0000664000175000017500000000055512627046413014351 00000000000000using System; using System.Web; using System.Web.Configuration; using System.Web.UI; using System.Web.UI.WebControls; namespace Samples { public class Application { public Application (HttpContext ctx) { SiteMapSection sms = WebConfigurationManager.GetSection ("system.web/siteMap") as SiteMapSection; if (sms != null) sms.Enabled = true; } } } xsp-4.2/test/App_Code/Makefile.in0000664000175000017500000003551312627055643013633 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = test/App_Code ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/shave/shave.m4 \ $(top_srcdir)/build/m4/shamrock/expansions.m4 \ $(top_srcdir)/build/m4/shamrock/mono.m4 \ $(top_srcdir)/build/m4/shamrock/monodoc.m4 \ $(top_srcdir)/build/m4/shamrock/programs.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplesdir)" DATA = $(samples_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DMCS = @DMCS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FC = @FC@ FGREP = @FGREP@ GACUTIL = @GACUTIL@ GACUTIL_FLAGS = @GACUTIL_FLAGS@ GMCS = @GMCS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCS = @MCS@ MDOC = @MDOC@ MKDIR_P = @MKDIR_P@ MONO = @MONO@ MONO_MODULE_CFLAGS = @MONO_MODULE_CFLAGS@ MONO_MODULE_LIBS = @MONO_MODULE_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ Q = @Q@ RANLIB = @RANLIB@ RC = @RC@ RUNTIME = @RUNTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SN = @SN@ STRIP = @STRIP@ V = @V@ VERSION = @VERSION@ WEBTRACING = @WEBTRACING@ XSP_VERSION = @XSP_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ expanded_bindir = @expanded_bindir@ expanded_datadir = @expanded_datadir@ expanded_libdir = @expanded_libdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ shavedir = @shavedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplesdir = $(pkglibdir)/test/App_Code/ testfiles = Application.cs samples_DATA = $(testfiles) EXTRA_DIST = $(testfiles) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/App_Code/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/App_Code/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplesDATA: $(samples_DATA) @$(NORMAL_INSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(samplesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(samplesdir)" || exit $$?; \ done uninstall-samplesDATA: @$(NORMAL_UNINSTALL) @list='$(samples_DATA)'; test -n "$(samplesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplesdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(samplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplesDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplesDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-samplesDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-samplesDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xsp-4.2/test/App_Code/Makefile.am0000664000175000017500000000017512627046413013611 00000000000000samplesdir = $(pkglibdir)/test/App_Code/ testfiles = Application.cs samples_DATA = $(testfiles) EXTRA_DIST = $(testfiles) xsp-4.2/test/index.aspx0000664000175000017500000000216712627046413012112 00000000000000<%@ language="C#"%> <%@ Import namespace="System.IO" %> <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> Welcome to Mono XSP!

    Mono Powered

    xsp-4.2/test/mono-powered-big.png0000664000175000017500000000772312627046413013771 00000000000000PNG  IHDR]-SgbKGDC pHYs  tIME 3`IDATxytTU?U*k@ (B@qq9pD[ԡ#.0V60mM303nUF9"aшvB1HD%PYHe%5իl`L+9/o{VIsN@X&a:6 >X^u &Mt3<3twK)OkuRUUœO>yQۍ ܺu<]3 #m]]]2K,hTFQDd8PHvvvʎ e ~_|>f͚O@0Mj0󻷂lРAO+Œo^P$VTTPSSj ByE/ @QJbHǒL+:Dyy9 ,O N<Ay&v̙38`!tuu vH%TNQP l3go|F iDVt8quݼFB<#cpH$G%Et6[PUtQQGNX )%X,tB! u=daFw@~?^UUʢľ!;;Bu\ݻiIJ/Т ^=0 |> > uĈn4;MY8NޔH0ߏA0krEUIA`{^,_ZO= yp*&P@iYY%77' +hXM5}esݹwkW5l;MSb]Z}H )/kD79Mg4RJl)e=J'efs)R^dc ~,>5pd# 㜓ޯ<7JvSthQ!(>_'R*cw_& ss^iU=\k,Qw/:x00 àl ɌG/.=)]w'#'i?<즱 ӻ z v[5S%w ÉCt(Mo;hJ.XW%\[;y6|v!A1,v8n܉ןK& :Ul{g3f^nQ'%9!9=aOxSxۿr 3ŗLIzj穼?}\9|vTq ġ(%㉴aH/reQ +Häi6 J/ )Na˶5:zxO: ÉĆdŘW:BnsF^ Qe帹~'Aiqz5mfRX6}:Ɯ[Lg(tڬ ecFi(6bޑx%'Dh%5^1mH[kdK&BD #$6&))dI)Bϔ)dVomƁ(.%ӧ0 uW39(_Ñ$a`wUMC5aԹp߿uϭ7<@ &,]&`$)?mر!_^kQHV$o*( jj߁?&?0 <'ꩯ{m0)L6^9Рr MO1AO^LOwM87{"ED"!.رMSBX՛)bp2DIi5 RF״ۜN$c{>4$+;D+;珥l¹ie>t`0:m/G@W<H\8DJ;7Ѵ g^iQF#f܎:Yrr3u b8MnUz/;w0vpױwrs~}~h/˔iwwhn9,&4AO'ـ ᰂhő3Ӧ_9\ӡ &-DžSEs躆(sC9Qh"NԜZB*RJ\;.~2YZ2E3Y)S/@G0Ę#۩91|s9ZZvQqei*( NKQ5z/3Nx B-+ESUj=^oc:cƖN;QG0fؗu -gl΅?8춣͛Ost)нe"Sة0n8nO<~˕( /.ɖyFP_ls?eRC[?uy>]E {e_#\*_`)[e6x=rN'|L0)%#F%wL6 0Xl999\5h躆PncGדRяl+UMEtˇ%%^c`vzt\B'[lZw;_GzJ/7Ξ=Jrss2qD*++(//;jskRQQU(..{KarrrXd 7n0 ֯_oRM3_j_zլEi5cǎǏzj+ʢzk֞MpWk.=JUU6l9srJ{1͛3E =1“^/_βe裏;w.h+W Gyp8LEE`֬YLiwhΓ}f <%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %> HtmlTextArea