1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-26 01:15:37 +00:00

[meson] Added temporary option msys2

Fo msys2 add -Dmsys2=true
I don't know how to detect msys2.
host_machine.system() returns 'windows'
windows.h and winsock.h
interfere with cygwin or msys2, so are not included for msys2.

If you know how to make it better, let me know.
This commit is contained in:
Witold Filipczyk 2024-04-06 20:13:24 +02:00
parent dcc5d3786a
commit 82b16247d3
2 changed files with 21 additions and 14 deletions

View File

@ -144,7 +144,12 @@ conf_data.set('CONFIG_ECMASCRIPT_SMJS_HEARTBEAT', true)
conf_data.set('CONFIG_SCRIPTING', true) conf_data.set('CONFIG_SCRIPTING', true)
system = host_machine.system() if get_option('msys2')
system = 'msys2'
else
system = host_machine.system()
endif
if system == 'haiku' if system == 'haiku'
conf_data.set('CONFIG_OS_BEOS', true) conf_data.set('CONFIG_OS_BEOS', true)
else else
@ -347,15 +352,15 @@ if compiler.has_header('term.h')
conf_data.set('HAVE_TERM_H', 1) conf_data.set('HAVE_TERM_H', 1)
endif endif
if compiler.has_header('windows.h') if conf_data.get('CONFIG_OS_WIN32') and compiler.has_header('windows.h')
conf_data.set('HAVE_WINDOWS_H', 1) conf_data.set('HAVE_WINDOWS_H', 1)
endif endif
if compiler.has_header('winsock2.h') if conf_data.get('CONFIG_OS_WIN32') and compiler.has_header('winsock2.h')
conf_data.set('HAVE_WINSOCK2_H', 1) conf_data.set('HAVE_WINSOCK2_H', 1)
endif endif
if compiler.has_header('ws2tcpip.h') if conf_data.get('CONFIG_OS_WIN32') and compiler.has_header('ws2tcpip.h')
conf_data.set('HAVE_WS2TCPIP_H', 1) conf_data.set('HAVE_WS2TCPIP_H', 1)
endif endif
@ -365,7 +370,7 @@ deps = []
if conf_data.get('CONFIG_GZIP') if conf_data.get('CONFIG_GZIP')
zdeps = dependency('zlib', static: st, required: false) zdeps = dependency('zlib', static: st, required: false)
if not zdeps.found() if not zdeps.found()
zdeps = compiler.find_library('z', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib']) zdeps = compiler.find_library('z', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
if zdeps.found() if zdeps.found()
deps += zdeps deps += zdeps
@ -409,7 +414,7 @@ ssldeps = []
if conf_data.get('CONFIG_OPENSSL') if conf_data.get('CONFIG_OPENSSL')
ssldeps = dependency('openssl', static: st, required: false) ssldeps = dependency('openssl', static: st, required: false)
if not ssldeps.found() if not ssldeps.found()
ssldeps = compiler.find_library('ssl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib']) ssldeps = compiler.find_library('ssl', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
deps += ssldeps deps += ssldeps
conf_data.set('USE_OPENSSL', true) conf_data.set('USE_OPENSSL', true)
@ -461,7 +466,7 @@ endif
if conf_data.get('CONFIG_BZIP2') if conf_data.get('CONFIG_BZIP2')
bz2deps = dependency('bzip2', static: st, required: false) bz2deps = dependency('bzip2', static: st, required: false)
if not bz2deps.found() if not bz2deps.found()
bz2deps = compiler.find_library('bz2', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib']) bz2deps = compiler.find_library('bz2', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
deps += bz2deps deps += bz2deps
endif endif
@ -482,7 +487,7 @@ curldeps = false
if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS') if conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
curldeps = dependency('libcurl', static: st, required: false) curldeps = dependency('libcurl', static: st, required: false)
if not curldeps.found() if not curldeps.found()
curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib']) curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
if curldeps.found() if curldeps.found()
deps += curldeps deps += curldeps
@ -493,7 +498,7 @@ endif
if not conf_data.get('CONFIG_LIBCURL') and get_option('libcurl') if not conf_data.get('CONFIG_LIBCURL') and get_option('libcurl')
curldeps = dependency('libcurl', static: st, required: false) curldeps = dependency('libcurl', static: st, required: false)
if not curldeps.found() if not curldeps.found()
curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib', '/usr/local/lib']) curldeps = compiler.find_library('curl', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
if curldeps.found() if curldeps.found()
deps += curldeps deps += curldeps
@ -545,7 +550,7 @@ endif
if conf_data.get('CONFIG_SCRIPTING_LUA') if conf_data.get('CONFIG_SCRIPTING_LUA')
luadeps = dependency(luapkg, static: st, required: false) luadeps = dependency(luapkg, static: st, required: false)
if not luadeps.found() if not luadeps.found()
luadeps = compiler.find_library(luapkg, static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib']) luadeps = compiler.find_library(luapkg, static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
deps += luadeps deps += luadeps
endif endif
@ -553,7 +558,7 @@ endif
if conf_data.get('CONFIG_XBEL_BOOKMARKS') if conf_data.get('CONFIG_XBEL_BOOKMARKS')
expatdeps = dependency('expat', static: st, required: false) expatdeps = dependency('expat', static: st, required: false)
if not expatdeps.found() if not expatdeps.found()
expatdeps = compiler.find_library('expat', static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib']) expatdeps = compiler.find_library('expat', static: st, dirs: [get_option('prefix')+'/lib'])
endif endif
deps += expatdeps deps += expatdeps
endif endif
@ -624,7 +629,7 @@ endif
if conf_data.get('CONFIG_QUICKJS') if conf_data.get('CONFIG_QUICKJS')
quickjsdeps = compiler.find_library('quickjs', static: st, required: false) quickjsdeps = compiler.find_library('quickjs', static: st, required: false)
if not quickjsdeps.found() if not quickjsdeps.found()
quickjsdeps = compiler.find_library('quickjs/libquickjs', static: true, dirs: [get_option('prefix')+'/lib','/usr/local/lib']) quickjsdeps = compiler.find_library('quickjs/libquickjs', static: true, dirs: [get_option('prefix')+'/lib'])
endif endif
deps += quickjsdeps deps += quickjsdeps
deps += dep_atomic deps += dep_atomic
@ -653,7 +658,7 @@ if conf_data.get('CONFIG_LIBSIXEL')
endif endif
if conf_data.get('CONFIG_OS_DOS') if conf_data.get('CONFIG_OS_DOS')
wattdeps = compiler.find_library('watt', static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib']) wattdeps = compiler.find_library('watt', static: st, dirs: [get_option('prefix')+'/lib'])
deps += wattdeps deps += wattdeps
else else
wattdeps = [] wattdeps = []
@ -974,7 +979,7 @@ if compiler.has_function('ASN1_STRING_get0_data', prefix: '#include <openssl/asn
conf_data.set('HAVE_ASN1_STRING_GET0_DATA', 1) conf_data.set('HAVE_ASN1_STRING_GET0_DATA', 1)
endif endif
iconvdeps = compiler.find_library('iconv', static: st, dirs: [get_option('prefix')+'/lib','/usr/local/lib'], required: false) iconvdeps = compiler.find_library('iconv', static: st, dirs: [get_option('prefix')+'/lib'], required: false)
if iconvdeps.found() if iconvdeps.found()
deps += iconvdeps deps += iconvdeps
endif endif

View File

@ -81,3 +81,5 @@ option('pdfdoc', type: 'boolean', value: true, description: 'whether to build ma
option('libcss', type: 'boolean', value: true, description: 'whether to compile libcss support, requires libdom. This option is automatically enabled with js support') option('libcss', type: 'boolean', value: true, description: 'whether to compile libcss support, requires libdom. This option is automatically enabled with js support')
option('libsixel', type: 'boolean', value: false, description: 'whether to compile libsixel support to show images directly on sixel compatible terminals') option('libsixel', type: 'boolean', value: false, description: 'whether to compile libsixel support to show images directly on sixel compatible terminals')
option('libcurl', type: 'boolean', value: true, description: 'whether to compile libcurl support. This option is automatically enabled with js support') option('libcurl', type: 'boolean', value: true, description: 'whether to compile libcurl support. This option is automatically enabled with js support')
option('msys2', type: 'boolean', value: false, description: 'whether to build for msys2')