|
@@ -306,6 +306,21 @@ def get_version(basedir):
|
|
|
return (text, version)
|
|
|
return ('%s-%s' % (version, hash), version)
|
|
|
|
|
|
+def qt_config(key, *opts):
|
|
|
+ input, output = [], []
|
|
|
+ input.extend(QT_CONFIG['common'])
|
|
|
+ input.extend(QT_CONFIG[key])
|
|
|
+ input.extend(opts)
|
|
|
+ cfg = os.environ.get('WKHTMLTOX_QT_CONFIG')
|
|
|
+ if cfg:
|
|
|
+ input.extend(cfg.split())
|
|
|
+ for arg in input:
|
|
|
+ if not arg.startswith('remove:-'):
|
|
|
+ output.append(arg)
|
|
|
+ elif arg[1+arg.index(':'):] in output:
|
|
|
+ output.remove(arg[1+arg.index(':'):])
|
|
|
+ return ' '.join(output)
|
|
|
+
|
|
|
def build_openssl(config, basedir):
|
|
|
cfg = None
|
|
|
for key in OPENSSL['build']:
|
|
@@ -527,17 +542,14 @@ def build_msvc_common(config, basedir):
|
|
|
qtdir = os.path.join(basedir, config, 'qt')
|
|
|
mkdir_p(qtdir)
|
|
|
|
|
|
- args = []
|
|
|
- args.extend(QT_CONFIG['common'])
|
|
|
- args.extend(QT_CONFIG['msvc'])
|
|
|
- args.append('-I %s\\include' % ssldir)
|
|
|
- args.append('-L %s\\lib' % ssldir)
|
|
|
- args.append('OPENSSL_LIBS="-L%s -lssleay32 -llibeay32 %s"' % \
|
|
|
- (ssldir.replace('\\', '\\\\'), ssl_libs))
|
|
|
+ configure_args = qt_config('msvc',
|
|
|
+ '-I %s\\include' % ssldir,
|
|
|
+ '-L %s\\lib' % ssldir,
|
|
|
+ 'OPENSSL_LIBS="-L%s -lssleay32 -llibeay32 %s"' % (ssldir.replace('\\', '\\\\'), ssl_libs))
|
|
|
|
|
|
os.chdir(qtdir)
|
|
|
if not exists('is_configured'):
|
|
|
- shell('%s\\..\\qt\\configure.exe %s' % (basedir, ' '.join(args)))
|
|
|
+ shell('%s\\..\\qt\\configure.exe %s' % (basedir, configure_args))
|
|
|
open('is_configured', 'w').write('')
|
|
|
shell('nmake')
|
|
|
|
|
@@ -586,19 +598,17 @@ def build_mingw64_cross(config, basedir):
|
|
|
|
|
|
mkdir_p(build)
|
|
|
|
|
|
- args = []
|
|
|
- args.extend(QT_CONFIG['common'])
|
|
|
- args.extend(QT_CONFIG['mingw-w64-cross'])
|
|
|
- args.append('--prefix=%s' % qtdir)
|
|
|
- args.append('-I %s/include' % ssldir)
|
|
|
- args.append('-L %s/lib' % ssldir)
|
|
|
- args.append('-device-option CROSS_COMPILE=%s-' % MINGW_W64_PREFIX[rchop(config, '-dbg')])
|
|
|
+ configure_args = qt_config('mingw-w64-cross',
|
|
|
+ '--prefix=%s' % qtdir,
|
|
|
+ '-I %s/include' % ssldir,
|
|
|
+ '-L %s/lib' % ssldir,
|
|
|
+ '-device-option CROSS_COMPILE=%s-' % MINGW_W64_PREFIX[rchop(config, '-dbg')])
|
|
|
|
|
|
os.environ['OPENSSL_LIBS'] = '-lssl -lcrypto -L %s/lib %s' % (ssldir, ssl_libs)
|
|
|
|
|
|
os.chdir(build)
|
|
|
if not exists('is_configured'):
|
|
|
- shell('%s/../qt/configure %s' % (basedir, ' '.join(args)))
|
|
|
+ shell('%s/../qt/configure %s' % (basedir, configure_args))
|
|
|
shell('touch is_configured')
|
|
|
shell('make -j%d' % CPU_COUNT)
|
|
|
shell('make install')
|
|
@@ -640,10 +650,7 @@ def build_linux_schroot(config, basedir):
|
|
|
mkdir_p(os.path.join(dist, 'include', 'wkhtmltox'))
|
|
|
mkdir_p(os.path.join(dist, 'lib'))
|
|
|
|
|
|
- args = []
|
|
|
- args.extend(QT_CONFIG['common'])
|
|
|
- args.extend(QT_CONFIG['posix'])
|
|
|
- args.append('--prefix=../qt')
|
|
|
+ configure_args = qt_config('posix', '--prefix=../qt')
|
|
|
|
|
|
lines = ['#!/bin/bash']
|
|
|
lines.append('# start of autogenerated build script')
|
|
@@ -653,7 +660,7 @@ def build_linux_schroot(config, basedir):
|
|
|
lines.append('export CXXFLAGS=-march=i486')
|
|
|
|
|
|
lines.append('if [ ! -f is_configured ]; then')
|
|
|
- lines.append(' ../../../qt/configure %s || exit 1' % ' '.join(args))
|
|
|
+ lines.append(' ../../../qt/configure %s || exit 1' % configure_args)
|
|
|
lines.append(' touch is_configured')
|
|
|
lines.append('fi')
|
|
|
lines.append('if ! make -j%d -q; then\n make -j%d || exit 1\nfi' % (CPU_COUNT, CPU_COUNT))
|