Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
use static linkage for MinGW target
Browse files Browse the repository at this point in the history
This effectively reverts cf53180,
and produces zero-dependency executables which also work on Windows
XP/2003 and above.
  • Loading branch information
ashkulz committed Nov 22, 2016
1 parent 2efc11d commit 55008f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 2 additions & 1 deletion common.pri
Expand Up @@ -23,7 +23,8 @@ CONFIG(static, shared|static):lessThan(QT_MAJOR_VERSION, 5) {
INCLUDEPATH += ../../include
RESOURCES = $$PWD/wkhtmltopdf.qrc

win32: CONFIG += console
win32: CONFIG += console
win32-g++*: QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++

QT += webkit network xmlpatterns svg
greaterThan(QT_MAJOR_VERSION, 4) {
Expand Down
8 changes: 0 additions & 8 deletions scripts/build.py
Expand Up @@ -981,14 +981,6 @@ def build_mingw64_cross(config, basedir):
shell('%s/bin/qmake -spec win32-g++-4.6 %s/../wkhtmltopdf.pro' % (qtdir, basedir))
shell('make')
shutil.copy('bin/libwkhtmltox0.a', 'bin/wkhtmltox.lib')
shell('rm -f bin/lib*.dll')
for dll in ['libgcc_s_sjlj-1.dll', 'libgcc_s_seh-1.dll', 'libstdc++-6.dll']:
dll_path = get_output('dpkg', '-S', dll)
if dll_path:
for line in dll_path.split('\n'):
loc = line[1+line.index(':'):].strip()
if exists(loc) and MINGW_W64_PREFIX[rchop(config, '-dbg')] in loc and '-posix' not in loc:
shell('cp %s bin/' % loc)

if config.endswith('-dbg'):
return
Expand Down
5 changes: 1 addition & 4 deletions wkhtmltox.nsi
Expand Up @@ -36,11 +36,11 @@ Function ${un}DeleteFiles
Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\wkhtmltopdf.exe"
Delete "$INSTDIR\wkhtmltoimage.exe"
; remove as per current installer layout
Delete "$INSTDIR\bin\libgcc_s_sjlj-1.dll"
Delete "$INSTDIR\bin\libgcc_s_seh-1.dll"
Delete "$INSTDIR\bin\libstdc++-6.dll"
Delete "$INSTDIR\bin\libwinpthread-1.dll"
; remove as per current installer layout
Delete "$INSTDIR\bin\wkhtmltoimage.exe"
Delete "$INSTDIR\bin\wkhtmltopdf.exe"
Delete "$INSTDIR\bin\wkhtmltox.dll"
Expand Down Expand Up @@ -87,9 +87,6 @@ skip_vcruntime:
File static-build\${TARGET}\app\bin\wkhtmltoimage.exe
File static-build\${TARGET}\app\bin\wkhtmltopdf.exe
File static-build\${TARGET}\app\bin\wkhtmltox.dll
!ifdef MINGW
File static-build\${TARGET}\app\bin\lib*.dll
!endif

SetOutPath "$INSTDIR\lib"
File static-build\${TARGET}\app\bin\wkhtmltox.lib
Expand Down

0 comments on commit 55008f5

Please sign in to comment.