From 819c807eb73564ea8164317e7a7a27ddb318c787 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sun, 4 Jul 2010 11:04:27 -0400
Subject: [PATCH] Give a better error message if the shipped boost is not
 found.

---
 aksetup_helper.py | 38 +++++++++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/aksetup_helper.py b/aksetup_helper.py
index 345cc94d..924df5d6 100644
--- a/aksetup_helper.py
+++ b/aksetup_helper.py
@@ -483,15 +483,47 @@ class BoostLibraries(Libraries):
 def set_up_shipped_boost_if_requested(conf):
     """Set up the package to use a shipped version of Boost.
 
-    Return a list of extra C files to build.
+    Return a tuple of a list of extra C files to build and extra
+    defines to be used.
     """
+    from os.path import exists
+    import sys
+
     if conf["USE_SHIPPED_BOOST"]:
-        from os.path import exists
         if not exists("bpl-subset/bpl_subset/boost/version.hpp"):
-            raise RuntimeError("The shipped Boost library was not found.")
+            print >>sys.stderr, "------------------------------------------------------------------------"
+            print >>sys.stderr, "The shipped Boost library was not found, but USE_SHIPPED_BOOST is True."
+            print >>sys.stderr, "(It should be under bpl-subset/)"
+            print >>sys.stderr, "------------------------------------------------------------------------"
+            print >>sys.stderr, "If you got this package from git, you probably want to do"
+            print >>sys.stderr, ""
+            print >>sys.stderr, " $ git submodule init"
+            print >>sys.stderr, " $ git submodule update"
+            print >>sys.stderr, ""
+            print >>sys.stderr, "to fetch what you are presently missing. If you got this from"
+            print >>sys.stderr, "a distributed package on the net, that package is broken and"
+            print >>sys.stderr, "should be fixed. For now, I will turn off 'USE_SHIPPED_BOOST'"
+            print >>sys.stderr, "to try and see if the build succeeds that way, but in the long"
+            print >>sys.stderr, "run you might want to either get the missing bits or turn"
+            print >>sys.stderr, "'USE_SHIPPED_BOOST' off."
+            print >>sys.stderr, "------------------------------------------------------------------------"
+            conf["USE_SHIPPED_BOOST"] = False
+
+            delay = 10
+
+            from time import sleep
+            import sys
+            while delay:
+                sys.stdout.write("Continuing in %d seconds...   \r" % delay)
+                sys.stdout.flush()
+                delay -= 1
+                sleep(1)
+
+    if conf["USE_SHIPPED_BOOST"]:
         conf["BOOST_INC_DIR"] = ["bpl-subset/bpl_subset"]
         conf["BOOST_LIB_DIR"] = []
         conf["BOOST_PYTHON_LIBNAME"] = []
+        conf["BOOST_THREAD_LIBNAME"] = []
 
         from glob import glob
         source_files = (glob("bpl-subset/bpl_subset/libs/*/*/*/*.cpp")
-- 
GitLab