|
|
|
@ -1,17 +1,17 @@
|
|
|
|
|
# This script handles the SIP configuration and generates the Makefiles. |
|
|
|
|
# This script handles the SIP-TQt configuration and generates the Makefiles. |
|
|
|
|
# |
|
|
|
|
# Copyright (c) 2010 Riverbank Computing Limited <info@riverbankcomputing.com> |
|
|
|
|
# |
|
|
|
|
# This file is part of SIP. |
|
|
|
|
# This file is part of SIP-TQt. |
|
|
|
|
# |
|
|
|
|
# This copy of SIP is licensed for use under the terms of the SIP License |
|
|
|
|
# This copy of SIP-TQt is licensed for use under the terms of the SIP License |
|
|
|
|
# Agreement. See the file LICENSE for more details. |
|
|
|
|
# |
|
|
|
|
# This copy of SIP may also used under the terms of the GNU General Public |
|
|
|
|
# This copy of SIP-TQt may also used under the terms of the GNU General Public |
|
|
|
|
# License v2 or v3 as published by the Free Software Foundation which can be |
|
|
|
|
# found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. |
|
|
|
|
# |
|
|
|
|
# SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
# SIP-TQt is supplied WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,7 +129,7 @@ def set_defaults():
|
|
|
|
|
"cygwin": "cygwin-g++", |
|
|
|
|
"darwin": "macx-g++", |
|
|
|
|
"dgux": "dgux-g++", |
|
|
|
|
"freebsd": "freebsd-g++", |
|
|
|
|
"freebsd": "freebsd-clang", |
|
|
|
|
"gnu": "hurd-g++", |
|
|
|
|
"hp-ux": "hpux-acc", |
|
|
|
|
"irix": "irix-cc", |
|
|
|
@ -165,7 +165,7 @@ def set_defaults():
|
|
|
|
|
break |
|
|
|
|
|
|
|
|
|
default_sipbindir = plat_bin_dir |
|
|
|
|
default_sipmoddir = os.path.join(plat_py_site_dir, 'sip4_tqt') |
|
|
|
|
default_sipmoddir = plat_py_site_dir |
|
|
|
|
default_sipincdir = plat_py_inc_dir |
|
|
|
|
default_sipsipdir = plat_sip_dir |
|
|
|
|
|
|
|
|
@ -173,9 +173,9 @@ def set_defaults():
|
|
|
|
|
def inform_user(): |
|
|
|
|
"""Tell the user the option values that are going to be used. |
|
|
|
|
""" |
|
|
|
|
siputils.inform("The SIP code generator will be installed in %s." % opts.sipbindir) |
|
|
|
|
siputils.inform("The SIP module will be installed in %s." % opts.sipmoddir) |
|
|
|
|
siputils.inform("The SIP header file will be installed in %s." % opts.sipincdir) |
|
|
|
|
siputils.inform("The SIP-TQt code generator will be installed in %s." % opts.sipbindir) |
|
|
|
|
siputils.inform("The SIP-TQt module will be installed in %s." % opts.sipmoddir) |
|
|
|
|
siputils.inform("The SIP-TQt header file will be installed in %s." % opts.sipincdir) |
|
|
|
|
siputils.inform("The default directory to install .sip files in is %s." % opts.sipsipdir) |
|
|
|
|
siputils.inform("The platform/compiler configuration is %s." % opts.platform) |
|
|
|
|
|
|
|
|
@ -201,17 +201,17 @@ def set_platform_directories():
|
|
|
|
|
if sys.platform == "win32": |
|
|
|
|
plat_py_lib_dir = sys.prefix + "\\libs" |
|
|
|
|
plat_bin_dir = sys.exec_prefix |
|
|
|
|
plat_sip_dir = sys.prefix + "\\sip" |
|
|
|
|
plat_sip_dir = sys.prefix + "\\sip-tqt" |
|
|
|
|
else: |
|
|
|
|
lib_dir = sysconfig.get_python_lib(plat_specific=1, standard_lib=1) |
|
|
|
|
|
|
|
|
|
plat_py_lib_dir = lib_dir + "/config" |
|
|
|
|
plat_bin_dir = sys.exec_prefix + "/bin" |
|
|
|
|
plat_sip_dir = sys.prefix + "/share/sip" |
|
|
|
|
plat_sip_dir = sys.prefix + "/share/sip-tqt" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_config(module, template, macros): |
|
|
|
|
"""Create the SIP configuration module so that it can be imported by build |
|
|
|
|
"""Create the SIP-TQt configuration module so that it can be imported by build |
|
|
|
|
scripts. |
|
|
|
|
|
|
|
|
|
module is the module file name. |
|
|
|
@ -225,7 +225,7 @@ def create_config(module, template, macros):
|
|
|
|
|
"sip_version": sip_version, |
|
|
|
|
"sip_version_str": sip_version_str, |
|
|
|
|
"platform": opts.platform, |
|
|
|
|
"sip_bin": os.path.join(opts.sipbindir, "sip"), |
|
|
|
|
"sip_bin": os.path.join(opts.sipbindir, "sip-tqt"), |
|
|
|
|
"sip_inc_dir": opts.sipincdir, |
|
|
|
|
"sip_mod_dir": opts.sipmoddir, |
|
|
|
|
"default_bin_dir": plat_bin_dir, |
|
|
|
@ -249,26 +249,24 @@ def create_makefiles(macros, extra_lib_dir=None, extra_libs=None):
|
|
|
|
|
""" |
|
|
|
|
# Bootstrap. Make sure we get the right one. |
|
|
|
|
sys.path.insert(0, os.path.curdir) |
|
|
|
|
import sipconfig |
|
|
|
|
import sip_tqt_config |
|
|
|
|
|
|
|
|
|
cfg = sipconfig.Configuration() |
|
|
|
|
cfg = sip_tqt_config.Configuration() |
|
|
|
|
|
|
|
|
|
cfg.set_build_macros(macros) |
|
|
|
|
|
|
|
|
|
sipconfig.inform("Creating top level Makefile...") |
|
|
|
|
sip_tqt_config.inform("Creating top level Makefile...") |
|
|
|
|
|
|
|
|
|
open('__init__.py', 'a').close() |
|
|
|
|
|
|
|
|
|
sipconfig.ParentMakefile( |
|
|
|
|
sip_tqt_config.ParentMakefile( |
|
|
|
|
configuration=cfg, |
|
|
|
|
subdirs=["sipgen", "siplib"], |
|
|
|
|
installs=(["__init__.py", "sipconfig.py", os.path.join(src_dir, "sipdistutils.py")], |
|
|
|
|
installs=(["sip_tqt_config.py", os.path.join(src_dir, "sip_tqt_distutils.py")], |
|
|
|
|
cfg.sip_mod_dir) |
|
|
|
|
).generate() |
|
|
|
|
|
|
|
|
|
sipconfig.inform("Creating sip code generator Makefile...") |
|
|
|
|
sip_tqt_config.inform("Creating sip-tqt code generator Makefile...") |
|
|
|
|
|
|
|
|
|
sipconfig.ProgramMakefile( |
|
|
|
|
sip_tqt_config.ProgramMakefile( |
|
|
|
|
configuration=cfg, |
|
|
|
|
build_file=os.path.join(src_dir, "sipgen", "sipgen.sbf"), |
|
|
|
|
dir="sipgen", |
|
|
|
@ -279,14 +277,14 @@ def create_makefiles(macros, extra_lib_dir=None, extra_libs=None):
|
|
|
|
|
arch=opts.arch |
|
|
|
|
).generate() |
|
|
|
|
|
|
|
|
|
sipconfig.inform("Creating sip module Makefile...") |
|
|
|
|
sip_tqt_config.inform("Creating sip-tqt module Makefile...") |
|
|
|
|
|
|
|
|
|
makefile = sipconfig.ModuleMakefile( |
|
|
|
|
makefile = sip_tqt_config.ModuleMakefile( |
|
|
|
|
configuration=cfg, |
|
|
|
|
build_file=os.path.join(src_dir, "siplib", "siplib.sbf"), |
|
|
|
|
dir="siplib", |
|
|
|
|
install_dir=cfg.sip_mod_dir, |
|
|
|
|
installs=([os.path.join(src_dir, "siplib", "sip.h")], cfg.sip_inc_dir), |
|
|
|
|
installs=([os.path.join(src_dir, "siplib", "sip-tqt.h")], cfg.sip_inc_dir), |
|
|
|
|
console=1, |
|
|
|
|
warnings=0, |
|
|
|
|
static=opts.static, |
|
|
|
@ -315,7 +313,7 @@ def create_optparser():
|
|
|
|
|
|
|
|
|
|
# Note: we don't use %default to be compatible with Python 2.3. |
|
|
|
|
p.add_option("-k", "--static", action="store_true", default=False, |
|
|
|
|
dest="static", help="build the SIP module as a static library") |
|
|
|
|
dest="static", help="build the SIP-TQt module as a static library") |
|
|
|
|
p.add_option("-p", "--platform", action="store", |
|
|
|
|
default=default_platform, type="string", metavar="PLATFORM", |
|
|
|
|
dest="platform", help="the platform/compiler configuration " |
|
|
|
@ -342,7 +340,7 @@ def create_optparser():
|
|
|
|
|
help="build for architecture ARCH") |
|
|
|
|
g.add_option("-n", "--universal", action="store_true", default=False, |
|
|
|
|
dest="universal", |
|
|
|
|
help="build the SIP code generator and module as universal " |
|
|
|
|
help="build the SIP-TQt code generator and module as universal " |
|
|
|
|
"binaries") |
|
|
|
|
g.add_option("-s", "--sdk", action="store", default=default_sdk, |
|
|
|
|
type="string", metavar="SDK", dest="sdk", |
|
|
|
@ -364,16 +362,16 @@ def create_optparser():
|
|
|
|
|
g = optparse.OptionGroup(p, title="Installation") |
|
|
|
|
g.add_option("-b", "--bindir", action="callback", |
|
|
|
|
default=default_sipbindir, type="string", metavar="DIR", |
|
|
|
|
dest="sipbindir", callback=store_abspath, help="where the SIP " |
|
|
|
|
dest="sipbindir", callback=store_abspath, help="where the SIP-TQt " |
|
|
|
|
"code generator will be installed [default: %s]" % |
|
|
|
|
default_sipbindir) |
|
|
|
|
g.add_option("-d", "--destdir", action="callback", |
|
|
|
|
default=default_sipmoddir, type="string", metavar="DIR", |
|
|
|
|
dest="sipmoddir", callback=store_abspath, help="where the SIP " |
|
|
|
|
dest="sipmoddir", callback=store_abspath, help="where the SIP-TQt " |
|
|
|
|
"module will be installed [default: %s]" % default_sipmoddir) |
|
|
|
|
g.add_option("-e", "--incdir", action="callback", |
|
|
|
|
default=default_sipincdir, type="string", metavar="DIR", |
|
|
|
|
dest="sipincdir", callback=store_abspath, help="where the SIP " |
|
|
|
|
dest="sipincdir", callback=store_abspath, help="where the SIP-TQt " |
|
|
|
|
"header file will be installed [default: %s]" % default_sipincdir) |
|
|
|
|
g.add_option("-v", "--sipdir", action="callback", |
|
|
|
|
default=default_sipsipdir, type="string", metavar="DIR", |
|
|
|
@ -389,10 +387,10 @@ def main(argv):
|
|
|
|
|
|
|
|
|
|
argv is the list of command line arguments. |
|
|
|
|
""" |
|
|
|
|
siputils.inform("This is SIP %s for Python %s on %s." % (sip_version_str, sys.version.split()[0], sys.platform)) |
|
|
|
|
siputils.inform("This is SIP-TQt %s for Python %s on %s platform." % (sip_version_str, sys.version.split()[0], sys.platform)) |
|
|
|
|
|
|
|
|
|
if py_version < 0x020300: |
|
|
|
|
siputils.error("This version of SIP requires Python v2.3 or later.") |
|
|
|
|
siputils.error("This version of SIP-TQt requires Python v2.3 or later.") |
|
|
|
|
|
|
|
|
|
global extra_lib_dir |
|
|
|
|
|
|
|
|
@ -467,7 +465,7 @@ def main(argv):
|
|
|
|
|
inform_user() |
|
|
|
|
|
|
|
|
|
# Install the configuration module. |
|
|
|
|
create_config("sipconfig.py", os.path.join(src_dir, "siputils.py"), |
|
|
|
|
create_config("sip_tqt_config.py", os.path.join(src_dir, "siputils.py"), |
|
|
|
|
macros) |
|
|
|
|
|
|
|
|
|
# Create the Makefiles. |
|
|
|
|