[Mesa-dev] [PATCH 1/4] configure.ac: Define HAVE_ZLIB if zlib is found
Emil Velikov
emil.l.velikov at gmail.com
Fri Nov 10 19:38:08 UTC 2017
On 10 November 2017 at 19:34, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 10 November 2017 at 18:38, Dylan Baker <dylan at pnwbakers.com> wrote:
>> Quoting Jordan Justen (2017-11-10 10:24:36)
>>> Cc: Emil Velikov <emil.velikov at collabora.com>
>>> Cc: Dylan Baker <dylan at pnwbakers.com>
>>> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
>>> ---
>>> configure.ac | 6 +++++-
>>> meson.build | 6 +++++-
>>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 411c4f6b3e0..213cfe132fb 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -900,7 +900,11 @@ dnl See if posix_memalign is available
>>> AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>>>
>>> dnl Check for zlib
>>> -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
>>> +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED],
>>> + [have_zlib=yes], [have_zlib=no])
>>> +if test "x$have_zlib" = xyes; then
>>> + DEFINES="$DEFINES -DHAVE_ZLIB"
>>> +fi
>>>
>>> dnl Check for pthreads
>>> AX_PTHREAD
>>> diff --git a/meson.build b/meson.build
>>> index 855c80ed658..4c27b3ba048 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -661,8 +661,12 @@ if dep_libdrm.found()
>>> endif
>>> endif
>>>
>>> +dep_zlib = dependency('zlib', version : '>= 1.2.3', required : false)
>>> +if dep_zlib.found()
>>> + pre_args += '-DHAVE_ZLIB'
>>> +endif
>>> +
>>
>> There's the gen_zipped_file.py in src/intel/genxml that uses zlib for something,
>> is not having zlib going to break that?
>>
> Those are the aubinator* family of tools. But more importantly, we
> have compression of the disk cache.
>
> One solution is to opt for the disk cache approach - ifdef the code
> and build it only on !Windows platforms.
> There should be others, but ^^ sounds like the shortest one.
>
Having read through the rest of the series:
The current HAVE_ZLIB approach looks good, modulo:
- keep zlib a hard requirement in autotools/meson, explicitly setting
the define
- add missing guards in src/intel - only if you want to since the
code is build on !Windows platforms anyway
-Emil
More information about the mesa-dev
mailing list