[vlc-commits] [Git][videolan/vlc][master] 4 commits: configure: zlib.h does not imply -lz
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Sun Feb 27 17:27:33 UTC 2022
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
f15aaab5 by Rémi Denis-Courmont at 2022-02-27T17:10:01+00:00
configure: zlib.h does not imply -lz
Same problem as 0c482e0736a2ff620664cb64dbdb199e8f8e2f1a.
- - - - -
68ca9f76 by Rémi Denis-Courmont at 2022-02-27T17:10:01+00:00
sap: use zlib only if available
- - - - -
10a80e0b by Rémi Denis-Courmont at 2022-02-27T17:10:01+00:00
mp4: use zlib only if available
- - - - -
56db9925 by Rémi Denis-Courmont at 2022-02-27T17:10:01+00:00
mkv: use zlib only if available
- - - - -
8 changed files:
- configure.ac
- modules/demux/Makefile.am
- modules/demux/mkv/matroska_segment_parse.cpp
- modules/demux/mkv/mkv.cpp
- modules/demux/mkv/util.cpp
- modules/demux/mp4/libmp4.c
- modules/services_discovery/Makefile.am
- modules/services_discovery/sap.c
Changes:
=====================================
configure.ac
=====================================
@@ -1015,12 +1015,16 @@ AS_IF([test -n "${PKG_CONFIG}" ],[
dnl
dnl Check for zlib.h and -lz if available
dnl
-AC_CHECK_HEADERS([zlib.h], [ have_zlib=yes ], [ have_zlib=no ])
+have_zlib="no"
+AC_CHECK_HEADERS([zlib.h], [
+ AC_CHECK_LIB([z], [inflate], [
+ have_zlib=yes
+ AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have zlib.])
+ LIBZ="-lz"
+ ])
+])
+AC_SUBST([LIBZ])
AM_CONDITIONAL([HAVE_ZLIB], [ test "${have_zlib}" = "yes" ])
-if test "${have_zlib}" = "yes"
-then
- VLC_ADD_LIBS([sap],[-lz])
-fi
dnl
=====================================
modules/demux/Makefile.am
=====================================
@@ -201,10 +201,7 @@ libmkv_plugin_la_SOURCES = \
libmkv_plugin_la_SOURCES += packetizer/dts_header.h packetizer/dts_header.c
libmkv_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_mkv)
libmkv_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(demuxdir)'
-libmkv_plugin_la_LIBADD = $(LIBS_mkv)
-if HAVE_ZLIB
-libmkv_plugin_la_LIBADD += -lz
-endif
+libmkv_plugin_la_LIBADD = $(LIBS_mkv) $(LIBZ)
demux_LTLIBRARIES += $(LTLIBmkv)
EXTRA_LTLIBRARIES += libmkv_plugin.la
@@ -223,11 +220,8 @@ libmp4_plugin_la_SOURCES = demux/mp4/mp4.c demux/mp4/mp4.h \
demux/asf/asfpacket.c demux/asf/asfpacket.h \
packetizer/iso_color_tables.h \
meta_engine/ID3Genres.h
-libmp4_plugin_la_LIBADD = $(LIBM)
+libmp4_plugin_la_LIBADD = $(LIBM) $(LIBZ)
libmp4_plugin_la_LDFLAGS = $(AM_LDFLAGS)
-if HAVE_ZLIB
-libmp4_plugin_la_LIBADD += -lz
-endif
demux_LTLIBRARIES += libmp4_plugin.la
libmpgv_plugin_la_SOURCES = demux/mpeg/mpgv.c
@@ -495,10 +489,7 @@ libvlc_adaptive_la_LDFLAGS = -static
if !HAVE_WIN32
libvlc_adaptive_la_LDFLAGS += -lpthread
endif
-libvlc_adaptive_la_LIBADD += libvlc_http.la
-if HAVE_ZLIB
-libvlc_adaptive_la_LIBADD += -lz
-endif
+libvlc_adaptive_la_LIBADD += libvlc_http.la $(LIBZ)
if HAVE_GCRYPT
libvlc_adaptive_la_CXXFLAGS += $(GCRYPT_CFLAGS)
libvlc_adaptive_la_LIBADD += $(GCRYPT_LIBS)
=====================================
modules/demux/mkv/matroska_segment_parse.cpp
=====================================
@@ -1062,7 +1062,7 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
if ( bSupported )
{
-#ifdef HAVE_ZLIB_H
+#ifdef HAVE_ZLIB
if( p_track->i_compression_type == MATROSKA_COMPRESSION_ZLIB &&
p_track->i_encoding_scope & MATROSKA_ENCODING_SCOPE_PRIVATE &&
p_track->i_extra_data && p_track->p_extra_data &&
=====================================
modules/demux/mkv/mkv.cpp
=====================================
@@ -603,7 +603,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
break;
}
-#if defined(HAVE_ZLIB_H)
+#ifdef HAVE_ZLIB
if( track.i_compression_type == MATROSKA_COMPRESSION_ZLIB &&
track.i_encoding_scope & MATROSKA_ENCODING_SCOPE_ALL_FRAMES )
{
=====================================
modules/demux/mkv/util.cpp
=====================================
@@ -31,7 +31,7 @@ namespace mkv {
* Local prototypes
*****************************************************************************/
-#ifdef HAVE_ZLIB_H
+#ifdef HAVE_ZLIB
int32_t zlib_decompress_extra( demux_t * p_demux, mkv_track_t & tk )
{
int result;
=====================================
modules/demux/mp4/libmp4.c
=====================================
@@ -3442,7 +3442,7 @@ static int MP4_ReadBox_cmov( stream_t *p_stream, MP4_Box_t *p_box )
MP4_Box_t *p_dcom;
MP4_Box_t *p_cmvd;
-#ifdef HAVE_ZLIB_H
+#ifdef HAVE_ZLIB
stream_t *p_stream_memory;
z_stream z_data;
uint8_t *p_data;
@@ -3480,7 +3480,7 @@ static int MP4_ReadBox_cmov( stream_t *p_stream, MP4_Box_t *p_box )
return 0;
}
-#ifndef HAVE_ZLIB_H
+#ifndef HAVE_ZLIB
msg_Dbg( p_stream, "read box: \"cmov\" zlib unsupported" );
return 0;
@@ -3551,7 +3551,7 @@ static int MP4_ReadBox_cmov( stream_t *p_stream, MP4_Box_t *p_box )
#endif
return p_box->data.p_cmov->p_moov ? 1 : 0;
-#endif /* HAVE_ZLIB_H */
+#endif /* HAVE_ZLIB */
}
static void MP4_FreeBox_rdrf( MP4_Box_t *p_box )
=====================================
modules/services_discovery/Makefile.am
=====================================
@@ -5,8 +5,8 @@ libpodcast_plugin_la_SOURCES = services_discovery/podcast.c
sd_LTLIBRARIES += libpodcast_plugin.la
libsap_plugin_la_SOURCES = services_discovery/sap.c access/rtp/sdp.c
-libsap_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_sap)
-libsap_plugin_la_LIBADD = $(LIBS_sap) $(SOCKET_LIBS)
+libsap_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
+libsap_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBZ)
sd_LTLIBRARIES += libsap_plugin.la
libavahi_plugin_la_SOURCES = services_discovery/avahi.c
=====================================
modules/services_discovery/sap.c
=====================================
@@ -79,7 +79,7 @@
static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i_len )
{
-#ifdef HAVE_ZLIB_H
+#ifdef HAVE_ZLIB
int i_result, i_dstsize, n = 0;
unsigned char *psz_dst = NULL;
z_stream d_stream;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0d847f69e2a98b8e9e7179219cc5388e931a68d3...56db9925fc7351e9b218d85916d6fd9d38ebac54
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0d847f69e2a98b8e9e7179219cc5388e931a68d3...56db9925fc7351e9b218d85916d6fd9d38ebac54
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list