Merge pull request #1578 from ailin-nemui/cygwin

make compilation work on cygwin
This commit is contained in:
ailin-nemui 2026-01-23 20:20:43 +00:00 committed by GitHub
commit d5be7d7756
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 76 additions and 48 deletions

View file

@ -13,10 +13,15 @@ rootinc = include_directories('.')
dep = [] dep = []
textui_dep = [] textui_dep = []
need_dl_cross_link = false need_dl_cross_link = false
need_dl_cross_link_main = false
dl_cross_irssi_main = []
# The Android environment requires that all modules are linked to each other. # The Android environment requires that all modules are linked to each other.
# See https://github.com/android/ndk/issues/201 # See https://github.com/android/ndk/issues/201
if host_machine.system() == 'android' if host_machine.system() == 'android'
need_dl_cross_link = true need_dl_cross_link = true
elif host_machine.system() == 'cygwin'
need_dl_cross_link = true
need_dl_cross_link_main = true
endif endif
includedir = get_option('includedir') includedir = get_option('includedir')

View file

@ -42,7 +42,7 @@ static char *module_get_name(const char *path, int *start, int *end)
if (name == NULL) if (name == NULL)
name = path; name = path;
if (strncmp(name, "lib", 3) == 0) if (strncmp(name, "lib", 3) == 0 || strncmp(name, "cyg", 3) == 0)
name += 3; name += 3;
module_name = g_strdup(name); module_name = g_strdup(name);

View file

@ -17,12 +17,13 @@ libfe_irc_dcc_a = static_library('fe_irc_dcc',
def_sysconfdir, def_sysconfdir,
], ],
dependencies : dep) dependencies : dep)
shared_module('fe_irc_dcc', shared_library('fe_irc_dcc',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_dcc, link_with : dl_cross_irc_dcc + dl_cross_irc_core + dl_cross_irssi_main,
link_whole : libfe_irc_dcc_a) link_whole : libfe_irc_dcc_a,
override_options : ['b_lundef=false'])
install_headers( install_headers(
files( files(

View file

@ -28,12 +28,13 @@ libfe_common_irc_a = static_library('fe_common_irc',
def_themesdir, def_themesdir,
], ],
dependencies : dep) dependencies : dep)
shared_module('fe_common_irc', shared_library('fe_common_irc',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_core, link_with : dl_cross_irc_core + dl_cross_irssi_main,
link_whole : libfe_common_irc_a) link_whole : libfe_common_irc_a,
override_options : ['b_lundef=false'])
install_headers( install_headers(
files( files(

View file

@ -12,12 +12,13 @@ libfe_irc_notifylist_a = static_library('fe_irc_notifylist',
def_sysconfdir, def_sysconfdir,
], ],
dependencies : dep) dependencies : dep)
shared_module('fe_irc_notifylist', shared_library('fe_irc_notifylist',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_notifylist, link_with : dl_cross_irc_notifylist + dl_cross_irssi_main,
link_whole : libfe_irc_notifylist_a) link_whole : libfe_irc_notifylist_a,
override_options : ['b_lundef=false'])
install_headers( install_headers(
files( files(

View file

@ -1,6 +1,4 @@
# this file is part of irssi # this file is part of irssi
subdir('core') # intentionally empty
foreach s : chat_modules
subdir(s)
endforeach

View file

@ -1,12 +1,13 @@
# this file is part of irssi # this file is part of irssi
executable('botti', fe_none_irssi = executable('botti',
files( files(
'irssi.c', 'irssi.c',
), ),
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : false, implicit_include_directories : false,
export_dynamic : true, export_dynamic : true,
implib : true,
link_with : [ link_with : [
libconfig_a, libconfig_a,
libcore_a, libcore_a,
@ -14,6 +15,9 @@ executable('botti',
install : true, install : true,
dependencies : dep dependencies : dep
) )
if need_dl_cross_link_main
dl_cross_irssi_main = [ fe_none_irssi ]
endif
# noinst_headers = files( # noinst_headers = files(
# 'module.h', # 'module.h',

View file

@ -1,6 +1,6 @@
# this file is part of irssi # this file is part of irssi
executable('irssi', fe_text_irssi = executable('irssi',
files( files(
#### terminfo_sources #### #### terminfo_sources ####
'term-terminfo.c', 'term-terminfo.c',
@ -35,6 +35,7 @@ executable('irssi',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : false, implicit_include_directories : false,
export_dynamic : true, export_dynamic : true,
implib : true,
link_with : [ link_with : [
libconfig_a, libconfig_a,
libcore_a, libcore_a,
@ -44,6 +45,9 @@ executable('irssi',
dependencies : dep dependencies : dep
+ textui_dep + textui_dep
) )
if need_dl_cross_link_main
dl_cross_irssi_main = [ fe_text_irssi ]
endif
install_headers( install_headers(
files( files(

View file

@ -39,11 +39,13 @@ libirc_core_a = static_library('irc_core',
def_sysconfdir, def_sysconfdir,
], ],
dependencies : dep) dependencies : dep)
libirc_core_sm = shared_module('irc_core', libirc_core_sm = shared_library('irc_core',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_whole : libirc_core_a) link_whole : libirc_core_a,
link_with : dl_cross_irssi_main,
override_options : ['b_lundef=false'])
dl_cross_irc_core = [] dl_cross_irc_core = []
if need_dl_cross_link if need_dl_cross_link

View file

@ -1,6 +1,6 @@
# this file is part of irssi # this file is part of irssi
libirc_dcc_sm = shared_module('irc_dcc', libirc_dcc_sm = shared_library('irc_dcc',
files( files(
'dcc-autoget.c', 'dcc-autoget.c',
'dcc-chat.c', 'dcc-chat.c',
@ -16,8 +16,9 @@ libirc_dcc_sm = shared_module('irc_dcc',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_core, link_with : dl_cross_irc_core + dl_cross_irssi_main,
dependencies : dep) dependencies : dep,
override_options : ['b_lundef=false'])
dl_cross_irc_dcc = [] dl_cross_irc_dcc = []
if need_dl_cross_link if need_dl_cross_link

View file

@ -8,12 +8,13 @@ libirc_flood_a = static_library('irc_flood',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : false, implicit_include_directories : false,
dependencies : dep) dependencies : dep)
shared_module('irc_flood', shared_library('irc_flood',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_core, link_with : dl_cross_irc_core + dl_cross_irssi_main,
link_whole : libirc_flood_a) link_whole : libirc_flood_a,
override_options : ['b_lundef=false'])
install_headers( install_headers(
files('module.h'), files('module.h'),

View file

@ -1,6 +1,6 @@
# this file is part of irssi # this file is part of irssi
libirc_notifylist_sm = shared_module('irc_notifylist', libirc_notifylist_sm = shared_library('irc_notifylist',
files( files(
'notify-commands.c', 'notify-commands.c',
'notify-ison.c', 'notify-ison.c',
@ -13,8 +13,9 @@ libirc_notifylist_sm = shared_module('irc_notifylist',
name_suffix : module_suffix, name_suffix : module_suffix,
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
link_with : dl_cross_irc_core, link_with : dl_cross_irc_core + dl_cross_irssi_main,
dependencies : dep) dependencies : dep,
override_options : ['b_lundef=false'])
dl_cross_irc_notifylist = [] dl_cross_irc_notifylist = []
if need_dl_cross_link if need_dl_cross_link

View file

@ -1,6 +1,6 @@
# this file is part of irssi # this file is part of irssi
shared_module('irc_proxy', shared_library('irc_proxy',
files( files(
'dump.c', 'dump.c',
'listen.c', 'listen.c',
@ -13,6 +13,7 @@ shared_module('irc_proxy',
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
dependencies : dep, dependencies : dep,
override_options : ['b_lundef=false'],
) )
# noinst_headers = files( # noinst_headers = files(

View file

@ -2,22 +2,23 @@
subdir('lib-config') subdir('lib-config')
subdir('core') subdir('core')
foreach s : chat_modules subdir('fe-common' / 'core')
subdir(s)
endforeach
subdir('fe-common')
if have_perl
subdir('perl')
endif
if have_otr
subdir('otr')
endif
if want_bot if want_bot
subdir('fe-none') subdir('fe-none')
endif endif
if want_textui if want_textui
subdir('fe-text') subdir('fe-text')
endif endif
foreach s : chat_modules
subdir(s)
subdir('fe-common' / s)
endforeach
if have_perl
subdir('perl')
endif
if have_otr
subdir('otr')
endif
if want_fuzzer if want_fuzzer
subdir('fe-fuzz') subdir('fe-fuzz')
endif endif

View file

@ -1,6 +1,6 @@
# this file is part of irssi # this file is part of irssi
shared_module('otr_core', shared_library('otr_core',
files( files(
'key.c', 'key.c',
'otr-fe.c', 'otr-fe.c',
@ -15,6 +15,7 @@ shared_module('otr_core',
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
dependencies : dep, dependencies : dep,
override_options : ['b_lundef=false'],
) )
# noinst_headers = files( # noinst_headers = files(

View file

@ -1,5 +1,5 @@
shared_module('Irssi', shared_library('Irssi',
[ xsubpp.process( [ xsubpp.process(
files( files(
'Channel.xs', 'Channel.xs',
@ -26,7 +26,8 @@ shared_module('Irssi',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : true, implicit_include_directories : true,
dependencies : dep + [ perl_dep ], dependencies : dep + [ perl_dep ],
link_with : dl_cross_perl_core, link_with : dl_cross_perl_core + dl_cross_irssi_main,
override_options : ['b_lundef=false'],
) )
install_headers( install_headers(

View file

@ -1,4 +1,4 @@
shared_module('Irc', shared_library('Irc',
[ xsubpp.process( [ xsubpp.process(
files( files(
'Channel.xs', 'Channel.xs',
@ -27,7 +27,8 @@ shared_module('Irc',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : true, implicit_include_directories : true,
dependencies : dep + [ perl_dep ], dependencies : dep + [ perl_dep ],
link_with : dl_cross_perl_core + dl_cross_irc_dcc + dl_cross_irc_notifylist, link_with : dl_cross_perl_core + dl_cross_irc_dcc + dl_cross_irc_notifylist + dl_cross_irc_core + dl_cross_irssi_main,
override_options : ['b_lundef=false'],
) )
install_headers( install_headers(

View file

@ -17,7 +17,7 @@ irssi_core_pl_h = custom_target('irssi-core.pl.h',
# required as of Meson 0.58.0 # required as of Meson 0.58.0
generated_files_inc = include_directories('.') generated_files_inc = include_directories('.')
libperl_core_sm = shared_module('perl_core', libperl_core_sm = shared_library('perl_core',
files( files(
'perl-common.c', 'perl-common.c',
'perl-core.c', 'perl-core.c',
@ -39,7 +39,8 @@ libperl_core_sm = shared_module('perl_core',
install_rpath : perl_rpath, install_rpath : perl_rpath,
build_rpath : perl_rpath, build_rpath : perl_rpath,
dependencies : dep_cflagsonly + [ perl_dep ] + dl_cross_dep, dependencies : dep_cflagsonly + [ perl_dep ] + dl_cross_dep,
override_options : ['b_asneeded=false'], override_options : ['b_asneeded=false', 'b_lundef=false'],
link_with : dl_cross_irssi_main,
) )
dl_cross_perl_core = [] dl_cross_perl_core = []
@ -47,7 +48,7 @@ if need_dl_cross_link
dl_cross_perl_core += libperl_core_sm dl_cross_perl_core += libperl_core_sm
endif endif
shared_module('fe_perl', shared_library('fe_perl',
files( files(
'module-formats.c', 'module-formats.c',
'perl-fe.c', 'perl-fe.c',
@ -61,7 +62,8 @@ shared_module('fe_perl',
install : true, install : true,
install_dir : moduledir, install_dir : moduledir,
dependencies : dep, dependencies : dep,
link_with : dl_cross_perl_core, link_with : dl_cross_perl_core + dl_cross_irssi_main,
override_options : ['b_lundef=false'],
) )
subdir('common') subdir('common')

View file

@ -1,4 +1,4 @@
shared_module('TextUI', shared_library('TextUI',
[ xsubpp.process( [ xsubpp.process(
files( files(
'Statusbar.xs', 'Statusbar.xs',
@ -23,7 +23,8 @@ shared_module('TextUI',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : true, implicit_include_directories : true,
dependencies : dep + [ perl_dep ], dependencies : dep + [ perl_dep ],
link_with : dl_cross_perl_core, link_with : dl_cross_perl_core + dl_cross_irssi_main,
override_options : ['b_lundef=false'],
) )
install_headers( install_headers(

View file

@ -1,4 +1,4 @@
shared_module('UI', shared_library('UI',
[ xsubpp.process( [ xsubpp.process(
files( files(
'Formats.xs', 'Formats.xs',
@ -21,7 +21,8 @@ shared_module('UI',
include_directories : rootinc, include_directories : rootinc,
implicit_include_directories : true, implicit_include_directories : true,
dependencies : dep + [ perl_dep ], dependencies : dep + [ perl_dep ],
link_with : dl_cross_perl_core, link_with : dl_cross_perl_core + dl_cross_irssi_main,
override_options : ['b_lundef=false'],
) )
install_headers( install_headers(