summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom2018-01-26 11:04:28 -0600
committerEric Engestrom2018-03-20 09:30:27 -0500
commit1a44bbae734fa6aa227d2ac621ff7884af1ae8ef (patch)
tree7a491caee1358e6cce7743f0d24389f3b29009ce
parent32e0370e36e8263b1e7dfb75f76934dbfce53e9c (diff)
downloadexternal-libdrm-1a44bbae734fa6aa227d2ac621ff7884af1ae8ef.tar.gz
external-libdrm-1a44bbae734fa6aa227d2ac621ff7884af1ae8ef.tar.xz
external-libdrm-1a44bbae734fa6aa227d2ac621ff7884af1ae8ef.zip
meson,configure: always define HAVE_OPEN_MEMSTREAM
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
-rw-r--r--configure.ac4
-rw-r--r--intel/test_decode.c4
-rw-r--r--meson.build4
3 files changed, 6 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index ec5003f6..762ca9f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,7 +189,9 @@ AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
189 [AC_MSG_ERROR([Couldn't find clock_gettime])])]) 189 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
190AC_SUBST([CLOCK_LIB]) 190AC_SUBST([CLOCK_LIB])
191 191
192AC_CHECK_FUNCS([open_memstream], [HAVE_OPEN_MEMSTREAM=yes]) 192AC_CHECK_FUNCS([open_memstream],
193 [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 1, [Have open_memstream()])],
194 [AC_DEFINE([HAVE_OPEN_MEMSTREAM], 0)])
193 195
194dnl Use lots of warning flags with with gcc and compatible compilers 196dnl Use lots of warning flags with with gcc and compatible compilers
195 197
diff --git a/intel/test_decode.c b/intel/test_decode.c
index b4eddcd1..68f777b0 100644
--- a/intel/test_decode.c
+++ b/intel/test_decode.c
@@ -91,7 +91,7 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
91{ 91{
92 FILE *out = NULL; 92 FILE *out = NULL;
93 void *ptr, *ref_ptr, *batch_ptr; 93 void *ptr, *ref_ptr, *batch_ptr;
94#ifdef HAVE_OPEN_MEMSTREAM 94#if HAVE_OPEN_MEMSTREAM
95 size_t size; 95 size_t size;
96#endif 96#endif
97 size_t ref_size, batch_size; 97 size_t ref_size, batch_size;
@@ -109,7 +109,7 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
109 * figure out how to output to a file in a safe and sane way 109 * figure out how to output to a file in a safe and sane way
110 * inside of an automake project's test infrastructure. 110 * inside of an automake project's test infrastructure.
111 */ 111 */
112#ifdef HAVE_OPEN_MEMSTREAM 112#if HAVE_OPEN_MEMSTREAM
113 out = open_memstream((char **)&ptr, &size); 113 out = open_memstream((char **)&ptr, &size);
114#else 114#else
115 fprintf(stderr, "platform lacks open_memstream, skipping.\n"); 115 fprintf(stderr, "platform lacks open_memstream, skipping.\n");
diff --git a/meson.build b/meson.build
index 2a6c4680..50daa1d0 100644
--- a/meson.build
+++ b/meson.build
@@ -196,9 +196,7 @@ if cc.has_header_symbol('sys/sysmacros.h', 'major')
196elif cc.has_header_symbol('sys/mkdev.h', 'major') 196elif cc.has_header_symbol('sys/mkdev.h', 'major')
197 config.set10('MAJOR_IN_MKDEV', true) 197 config.set10('MAJOR_IN_MKDEV', true)
198endif 198endif
199if cc.has_function('open_memstream') 199config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
200 config.set10('HAVE_OPEN_MEMSTREAM', true)
201endif
202 200
203warn_c_args = [] 201warn_c_args = []
204foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef', 202foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',