Boost logo

Boost-Commit :

From: lists.drrngrvy_at_[hidden]
Date: 2008-05-19 15:25:17


Author: drrngrvy
Date: 2008-05-19 15:25:17 EDT (Mon, 19 May 2008)
New Revision: 45558
URL: http://svn.boost.org/trac/boost/changeset/45558

Log:
Updated project-root.jam
Text files modified:
   sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/echo/main.cpp | 14 +++++++-
   sandbox/SOC/2007/cgi/trunk/project-root.jam | 62 +++++++++++++++++++++++++++++++--------
   2 files changed, 61 insertions(+), 15 deletions(-)

Modified: sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/echo/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/echo/main.cpp (original)
+++ sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/echo/main.cpp 2008-05-19 15:25:17 EDT (Mon, 19 May 2008)
@@ -28,8 +28,8 @@
 #define LOG_FILE "/var/www/log/fcgi_echo.txt"
 
 //
-// This function writes the title and map contents to the ostream in an
-// HTML-encoded format (to make them easier on the eye).
+// Write the title and map contents to the ostream in an HTML-encoded
+// format (to make them easier on the eye).
 //
 template<typename Map, typename OStream>
 void format_map(OStream& os, Map& m, const std::string& title)
@@ -43,6 +43,15 @@
   }
 }
 
+std::size_t process_id()
+{
+#if defined(BOOST_WINDOWS)
+ return _getpid();
+#else
+ return getpid();
+#endif
+}
+
 /// This function accepts and handles a single request.
 template<typename Request, typename LogStream>
 int handle_request(Request& req, LogStream& of)
@@ -71,6 +80,7 @@
   // You can also stream text to a response object.
       << "Hello there, universe!<p />"
       << "Request id = " << req.id() << "<p />"
+ << "Process id = " << process_id() << "<p />"
       << "<form method=POST enctype='multipart/form-data'>"
           "<input type=text name=name value='" << req.POST("name") << "' />"
           "<br />"

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-05-19 15:25:17 EDT (Mon, 19 May 2008)
@@ -1,11 +1,56 @@
 import os ;
 import modules ;
 
-path-constant BOOST_BUILD_PATH : [ os.environ BOOST_BUILD_PATH ] ;
+local rule get-boost-root ( )
+{
+ local boost-root = [ MATCH "^--boost-root=(.*)" : [ modules.peek : ARGV ] ] ;
+ if $(boost-root)
+ {
+ return $(boost-root) ;
+ }
+ else
+ {
+ boost-root = [ os.environ BOOST_ROOT ] ;
+ if $(boost-root)
+ {
+ return $(boost-root) ;
+ }
+ else
+ {
+ ERROR "Can't find your Boost source. Either set the environment " ;
+ ERROR "variable BOOST_ROOT or pass --boost-root=/path/to/source on the " ;
+ ERROR "command line." ;
+ }
+ }
+}
+
+# Get the boost root
+path-constant boost-root : [ get-boost-root ] ;
+
+local rule get-bbv2-path ( boost-root * )
+{
+ local bbv2-path = [ os.environ BOOST_BUILD_PATH ] ;
+ if $(bbv2-path)
+ {
+ return $(bbv2-path) ;
+ }
+ else
+ if $(boost-root)
+ {
+ return "$(boost-root)/tools/build/v2" ;
+ }
+ else
+ {
+ ERROR "Can't find Boost Build. Please set either the environment variable " ;
+ ERROR "BOOST_ROOT (to your boost sources) or BOOST_BUILD_PATH (to boost build's " ;
+ ERROR "sources - usually located in BOOST_ROOT/tools/build/v2." ;
+ }
+}
+
+path-constant BOOST_BUILD_PATH : [ get-bbv2-path ] ;
 
 path-constant top : . ;
 path-constant include-dir : /usr/local/include ;
-path-constant boost-root : [ os.environ BOOST_ROOT ] ;
 
 # A relative path to boost (for documentation stuff)
 path-constant boost-root-relative : $(top)/../../../../boost/trunk/ ;
@@ -40,7 +85,7 @@
     }
     else
     {
- return "$(top)/$(protocol:L)-bin" ;
+ return "$(top)/libs/cgi/example/$(protocol:L)-bin" ;
     }
   }
 }
@@ -90,13 +135,4 @@
 use-project /boost/ : $(boost-root) ;
 use-project /boost/cgi/ : $(top)/libs/cgi/build ;
 
-
-project cgi
- : build-dir
- $(top)/bin.v2
- : requirements
- <include>$(boost-root)
- <include>$(top)
- <define>_CRT_SECURE_NO_WARNINGS
- <define>_SCL_SECURE_NO_WARNINGS
- ;
+project anon : build-dir bin.v2 ;


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