From 80c7008c01b8bce9be721d925ebfb5d0cc696279 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Date: Tue, 23 Sep 2014 16:41:22 -0500
Subject: Add ability to set libpython library This relates to Bug 1995

---
 configure.py | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/configure.py b/configure.py
index c58fe75..bfdbe2b 100644
--- a/configure.py
+++ b/configure.py
@@ -242,7 +242,7 @@ def create_config(module, template, macros):
     siputils.create_config_module(module, template, content, macros)
 
 
-def create_makefiles(macros):
+def create_makefiles(macros, extra_lib_dir=None, extra_libs=None):
     """Create the Makefiles.
 
     macros is the dictionary of platform specific build macros.
@@ -295,6 +295,12 @@ def create_makefiles(macros):
         arch=opts.arch
     )
 
+    if extra_lib_dir:
+        makefile.extra_lib_dirs.append(extra_lib_dir)
+
+    if extra_libs:
+        makefile.extra_libs.extend(extra_libs)
+
     makefile.generate()
 
 
@@ -316,6 +322,10 @@ def create_optparser():
             "[default: %s]" % default_platform)
     p.add_option("-u", "--debug", action="store_true", default=False,
             help="build with debugging symbols")
+    p.add_option("-g", "--libpython",
+            default=None, type="string", metavar="LIB",
+            dest="libpython", help="python "
+            "library name [default: %s]" % None)
 
     if sys.platform == 'darwin':
         # Get the latest SDK to use as the default.
@@ -384,6 +394,8 @@ def main(argv):
     if py_version < 0x020300:
         siputils.error("This version of SIP requires Python v2.3 or later.")
 
+    global extra_lib_dir
+
     # Basic initialisation.
     set_platform_directories()
 
@@ -414,6 +426,12 @@ def main(argv):
 
         sys.exit()
 
+    extra_libs = []
+    extra_lib_dir = None
+
+    if opts.libpython:
+        extra_libs.append(opts.libpython)
+
     # Convert the list 'arch' option to a string.  Multiple architectures
     # imply a universal binary.
     if len(opts.arch) > 1:
@@ -453,7 +471,7 @@ def main(argv):
             macros)
 
     # Create the Makefiles.
-    create_makefiles(macros)
+    create_makefiles(macros, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs)
 
 
 ###############################################################################
-- 
cgit v1.2.3

