From d6f7e86623a2ea7725b10f86abc8bd6c45677fed Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 4 Nov 2023 22:02:12 +0100 Subject: [PATCH] [windows] build static --- cross/linux-mingw64.txt | 2 +- doc/tools/elinks_wine.py | 15 +++++++++++++++ src/meson.build | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 doc/tools/elinks_wine.py diff --git a/cross/linux-mingw64.txt b/cross/linux-mingw64.txt index 09c081a0..824e907c 100644 --- a/cross/linux-mingw64.txt +++ b/cross/linux-mingw64.txt @@ -16,7 +16,7 @@ root = '/usr/x86_64-w64-mingw32' # Directory that contains 'bin', 'lib', etc for the toolchain and system libraries #sys_root = '/usr/i586-pc-msdosdjgpp/sys-include/' need_exe_wrapper = true -#elinks_wrapper = 'wine' +elinks_wrapper = 'elinks_wine.py' [host_machine] system = 'windows' diff --git a/doc/tools/elinks_wine.py b/doc/tools/elinks_wine.py new file mode 100644 index 00000000..938c69b2 --- /dev/null +++ b/doc/tools/elinks_wine.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import os +import sys + +if __name__ == '__main__': + was_elinks = False + with os.popen('wine {0} {1}'.format(os.getenv('ELINKS_BINARY'), sys.argv[1]), 'r') as fi: + for line in fi: + if not was_elinks: + if not line.startswith('ELinks'): + continue + was_elinks = True + print(line, end='') + sys.exit(0) diff --git a/src/meson.build b/src/meson.build index 140c6941..4928e013 100644 --- a/src/meson.build +++ b/src/meson.build @@ -50,11 +50,18 @@ endif extra_cpp_args = extra_args extra_cpp_args += extracppflags +if get_option('static') + static_link_args = ['-static'] +else + static_link_args = [] +endif + elinks = executable( 'elinks', srcs, include_directories: incs, dependencies: deps, c_args: extra_args + extracflags, cpp_args: extra_cpp_args, + link_args: static_link_args, install: true )