Add ability to set libpython library

This relates to Bug 1995
pull/1/head
Timothy Pearson 10 years ago
parent 9dfbb777e9
commit 3dbad9809f

@ -231,6 +231,7 @@ def usage(rcode = 2):
print " -h displays this help message" print " -h displays this help message"
print " -c concatenates each module's C/C++ source files [default]" print " -c concatenates each module's C/C++ source files [default]"
print " -d dir where the PyKDE modules will be installed [default %s]" % opt_pytdemoddir print " -d dir where the PyKDE modules will be installed [default %s]" % opt_pytdemoddir
print " -e lib explicitly specify the python library"
print " -g always release the GIL (SIP v3.x behaviour)" print " -g always release the GIL (SIP v3.x behaviour)"
print " -i no concatenation of each module's C/C++ source files" print " -i no concatenation of each module's C/C++ source files"
print " -j # splits the concatenated C++ source files into # pieces [default 1]" print " -j # splits the concatenated C++ source files into # pieces [default 1]"
@ -557,7 +558,7 @@ def set_sip_flags():
kde_sip_flags.append(sipconfig.version_to_sip_tag(kde_version, kdetags, "KDE")) kde_sip_flags.append(sipconfig.version_to_sip_tag(kde_version, kdetags, "KDE"))
def generate_code(mname, imports=None, extra_cflags=None, extra_cxxflags=None, extra_define=None, extra_include_dir=None, extra_lflags=None, extra_lib_dir=None, extra_lib=None, opengl=0, sip_flags=None): def generate_code(mname, imports=None, extra_cflags=None, extra_cxxflags=None, extra_define=None, extra_include_dir=None, extra_lflags=None, extra_lib_dir=None, extra_lib=None, extra_libs=None, opengl=0, sip_flags=None):
"""Generate the code for a module. """Generate the code for a module.
mname is the name of the module. mname is the name of the module.
@ -766,6 +767,9 @@ def generate_code(mname, imports=None, extra_cflags=None, extra_cxxflags=None, e
makefile.extra_cflags.append ("-fno-rtti") makefile.extra_cflags.append ("-fno-rtti")
makefile.extra_cxxflags.append ("-fno-rtti") makefile.extra_cxxflags.append ("-fno-rtti")
if extra_libs:
makefile.extra_libs.extend(extra_libs)
if sipcfg.sip_version < 0x040000 and imports: if sipcfg.sip_version < 0x040000 and imports:
# Inter-module links. # Inter-module links.
for im in imports: for im in imports:
@ -819,7 +823,7 @@ def main(argv):
argv is the list of command line arguments. argv is the list of command line arguments.
""" """
try: try:
optlist, args = getopt.getopt(argv[1:], "hcd:gij:k:L:l:n:o:ruv:wz:") optlist, args = getopt.getopt(argv[1:], "hcd:e:gij:k:L:l:n:o:ruv:wz:")
except getopt.GetoptError: except getopt.GetoptError:
usage() usage()
@ -830,6 +834,7 @@ def main(argv):
global opt_tdebasedir, opt_kdelibdir, opt_kdeincdir, opt_libdir global opt_tdebasedir, opt_kdelibdir, opt_kdeincdir, opt_libdir
global pytde_modules, opt_dep_warnings, opt_dist_name global pytde_modules, opt_dep_warnings, opt_dist_name
global pytde_imports, kde_includes global pytde_imports, kde_includes
global opt_libpython
# Look for '-z' first and process that switch # Look for '-z' first and process that switch
# (command line switches override file switches) # (command line switches override file switches)
@ -846,6 +851,9 @@ def main(argv):
if opt == "-h": if opt == "-h":
usage(0) usage(0)
elif opt == "-e":
opt_libpython = arg
# turns on concatentation (on by default, here for consistency) # turns on concatentation (on by default, here for consistency)
elif opt == "-c": elif opt == "-c":
opt_concat = 1 opt_concat = 1
@ -923,7 +931,10 @@ def main(argv):
set_sip_flags() set_sip_flags()
for module in pytde_modules [opt_startmod:opt_endmod]: for module in pytde_modules [opt_startmod:opt_endmod]:
generate_code (module, pytde_imports [module], extra_lib = module) extra_libs = []
if opt_libpython:
extra_libs.append(opt_libpython)
generate_code (module, pytde_imports [module], extra_lib = module, extra_libs = extra_libs)
# Create the additional Makefiles. # Create the additional Makefiles.
create_makefiles() create_makefiles()

Loading…
Cancel
Save