Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 4 +++- intel/test_decode.c | 4 ++-- meson.build | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac index 5d3a20ffd3e7b38db5f1..5751a8113635ce6a1c48 100644 --- a/configure.ac +++ b/configure.ac @@ -189,7 +189,9 @@ AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=], [AC_MSG_ERROR([Couldn't find clock_gettime])])]) AC_SUBST([CLOCK_LIB])
-AC_CHECK_FUNCS([open_memstream], [HAVE_OPEN_MEMSTREAM=yes]) +AC_CHECK_FUNCS([open_memstream], + [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 1, [Have open_memstream()])], + [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 0)])
dnl Use lots of warning flags with with gcc and compatible compilers
diff --git a/intel/test_decode.c b/intel/test_decode.c index e25bbf10319b641e2c69..b9f5b92791d5ff0c8052 100644 --- a/intel/test_decode.c +++ b/intel/test_decode.c @@ -87,7 +87,7 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename) { FILE *out = NULL; void *ptr, *ref_ptr, *batch_ptr; -#ifdef HAVE_OPEN_MEMSTREAM +#if HAVE_OPEN_MEMSTREAM size_t size; #endif size_t ref_size, batch_size; @@ -105,7 +105,7 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename) * figure out how to output to a file in a safe and sane way * inside of an automake project's test infrastructure. */ -#ifdef HAVE_OPEN_MEMSTREAM +#if HAVE_OPEN_MEMSTREAM out = open_memstream((char **)&ptr, &size); #else fprintf(stderr, "platform lacks open_memstream, skipping.\n"); diff --git a/meson.build b/meson.build index 5e0840750d2b3ff8c608..f7986af9bb5259be5da5 100644 --- a/meson.build +++ b/meson.build @@ -196,9 +196,7 @@ if cc.has_header_symbol('sys/sysmacros.h', 'major') elif cc.has_header_symbol('sys/mkdev.h', 'major') config.set10('MAJOR_IN_MKDEV', true) endif -if cc.has_function('open_memstream') - config.set10('HAVE_OPEN_MEMSTREAM', true) -endif +config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
warn_c_args = [] foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 2 ++ libdrm_macros.h | 2 +- meson.build | 7 +++---- 3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index 5751a8113635ce6a1c48..14baa1c87f9078f336fa 100644 --- a/configure.ac +++ b/configure.ac @@ -535,6 +535,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))]) +else + AC_DEFINE(HAVE_VISIBILITY, 0) fi
CFLAGS="$CFLAGS -include config.h" diff --git a/libdrm_macros.h b/libdrm_macros.h index 639d09047efcd5619ae3..211fab21986f55745ad9 100644 --- a/libdrm_macros.h +++ b/libdrm_macros.h @@ -23,7 +23,7 @@ #ifndef LIBDRM_LIBDRM_H #define LIBDRM_LIBDRM_H
-#if defined(HAVE_VISIBILITY) +#if HAVE_VISIBILITY # define drm_private __attribute__((visibility("hidden"))) #else # define drm_private diff --git a/meson.build b/meson.build index f7986af9bb5259be5da5..8d4d38b46ebcf75b9fb6 100644 --- a/meson.build +++ b/meson.build @@ -256,10 +256,9 @@ with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.fo # Used for tets prog_bash = find_program('bash')
-if cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''', - name : 'compiler supports __attribute__(("hidden"))') - config.set10('HAVE_VISIBILITY', true) -endif +config.set10('HAVE_VISIBILITY', + cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''', + name : 'compiler supports __attribute__(("hidden"))'))
foreach t : [ [with_exynos, 'EXYNOS'],
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- configure.ac | 2 ++ meson.build | 2 +- xf86drm.c | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index 14baa1c87f9078f336fa..619af49726d198c5d685 100644 --- a/configure.ac +++ b/configure.ac @@ -347,6 +347,8 @@ AC_SUBST(PCIACCESS_LIBS)
if test "x$UDEV" = xyes; then AC_DEFINE(UDEV, 1, [Have UDEV support]) +else + AC_DEFINE(UDEV, 0) fi
AC_CANONICAL_HOST diff --git a/meson.build b/meson.build index 8d4d38b46ebcf75b9fb6..0fe04a1411963c70cf80 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,9 @@ if _libkms != 'false' with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system()) endif
+config.set10('UDEV', with_udev) if with_udev dep_udev = dependency('udev') - config.set10('UDEV', true) else dep_udev = [] endif diff --git a/xf86drm.c b/xf86drm.c index 117b0fc9e4a0158cf384..689e8fe9fe356957f03e 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -290,7 +290,7 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok) * If any other failure happened then it will output error mesage using * drmMsg() call. */ -#if !defined(UDEV) +#if !UDEV static int chown_check_return(const char *path, uid_t owner, gid_t group) { int rv; @@ -329,7 +329,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; gid_t serv_group; -#if !defined(UDEV) +#if !UDEV int isroot = !geteuid(); uid_t user = DRM_DEV_UID; gid_t group = DRM_DEV_GID; @@ -358,7 +358,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); }
-#if !defined(UDEV) +#if !UDEV if (stat(DRM_DIR_NAME, &st)) { if (!isroot) return DRM_ERR_NOT_ROOT; @@ -411,7 +411,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) if (fd >= 0) return fd;
-#if !defined(UDEV) +#if !UDEV /* Check if the device node is not what we expect it to be, and recreate it * and try again if so. */
On 16 March 2018 at 17:12, Eric Engestrom eric.engestrom@imgtec.com wrote:
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com
configure.ac | 2 ++ meson.build | 2 +- xf86drm.c | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index 14baa1c87f9078f336fa..619af49726d198c5d685 100644 --- a/configure.ac +++ b/configure.ac @@ -347,6 +347,8 @@ AC_SUBST(PCIACCESS_LIBS)
if test "x$UDEV" = xyes; then AC_DEFINE(UDEV, 1, [Have UDEV support]) +else
AC_DEFINE(UDEV, 0)
fi
AC_CANONICAL_HOST diff --git a/meson.build b/meson.build index 8d4d38b46ebcf75b9fb6..0fe04a1411963c70cf80 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,9 @@ if _libkms != 'false' with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system()) endif
+config.set10('UDEV', with_udev)
This looks fine.
if with_udev dep_udev = dependency('udev')
- config.set10('UDEV', true)
else dep_udev = [] endif
Does this pull udev.pc or libudev.pc?
In either case the whole thing can go - see 0ec7252a1deba3bac78b5ba1ebd2898f6bbf0332 + parent commit.
The series is Reviewed-by: Emil Velikov emil.velikov@collabora.com
-Emil
On March 16, 2018 5:25:12 PM UTC, Emil Velikov emil.l.velikov@gmail.com wrote:
On 16 March 2018 at 17:12, Eric Engestrom eric.engestrom@imgtec.com wrote:
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com
configure.ac | 2 ++ meson.build | 2 +- xf86drm.c | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac index 14baa1c87f9078f336fa..619af49726d198c5d685 100644 --- a/configure.ac +++ b/configure.ac @@ -347,6 +347,8 @@ AC_SUBST(PCIACCESS_LIBS)
if test "x$UDEV" = xyes; then AC_DEFINE(UDEV, 1, [Have UDEV support]) +else
AC_DEFINE(UDEV, 0)
fi
AC_CANONICAL_HOST diff --git a/meson.build b/meson.build index 8d4d38b46ebcf75b9fb6..0fe04a1411963c70cf80 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,9 @@ if _libkms != 'false' with_libkms = _libkms == 'true' or ['linux', 'freebsd',
'dragonfly'].contains(host_machine.system())
endif
+config.set10('UDEV', with_udev)
This looks fine.
if with_udev dep_udev = dependency('udev')
- config.set10('UDEV', true)
else dep_udev = [] endif
Does this pull udev.pc or libudev.pc?
udev.pc, which I think is libudev (not on a computer right now, too complicated to double check)
In either case the whole thing can go - see 0ec7252a1deba3bac78b5ba1ebd2898f6bbf0332 + parent commit.
Sure; I'll double check that this is true for meson as well, and make another patch atop this series for that next week :)
The series is Reviewed-by: Emil Velikov emil.velikov@collabora.com
Thanks; I'll push it next week though :)
-Emil _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com --- meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build index 0fe04a1411963c70cf80..74a541e8d835ae27c7f4 100644 --- a/meson.build +++ b/meson.build @@ -187,9 +187,8 @@ else endif dep_m = cc.find_library('m', required : false) foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h'] - if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)) - config.set10('HAVE_' + header.underscorify().to_upper(), true) - endif + config.set('HAVE_' + header.underscorify().to_upper(), + cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))) endforeach if cc.has_header_symbol('sys/sysmacros.h', 'major') config.set10('MAJOR_IN_SYSMACROS', true)
Quoting Eric Engestrom (2018-03-16 10:12:27)
Signed-off-by: Eric Engestrom eric.engestrom@imgtec.com
meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build index 0fe04a1411963c70cf80..74a541e8d835ae27c7f4 100644 --- a/meson.build +++ b/meson.build @@ -187,9 +187,8 @@ else endif dep_m = cc.find_library('m', required : false) foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
- if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))
- config.set10('HAVE_' + header.underscorify().to_upper(), true)
- endif
- config.set('HAVE_' + header.underscorify().to_upper(),
- cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
endforeach if cc.has_header_symbol('sys/sysmacros.h', 'major') config.set10('MAJOR_IN_SYSMACROS', true) -- Cheers, Eric
for the series: Reviewed-by: Dylan Baker dylan@pnwbakers.com
dri-devel@lists.freedesktop.org