Boost logo

Boost-Commit :

From: lists.drrngrvy_at_[hidden]
Date: 2008-03-29 14:36:56


Author: drrngrvy
Date: 2008-03-29 14:36:55 EDT (Sat, 29 Mar 2008)
New Revision: 43935
URL: http://svn.boost.org/trac/boost/changeset/43935

Log:
Modify project-root.jam to allow user to set htdocs directory (for amortization example files).
Text files modified:
   sandbox/SOC/2007/cgi/trunk/boost/cgi/response.hpp | 1 +
   sandbox/SOC/2007/cgi/trunk/project-root.jam | 39 ++++++++++++++++++++++++++++++++++++++-
   2 files changed, 39 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2007/cgi/trunk/boost/cgi/response.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/boost/cgi/response.hpp (original)
+++ sandbox/SOC/2007/cgi/trunk/boost/cgi/response.hpp 2008-03-29 14:36:55 EDT (Sat, 29 Mar 2008)
@@ -95,6 +95,7 @@
       ostream_.clear();
       headers_.clear();
       headers_terminated_ = false;
+ //buffer_->consume(
     }
 
     /// Return the response to the 'just constructed' state.

Modified: sandbox/SOC/2007/cgi/trunk/project-root.jam
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/project-root.jam (original)
+++ sandbox/SOC/2007/cgi/trunk/project-root.jam 2008-03-29 14:36:55 EDT (Sat, 29 Mar 2008)
@@ -40,7 +40,7 @@
     }
     else
     {
- return $(top)/$(protocol:L)"-bin" ;
+ return "$(top)/$(protocol:L)-bin" ;
     }
   }
 }
@@ -49,6 +49,43 @@
 path-constant fcgi-bin : [ get-bin-dir "fcgi" ] ;
 path-constant scgi-bin : [ get-bin-dir "scgi" ] ;
 
+#############################################################################
+# Rule to extract the directory for web documents (some servers call it
+# the htdocs folder). The amortization examples will want this to be set.
+#
+# User can pass either:
+#
+# --htdocs=/path/to/htdocs
+#
+# on the bjam command line OR set the environment variable:
+#
+# BOOST_CGI_HTDOCS_PATH
+#
+# Note that the command line will override the environment variable!
+#############################################################################
+local rule get-htdocs-dir ( )
+{
+ local dir = [ MATCH "^--htdocs=(.*)" : [ modules.peek : ARGV ] ] ;
+ if $(dir)
+ {
+ return $(dir) ;
+ }
+ else
+ {
+ dir = [ os.environ "BOOST_CGI_HTDOCS_PATH" ] ;
+ if $(dir)
+ {
+ return $(dir) ;
+ }
+ else
+ {
+ return "$(top)/htdocs" ;
+ }
+ }
+}
+
+path-constant htdocs : [ get-htdocs-dir ] ;
+
 
 use-project /boost/ : $(boost-root) ;
 use-project /boost/cgi/ : $(top)/libs/cgi/build ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk