Skip to content

Commit a048098

Browse files
committed
CDRIVER-2209 Improve bundling compressor libs
1 parent 225a0f8 commit a048098

File tree

6 files changed

+59
-39
lines changed

6 files changed

+59
-39
lines changed

Makefile.am

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ SUBDIRS =
1414
if WITH_LIBBSON
1515
SUBDIRS += src/libbson
1616
endif
17-
if WITH_SNAPPY
18-
include src/snappy-1.1.3/Makefile.am
19-
libmongoc_1_0_la_DEPENDENCIES += libsnappy.la
20-
endif
21-
if WITH_ZLIB
22-
include src/zlib-1.2.11/Makefile.am
23-
libmongoc_1_0_la_DEPENDENCIES += libzlib.la
24-
endif
2517

2618
AM_CTAGSFLAGS = --fields=+l --languages=c
2719

build/autotools/CheckSnappy.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ AS_IF([test "x${with_snappy}" = xbundled],[
8181
fi
8282
/* end of vendored configure.ac checks from snappy */
8383
84-
SNAPPY_LIBS=libsnappy.la
84+
SNAPPY_LIBS=
8585
SNAPPY_CFLAGS="-Isrc/snappy-1.1.3"
8686
])
8787

build/autotools/CheckZlib.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ AS_IF([test "x${ZLIB_LIBS}" = "x" -a "x$with_zlib" = "xsystem"],
2828
AS_IF([test "x${with_zlib}" = xbundled],[
2929
AC_MSG_CHECKING(whether to enable bundled zlib)
3030
AC_MSG_RESULT(yes)
31-
ZLIB_LIBS=libzlib.la
31+
ZLIB_LIBS=
3232
ZLIB_CFLAGS="-Isrc/zlib-1.2.11"
3333
])
3434

src/Makefile.am

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ if ENABLE_STATIC
2626
endif
2727

2828

29-
if WITH_SNAPPY
30-
# Use c++ linker
31-
nodist_EXTRA_libmongoc_1_0_la_SOURCES = dummy.cxx
32-
nodist_EXTRA_libmongoc_priv_la_SOURCES = dummy.cxx
33-
endif
3429
EXTRA_DIST += \
3530
src/libmongoc-1.0.pc.in \
3631
src/libmongoc-ssl-1.0.pc.in \

src/mongoc/Makefile.am

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,5 +318,62 @@ if OS_WIN32
318318
libmongoc_la_LIBADD += -lws2_32
319319
endif
320320

321+
if WITH_SNAPPY
322+
libmongoc_la_LIBADD += libsnappy.la
323+
lib_LTLIBRARIES += libsnappy.la
324+
libsnappy_la_CPPFLAGS = $(BSON_CFLAGS)
325+
libsnappy_la_SOURCES = \
326+
src/snappy-1.1.3/snappy.cc \
327+
src/snappy-1.1.3/snappy-sinksource.cc \
328+
src/snappy-1.1.3/snappy-stubs-internal.cc \
329+
src/snappy-1.1.3/snappy-c.cc
330+
331+
noinst_HEADERS += \
332+
src/snappy-1.1.3/snappy-internal.h \
333+
src/snappy-1.1.3/snappy-stubs-internal.h \
334+
src/snappy-1.1.3/snappy-test.h \
335+
src/snappy-1.1.3/snappy.h \
336+
src/snappy-1.1.3/snappy-sinksource.h \
337+
src/snappy-1.1.3/snappy-stubs-public.h \
338+
src/snappy-1.1.3/snappy-c.h
339+
340+
dist_doc_DATA = src/snappy-1.1.3/COPYING
341+
endif
342+
343+
if WITH_ZLIB
344+
libmongoc_la_LIBADD += libzlib.la
345+
noinst_LTLIBRARIES += libzlib.la
346+
libzlib_la_CFLAGS =
347+
libzlib_la_SOURCES = \
348+
src/zlib-1.2.11/adler32.c \
349+
src/zlib-1.2.11/crc32.c \
350+
src/zlib-1.2.11/deflate.c \
351+
src/zlib-1.2.11/infback.c \
352+
src/zlib-1.2.11/inffast.c \
353+
src/zlib-1.2.11/inflate.c \
354+
src/zlib-1.2.11/inftrees.c \
355+
src/zlib-1.2.11/trees.c \
356+
src/zlib-1.2.11/zutil.c \
357+
src/zlib-1.2.11/compress.c \
358+
src/zlib-1.2.11/uncompr.c \
359+
src/zlib-1.2.11/gzclose.c \
360+
src/zlib-1.2.11/gzlib.c \
361+
src/zlib-1.2.11/gzread.c \
362+
src/zlib-1.2.11/gzwrite.c
363+
364+
noinst_HEADERS += \
365+
src/zlib-1.2.11/crc32.h \
366+
src/zlib-1.2.11/deflate.h \
367+
src/zlib-1.2.11/gzguts.h \
368+
src/zlib-1.2.11/inffast.h \
369+
src/zlib-1.2.11/inffixed.h \
370+
src/zlib-1.2.11/inflate.h \
371+
src/zlib-1.2.11/inftrees.h \
372+
src/zlib-1.2.11/trees.h \
373+
src/zlib-1.2.11/zconf.h \
374+
src/zlib-1.2.11/zlib.h \
375+
src/zlib-1.2.11/zutil.h
376+
endif
377+
321378
EXTRA_DIST += $(MONGOC_DEF_FILES) $(NOINST_H_FILES)
322379

tests/Makefile.am

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,19 @@ if OS_WIN32
5050
TEST_LIBS += -lshlwapi
5151
endif
5252

53-
if WITH_SNAPPY
54-
# Use c++ linker
55-
nodist_EXTRA_test_load_SOURCES = dummy.cxx
56-
endif
5753
test_load_SOURCES = \
5854
tests/test-load.c \
5955
tests/mongoc-tests.c
6056
test_load_CFLAGS = $(TEST_CFLAGS)
6157
test_load_LDADD = libmongoc-1.0.la $(TEST_LIBS)
6258

6359

64-
if WITH_SNAPPY
65-
# Use c++ linker
66-
nodist_EXTRA_test_secondary_SOURCES = dummy.cxx
67-
endif
6860
test_secondary_SOURCES = \
6961
tests/test-secondary.c \
7062
tests/mongoc-tests.c
7163
test_secondary_CFLAGS = $(TEST_CFLAGS)
7264
test_secondary_LDADD = libmongoc-1.0.la $(TEST_LIBS)
7365

74-
if WITH_SNAPPY
75-
# Use c++ linker
76-
nodist_EXTRA_test_replica_set_SOURCES = dummy.cxx
77-
endif
7866
test_replica_set_SOURCES = \
7967
tests/test-replica-set.c \
8068
tests/ha-test.c \
@@ -84,10 +72,6 @@ test_replica_set_CFLAGS = $(TEST_CFLAGS)
8472
test_replica_set_LDADD = libmongoc.la $(TEST_LIBS)
8573

8674

87-
if WITH_SNAPPY
88-
# Use c++ linker
89-
nodist_EXTRA_test_replica_set_ssl_SOURCES = dummy.cxx
90-
endif
9175
test_replica_set_ssl_SOURCES = \
9276
tests/test-replica-set-ssl.c \
9377
tests/ha-test.c \
@@ -191,20 +175,12 @@ if ENABLE_SASL
191175
test_libmongoc_SOURCES += \
192176
tests/test-cyrus.c
193177
endif
194-
if WITH_SNAPPY
195-
# Use c++ linker
196-
nodist_EXTRA_test_libmongoc_SOURCES = dummy.cxx
197-
endif
198178
test_libmongoc_CFLAGS = $(TEST_CFLAGS)
199179
test_libmongoc_LDADD = libmongoc.la $(TEST_LIBS)
200180
test_libmongoc_LDFLAGS = -no-undefined \
201181
-rpath $(libdir)
202182

203183

204-
if WITH_SNAPPY
205-
# Use c++ linker
206-
nodist_EXTRA_test_sharded_cluster_SOURCES = dummy.cxx
207-
endif
208184

209185
check: test
210186

0 commit comments

Comments
 (0)