mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
Merge branch 'mcatanzaro/#3354' into 'main'
Convert dtrace and systemtap to feature option type, and fix sysprof option Closes #3354 See merge request GNOME/glib!4076
This commit is contained in:
commit
c88cbd06de
@ -185,8 +185,8 @@ fedora-x86_64:
|
|||||||
--prefix=$HOME/glib-installed
|
--prefix=$HOME/glib-installed
|
||||||
--localstatedir=/var
|
--localstatedir=/var
|
||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Ddocumentation=true
|
-Ddocumentation=true
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
@ -240,8 +240,8 @@ debian-stable-x86_64:
|
|||||||
--prefix=$HOME/glib-installed
|
--prefix=$HOME/glib-installed
|
||||||
--localstatedir=/var
|
--localstatedir=/var
|
||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- .gitlab-ci/run-tests.sh
|
- .gitlab-ci/run-tests.sh
|
||||||
@ -312,7 +312,7 @@ muslc-alpine-x86_64:
|
|||||||
--prefix=$HOME/glib-installed
|
--prefix=$HOME/glib-installed
|
||||||
--localstatedir=/var
|
--localstatedir=/var
|
||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- .gitlab-ci/run-tests.sh
|
- .gitlab-ci/run-tests.sh
|
||||||
@ -343,7 +343,7 @@ installed-tests:
|
|||||||
--prefix=/usr --libdir=/usr/lib64
|
--prefix=/usr --libdir=/usr/lib64
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Ddefault_library=both
|
-Ddefault_library=both
|
||||||
-Ddtrace=false
|
-Ddtrace=disabled
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
- sudo meson install -C _build
|
- sudo meson install -C _build
|
||||||
@ -383,8 +383,8 @@ G_DISABLE_ASSERT:
|
|||||||
script:
|
script:
|
||||||
- meson setup ${MESON_COMMON_OPTIONS}
|
- meson setup ${MESON_COMMON_OPTIONS}
|
||||||
--werror
|
--werror
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Dglib_assert=false
|
-Dglib_assert=false
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
@ -421,8 +421,8 @@ valgrind:
|
|||||||
script:
|
script:
|
||||||
- meson setup ${MESON_COMMON_OPTIONS}
|
- meson setup ${MESON_COMMON_OPTIONS}
|
||||||
--werror
|
--werror
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
_build
|
_build
|
||||||
@ -766,8 +766,8 @@ scan-build:
|
|||||||
--localstatedir=/var
|
--localstatedir=/var
|
||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dglib_debug=enabled
|
-Dglib_debug=enabled
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
_scan_build
|
_scan_build
|
||||||
@ -796,8 +796,8 @@ scan-build:
|
|||||||
--prefix=$HOME/glib-installed
|
--prefix=$HOME/glib-installed
|
||||||
--localstatedir=/var
|
--localstatedir=/var
|
||||||
--libdir=lib
|
--libdir=lib
|
||||||
-Dsystemtap=true
|
-Dsystemtap=enabled
|
||||||
-Ddtrace=true
|
-Ddtrace=enabled
|
||||||
-Dinstalled_tests=true
|
-Dinstalled_tests=true
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
_coverity_build
|
_coverity_build
|
||||||
|
42
meson.build
42
meson.build
@ -2519,19 +2519,35 @@ elif host_system == 'cygwin'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Tracing: dtrace
|
# Tracing: dtrace
|
||||||
want_dtrace = get_option('dtrace')
|
dtrace_option = get_option('dtrace')
|
||||||
enable_dtrace = false
|
enable_dtrace = dtrace_option.allowed()
|
||||||
|
|
||||||
# Since dtrace support is opt-in we just error out if it was requested but
|
if glib_have_carbon
|
||||||
# is not available. We don't bother with autodetection yet.
|
if dtrace_option.enabled()
|
||||||
if want_dtrace
|
|
||||||
if glib_have_carbon
|
|
||||||
error('GLib dtrace support not yet compatible with macOS dtrace')
|
error('GLib dtrace support not yet compatible with macOS dtrace')
|
||||||
|
else
|
||||||
|
enable_dtrace = false
|
||||||
endif
|
endif
|
||||||
dtrace = find_program('dtrace', required : true) # error out if not found
|
endif
|
||||||
|
|
||||||
|
if enable_dtrace
|
||||||
|
dtrace = find_program('dtrace', required : dtrace_option)
|
||||||
|
if not dtrace.found()
|
||||||
|
enable_dtrace = false
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if enable_dtrace
|
||||||
if not cc.has_header('sys/sdt.h')
|
if not cc.has_header('sys/sdt.h')
|
||||||
error('dtrace support needs sys/sdt.h header')
|
if dtrace_option.enabled()
|
||||||
|
error('dtrace support needs sys/sdt.h header')
|
||||||
|
else
|
||||||
|
enable_dtrace = false
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if enable_dtrace
|
||||||
# FIXME: autotools build also passes -fPIC -DPIC but is it needed in this case?
|
# FIXME: autotools build also passes -fPIC -DPIC but is it needed in this case?
|
||||||
dtrace_obj_gen = generator(dtrace,
|
dtrace_obj_gen = generator(dtrace,
|
||||||
output : '@BASENAME@.o',
|
output : '@BASENAME@.o',
|
||||||
@ -2552,7 +2568,6 @@ with open(output, "w") as f:
|
|||||||
f.write(contents)
|
f.write(contents)
|
||||||
''', dtrace.full_path(), '-h', '-s', '@INPUT@', '-o', '@OUTPUT@'])
|
''', dtrace.full_path(), '-h', '-s', '@INPUT@', '-o', '@OUTPUT@'])
|
||||||
glib_conf.set('HAVE_DTRACE', 1)
|
glib_conf.set('HAVE_DTRACE', 1)
|
||||||
enable_dtrace = true
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.has_header_symbol('sys/ptrace.h', 'PTRACE_O_EXITKILL')
|
if cc.has_header_symbol('sys/ptrace.h', 'PTRACE_O_EXITKILL')
|
||||||
@ -2560,10 +2575,10 @@ if cc.has_header_symbol('sys/ptrace.h', 'PTRACE_O_EXITKILL')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# systemtap
|
# systemtap
|
||||||
want_systemtap = get_option('systemtap')
|
systemtap = get_option('systemtap').require(enable_dtrace, error_message: 'Cannot enable systemtap because dtrace feature is disabled')
|
||||||
enable_systemtap = false
|
enable_systemtap = systemtap.allowed()
|
||||||
|
|
||||||
if want_systemtap and enable_dtrace
|
if enable_systemtap
|
||||||
tapset_install_dir = get_option('tapset_install_dir')
|
tapset_install_dir = get_option('tapset_install_dir')
|
||||||
if tapset_install_dir == ''
|
if tapset_install_dir == ''
|
||||||
tapset_install_dir = join_paths(get_option('datadir'), 'systemtap/tapset', host_machine.cpu_family())
|
tapset_install_dir = join_paths(get_option('datadir'), 'systemtap/tapset', host_machine.cpu_family())
|
||||||
@ -2572,7 +2587,6 @@ if want_systemtap and enable_dtrace
|
|||||||
stp_cdata.set('ABS_GLIB_RUNTIME_LIBDIR', glib_libdir)
|
stp_cdata.set('ABS_GLIB_RUNTIME_LIBDIR', glib_libdir)
|
||||||
stp_cdata.set('LT_CURRENT', minor_version * 100)
|
stp_cdata.set('LT_CURRENT', minor_version * 100)
|
||||||
stp_cdata.set('LT_REVISION', micro_version)
|
stp_cdata.set('LT_REVISION', micro_version)
|
||||||
enable_systemtap = true
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# introspection
|
# introspection
|
||||||
@ -2696,7 +2710,7 @@ endif
|
|||||||
summary({
|
summary({
|
||||||
'xattr' : xattr_dep.length() > 0,
|
'xattr' : xattr_dep.length() > 0,
|
||||||
'man-pages' : get_option('man-pages'),
|
'man-pages' : get_option('man-pages'),
|
||||||
'dtrace' : get_option('dtrace'),
|
'dtrace' : enable_dtrace,
|
||||||
'systemtap' : enable_systemtap,
|
'systemtap' : enable_systemtap,
|
||||||
'sysprof' : libsysprof_capture_dep.found(),
|
'sysprof' : libsysprof_capture_dep.found(),
|
||||||
'documentation' : get_option('documentation'),
|
'documentation' : get_option('documentation'),
|
||||||
|
@ -50,13 +50,15 @@ option('man-pages',
|
|||||||
deprecated : { 'true': 'enabled', 'false': 'disabled' })
|
deprecated : { 'true': 'enabled', 'false': 'disabled' })
|
||||||
|
|
||||||
option('dtrace',
|
option('dtrace',
|
||||||
type : 'boolean',
|
type : 'feature',
|
||||||
value : false,
|
value : 'auto',
|
||||||
|
deprecated : { 'true': 'enabled', 'false': 'disabled' },
|
||||||
description : 'include tracing support for dtrace')
|
description : 'include tracing support for dtrace')
|
||||||
|
|
||||||
option('systemtap',
|
option('systemtap',
|
||||||
type : 'boolean',
|
type : 'feature',
|
||||||
value : false,
|
value : 'auto',
|
||||||
|
deprecated : { 'true': 'enabled', 'false': 'disabled' },
|
||||||
description : 'include tracing support for systemtap')
|
description : 'include tracing support for systemtap')
|
||||||
|
|
||||||
option('tapset_install_dir',
|
option('tapset_install_dir',
|
||||||
@ -66,7 +68,7 @@ option('tapset_install_dir',
|
|||||||
|
|
||||||
option('sysprof',
|
option('sysprof',
|
||||||
type : 'feature',
|
type : 'feature',
|
||||||
value : 'disabled',
|
value : 'auto',
|
||||||
description : 'include tracing support for sysprof')
|
description : 'include tracing support for sysprof')
|
||||||
|
|
||||||
option('documentation',
|
option('documentation',
|
||||||
|
Loading…
Reference in New Issue
Block a user