$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: lists.drrngrvy_at_[hidden]
Date: 2008-03-21 12:24:14
Author: drrngrvy
Date: 2008-03-21 12:24:14 EDT (Fri, 21 Mar 2008)
New Revision: 43745
URL: http://svn.boost.org/trac/boost/changeset/43745
Log:
Updated project-root.jam that allows users to install examples straight into their cgi-bin / fcgi-bin / etc. directory using either the command line or environment variables.
Text files modified: 
   sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam |    67 +++++++++++++++++++++++++-------------- 
   1 files changed, 43 insertions(+), 24 deletions(-)
Modified: sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam
==============================================================================
--- sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam	(original)
+++ sandbox/SOC/2007/cgi/branches/acceptor_work/project-root.jam	2008-03-21 12:24:14 EDT (Fri, 21 Mar 2008)
@@ -5,44 +5,63 @@
 path-constant BOOST_BUILD_PATH : [ os.environ BOOST_BUILD_PATH ] ;
 
 path-constant PROJECT_ROOT : . ;
-path-constant BOOST_CGI_BIN_DIR : c:/Apache/Apache2.2/cgi-bin ;
 
 path-constant top : . ;
 path-constant include-dir : /usr/local/include ;
 path-constant boost-root : [ os.environ BOOST_ROOT ] ;
-path-constant google-root : $(include-dir)/google ;
 
-# These are some helper variables, which will need to be checked against
-# user-supplied variables (ie. using modules.peek, I think)
-#local cgi-bin = [ modules.peek : cgi-bin ] ;
-path-constant cgi-bin : /usr/lib/cgi-bin ;
-path-constant scgi-bin : /usr/lib/scgi-bin ;
-path-constant fcgi-bin : /usr/lib/fcgi-bin ;
-#if (!cgi-bin)
-#{
-#  cgi-bin = [ os.environ BOOST_CGI_CGI_BIN ] ;
+# A relative path to boost (for documentation stuff)
+path-constant boost-root-relative : $(top)/../../../../boost/trunk/ ;
+
+
+#############################################################################
+# Rule so we can extract install bin directories easily
 #
-#  if (!cgi-bin)
-#  {
-#    cgi-bin = /usr/lib/cgi-bin ;
-#  }
-#}
-
-use-project /boost/system/ : $(boost-root)/libs/system/build ;
-use-project /boost/thread/ : $(boost-root)/libs/thread/build ;
-use-project /boost/regex/  : $(boost-root)/libs/regex/build  ;
+# User can pass either:
+# 
+# --cgi-bin=/path/to/cgi-bin (equally with fcgi-bin / scgi-bin)
+# 
+# on the bjam command line OR set the environment variable:
+# 
+# BOOST_CGI_BIN_PATH (equally with BOOST_FCGI_BIN_PATH / BOOST_SCGI_BIN_PATH)
+#
+# Note that the command line will override the environment variable!
+#############################################################################
+local rule get-bin-dir ( bin-name : envvar )
+{
+  local bin-dir = [ MATCH "^--$(bin-name)=(.*)" : [ modules.peek : ARGV ] ] ;
+  if $(bin-dir)
+  {
+    return $(bin-dir) ;
+  }
+  else
+  {
+    bin-dir = [ os.environ $(envvar) ] ;
+    if $(bin-dir)
+    {
+      return $(bin-dir) ;
+    }
+    return $(top)/$(bin-name) ;
+  }
+}
+
+path-constant cgi-bin  : [ get-bin-dir "cgi-bin" : "BOOST_CGI_BIN_PATH" ] ; 
+path-constant fcgi-bin : [ get-bin-dir "fcgi-bin" : "BOOST_FCGI_BIN_PATH" ] ;
+path-constant scgi-bin : [ get-bin-dir "scgi-bin" : "BOOST_SCGI_BIN_PATH" ] ;
+
+
 use-project /google/template/ : $(top)/libs/cgi/util/google/ ;
 use-project /boost/ : $(boost-root) ;
+use-project /boost/cgi/ : $(top)/libs/cgi/build ;
+
 
-project boost.cgi
+project cgi
   : build-dir
       $(top)/bin.v2
   : requirements
       <include>$(boost-root)
       <include>$(top)
-      <library>/boost/system/
-      <library>/boost/thread/
-      #<linkflags>-lctemplate
+      #<include>C:\cc\src\ctemplate\windows
       <define>_CRT_SECURE_NO_WARNINGS
       <define>_SCL_SECURE_NO_WARNINGS
   ;