meson: Port to latest master (2.51.0)

Also remove headers from some gio sources. Headers do not need to be
added to the list of sources.

+ various smaller self-explanatory fixes.
This commit is contained in:
Nirbheek Chauhan 2016-12-21 06:34:47 +05:30 committed by Matthias Clasen
parent d10be6102f
commit e2da3cb599
6 changed files with 99 additions and 27 deletions

View File

@ -202,6 +202,15 @@ if get_option('with-man')
install: true, install: true,
install_dir: man1_dir, install_dir: man1_dir,
) )
custom_target('gio',
input: 'gio.xml',
output: 'gio.1',
command: xsltproc_command,
install: true,
install_dir: man1_dir,
)
custom_target('gdbus-codegen-man', custom_target('gdbus-codegen-man',
input: 'gdbus-codegen.xml', input: 'gdbus-codegen.xml',
output: 'gdbus-codegen.1', output: 'gdbus-codegen.1',

View File

@ -165,6 +165,22 @@ gdbus_sources = [
# Generate gdbus-codegen # Generate gdbus-codegen
subdir('gdbus-2.0/codegen') subdir('gdbus-2.0/codegen')
# Generate xdp-dbus.{c,h}
xdp_dbus_generated = custom_target('xdp-dbus',
input : ['org.freedesktop.portal.Documents.xml',
'org.freedesktop.portal.NetworkMonitor.xml',
'org.freedesktop.portal.ProxyResolver.xml'],
output : ['xdp-dbus.h', 'xdp-dbus.c'],
command : [python, gdbus_codegen,
'--interface-prefix', 'org.freedesktop.portal.',
'--generate-c-code', '@OUTDIR@/xdp-dbus',
'--c-namespace', 'GXdp',
'--annotate', 'org.freedesktop.portal.Documents.Add()',
'org.gtk.GDBus.C.UnixFD', 'true',
'--annotate', 'org.freedesktop.portal.Documents.AddNamed()',
'org.gtk.GDBus.C.UnixFD', 'true',
'@INPUT@'])
# Generate gdbus-generated.{c,h} # Generate gdbus-generated.{c,h}
gdbus_daemon_generated = custom_target('gdbus-daemon-generated', gdbus_daemon_generated = custom_target('gdbus-daemon-generated',
input : ['dbus-daemon.xml'], input : ['dbus-daemon.xml'],
@ -247,38 +263,26 @@ application_sources = [
local_sources = [ local_sources = [
'ghttpproxy.c', 'ghttpproxy.c',
'ghttpproxy.h',
'glocalfile.c', 'glocalfile.c',
'glocalfile.h',
'glocalfileenumerator.c', 'glocalfileenumerator.c',
'glocalfileenumerator.h',
'glocalfileinfo.c', 'glocalfileinfo.c',
'glocalfileinfo.h',
'glocalfileinputstream.c', 'glocalfileinputstream.c',
'glocalfileinputstream.h',
'glocalfilemonitor.c', 'glocalfilemonitor.c',
'glocalfilemonitor.h',
'glocalfileoutputstream.c', 'glocalfileoutputstream.c',
'glocalfileoutputstream.h',
'glocalfileiostream.c', 'glocalfileiostream.c',
'glocalfileiostream.h',
'glocalvfs.c', 'glocalvfs.c',
'glocalvfs.h',
'gsocks4proxy.c', 'gsocks4proxy.c',
'gsocks4proxy.h',
'gsocks4aproxy.c', 'gsocks4aproxy.c',
'gsocks4aproxy.h',
'gsocks5proxy.c', 'gsocks5proxy.c',
'gsocks5proxy.h',
'thumbnail-verify.h',
'thumbnail-verify.c', 'thumbnail-verify.c',
] ]
platform_deps = [] platform_deps = []
internal_deps = [] internal_deps = []
appinfo_sources = [] appinfo_sources = []
portal_sources = []
unix_sources = [] unix_sources = []
if host_system != 'windows' if host_system != 'windows'
appinfo_sources += ['gdesktopappinfo.c'] appinfo_sources += ['gdesktopappinfo.c']
subdir('xdgmime') subdir('xdgmime')
@ -290,21 +294,26 @@ if host_system != 'windows'
'gunixfdlist.c', 'gunixfdlist.c',
'gunixfdmessage.c', 'gunixfdmessage.c',
'gunixmount.c', 'gunixmount.c',
'gunixmount.h',
'gunixmounts.c', 'gunixmounts.c',
'gunixsocketaddress.c', 'gunixsocketaddress.c',
'gunixvolume.c', 'gunixvolume.c',
'gunixvolume.h',
'gunixvolumemonitor.c', 'gunixvolumemonitor.c',
'gunixvolumemonitor.h',
'gunixinputstream.c', 'gunixinputstream.c',
'gunixoutputstream.c', 'gunixoutputstream.c',
'gcontenttype.c', 'gcontenttype.c',
'gcontenttypeprivate.h',
'gfdonotificationbackend.c', 'gfdonotificationbackend.c',
'ggtknotificationbackend.c', 'ggtknotificationbackend.c',
] ]
portal_sources = [
'gdocumentportal.c',
'gnetworkmonitorportal.c',
'gproxyresolverportal.c',
'gportalsupport.c',
'gportalnotificationbackend.c',
xdp_dbus_generated
]
# FIXME # FIXME
#if OS_COCOA #if OS_COCOA
#unix_sources += gcocoanotificationbackend.c #unix_sources += gcocoanotificationbackend.c
@ -485,6 +494,7 @@ gio_sources += win32_sources
gio_sources += application_sources gio_sources += application_sources
gio_sources += settings_sources gio_sources += settings_sources
gio_sources += gdbus_sources gio_sources += gdbus_sources
gio_sources += portal_sources
gio_sources += local_sources gio_sources += local_sources
MISSING_STUFF = ''' MISSING_STUFF = '''
@ -682,8 +692,8 @@ libgio = shared_library('gio-2.0',
# '$(gio_win32_res_ldflag)', # '$(gio_win32_res_ldflag)',
#$(SELINUX_LIBS) #$(SELINUX_LIBS)
#$(XATTR_LIBS) #$(XATTR_LIBS)
dependencies : [libintl, libz_dep, libdl_dep, libglib_dep, libgobject_dep, dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep,
libgmodule_dep] + platform_deps + network_libs, libgobject_dep, libgmodule_dep] + platform_deps + network_libs,
c_args : gio_c_args, c_args : gio_c_args,
# intl.lib is not compatible with SAFESEH # intl.lib is not compatible with SAFESEH
link_args : noseh_link_args, link_args : noseh_link_args,
@ -706,6 +716,34 @@ gconstructor_as_data_h = custom_target('gconstructor_as_data.h',
command : [python, '@INPUT0@', '@INPUT1@', 'gconstructor_code', '@OUTPUT@']) command : [python, '@INPUT0@', '@INPUT1@', 'gconstructor_code', '@OUTPUT@'])
# Several installed executables # Several installed executables
gio_tool_sources = [
'gio-tool.c',
'gio-tool.h',
'gio-tool-cat.c',
'gio-tool-copy.c',
'gio-tool-info.c',
'gio-tool-list.c',
'gio-tool-mime.c',
'gio-tool-mkdir.c',
'gio-tool-monitor.c',
'gio-tool-mount.c',
'gio-tool-move.c',
'gio-tool-open.c',
'gio-tool-rename.c',
'gio-tool-remove.c',
'gio-tool-save.c',
'gio-tool-set.c',
'gio-tool-trash.c',
'gio-tool-tree.c',
]
executable('gio', gio_tool_sources,
install : true,
c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
# intl.lib is not compatible with SAFESEH
link_args : noseh_link_args,
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
executable('gresource', 'gresource-tool.c', executable('gresource', 'gresource-tool.c',
install : true, install : true,
c_args : ['-DHAVE_CONFIG_H=1'], c_args : ['-DHAVE_CONFIG_H=1'],

View File

@ -252,7 +252,7 @@ else
endif endif
install_data('gtester-report', install_dir : get_option('bindir')) install_data('gtester-report', install_dir : get_option('bindir'))
install_data('glib.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
gdb_conf = configuration_data() gdb_conf = configuration_data()
gdb_conf.set('datadir', glib_datadir) gdb_conf.set('datadir', glib_datadir)

View File

@ -83,7 +83,7 @@ glib_genmarshal = executable('glib-genmarshal',
c_args : ['-DHAVE_CONFIG_H=1'], c_args : ['-DHAVE_CONFIG_H=1'],
dependencies : [libglib_dep, libgobject_dep]) dependencies : [libglib_dep, libgobject_dep])
install_data('gobject.py', install_dir : join_paths(glib_pkgdatadir + 'gdb')) install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir + 'gdb'))
gdb_conf = configuration_data() gdb_conf = configuration_data()
gdb_conf.set('datadir', glib_datadir) gdb_conf.set('datadir', glib_datadir)
configure_file( configure_file(

View File

@ -106,11 +106,11 @@ if get_option('default_library') != 'static'
glib_conf.set('DLL_EXPORT', true) glib_conf.set('DLL_EXPORT', true)
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
glib_conf.set('_GLIB_EXTERN', '__declspec(dllexport) extern') glib_conf.set('_GLIB_EXTERN', '__declspec(dllexport) extern')
else elif cc.has_argument('-fvisibility=hidden')
glib_conf.set('_GLIB_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern') glib_conf.set('_GLIB_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
add_global_arguments('-fvisibility=hidden', language : 'c') add_global_arguments('-fvisibility=hidden', language : 'c')
endif endif
else elif cc.has_argument('-fvisibility=hidden')
glib_conf.set('_GLIB_EXTERN', '__attribute__((visibility("default"))) extern') glib_conf.set('_GLIB_EXTERN', '__attribute__((visibility("default"))) extern')
add_global_arguments('-fvisibility=hidden', language : 'c') add_global_arguments('-fvisibility=hidden', language : 'c')
endif endif
@ -165,7 +165,7 @@ headers = [
['sys/mntctl.h', 'HAVE_SYS_mntctl_H'], ['sys/mntctl.h', 'HAVE_SYS_mntctl_H'],
['fstab.h', 'HAVE_FSTAB_H'], ['fstab.h', 'HAVE_FSTAB_H'],
['linux/magic.h', 'HAVE_LINUX_MAGIC_H'], ['linux/magic.h', 'HAVE_LINUX_MAGIC_H'],
['sys/prctl.h', 'HAVE_SYS_PRCTL_H'], ['termios.h', 'HAVE_TERMIOS_H'],
['dirent.h', 'HAVE_DIRENT_H'], # Some versions of MSC lack these ['dirent.h', 'HAVE_DIRENT_H'], # Some versions of MSC lack these
['sys/time.h', 'HAVE_SYS_TIME_H'], # Some versions of MSC lack these ['sys/time.h', 'HAVE_SYS_TIME_H'], # Some versions of MSC lack these
['sys/times.h', 'HAVE_SYS_TIMES_H'], ['sys/times.h', 'HAVE_SYS_TIMES_H'],
@ -454,7 +454,7 @@ if have_func_statfs
#endif #endif
void some_func (void) { void some_func (void) {
struct statfs st; struct statfs st;
statfs(NULL, &st); statfs("/", &st);
}''', name : 'number of arguments to statfs() (n=2)') }''', name : 'number of arguments to statfs() (n=2)')
glib_conf.set('STATFS_ARGS', 2) glib_conf.set('STATFS_ARGS', 2)
elif cc.compiles(glib_conf_prefix + ''' elif cc.compiles(glib_conf_prefix + '''
@ -473,7 +473,7 @@ if have_func_statfs
#endif #endif
void some_func (void) { void some_func (void) {
struct statfs st; struct statfs st;
statfs(NULL, &st, sizeof (st), 0); statfs("/", &st, sizeof (st), 0);
}''', name : 'number of arguments to statfs() (n=4)') }''', name : 'number of arguments to statfs() (n=4)')
glib_conf.set('STATFS_ARGS', 4) glib_conf.set('STATFS_ARGS', 4)
else else
@ -872,6 +872,7 @@ glib_conf.set('ALIGNOF_GUINT64', guint64_align)
if host_system == 'windows' if host_system == 'windows'
glibconfig_conf.set('g_pid_type', 'void*') glibconfig_conf.set('g_pid_type', 'void*')
glibconfig_conf.set('G_PID_FORMAT', '"p"')
if host_machine.cpu_family() == 'x86_64' if host_machine.cpu_family() == 'x86_64'
glibconfig_conf.set('g_pollfd_format', '"%#I64x"') glibconfig_conf.set('g_pollfd_format', '"%#I64x"')
else else
@ -879,6 +880,7 @@ if host_system == 'windows'
endif endif
else else
glibconfig_conf.set('g_pid_type', 'int') glibconfig_conf.set('g_pid_type', 'int')
glibconfig_conf.set('G_PID_FORMAT', '"i"')
glibconfig_conf.set('g_pollfd_format', '"%d"') glibconfig_conf.set('g_pollfd_format', '"%d"')
endif endif
@ -1275,6 +1277,22 @@ libz_dep = dependency('zlib')
# Only used on non-glibc targets # Only used on non-glibc targets
libintl = cc.find_library('intl', required : false) libintl = cc.find_library('intl', required : false)
# libmount is only used by gio, but we need to fetch the libs to generate the
# pkg-config file below
libmount_dep = []
libmount_opt = get_option('enable-libmount')
if libmount_opt != 'no'
libmount_dep = [dependency('mount', version : '>=2.28', required : false)]
if not libmount_dep[0].found()
libmount_dep = [cc.find_library('mount')]
libmount_h = cc.has_header('libmount/libmount.h')
libmount_needed = libmount_opt == 'yes' and host_system == 'linux'
if libmount_needed and (not libmount_dep[0].found() or not libmount_h)
error('Need libmount but couldn\'t find it')
endif
endif
endif
if host_system == 'windows' if host_system == 'windows'
winsock2 = cc.find_library('ws2_32') winsock2 = cc.find_library('ws2_32')
endif endif
@ -1311,6 +1329,9 @@ endif
if pcre.found() if pcre.found()
glib_conf.set('PCRE_LIBS', '-lpcre') glib_conf.set('PCRE_LIBS', '-lpcre')
endif endif
if libmount_dep.length() == 1 and libmount_dep[0].found()
glib_conf.set('LIBMOUNT_LIBS', '-lmount')
endif
glib_conf.set('GIO_MODULE_DIR', '${libdir}/gio/modules') glib_conf.set('GIO_MODULE_DIR', '${libdir}/gio/modules')
# FIXME: Missing: # FIXME: Missing:
# @G_MODULE_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@ # @G_MODULE_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@
@ -1359,6 +1380,9 @@ configure_file(input : 'glib-gettextize.in',
# Install m4 macros that other projects use # Install m4 macros that other projects use
install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsettings.m4', install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsettings.m4',
install_dir : join_paths(get_option('datadir'), 'aclocal')) install_dir : join_paths(get_option('datadir'), 'aclocal'))
# Install Valgrind suppression file
install_data('glib.supp',
install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'valgrind'))
configure_file(input : 'config.h.meson', configure_file(input : 'config.h.meson',
output : 'config.h', output : 'config.h',

View File

@ -1,2 +1,3 @@
option('with-docs', type : 'boolean', value : false) option('with-docs', type : 'boolean', value : false)
option('with-man', type : 'boolean', value : true) option('with-man', type : 'boolean', value : true)
option('enable-libmount', type : 'combo', choices : ['auto', 'yes', 'no'], value : 'yes')