@@ -147,198 +147,51 @@ if test "$MONGODB" != "no"; then
147147 EXTRA_LDFLAGS="$COVERAGE_CFLAGS"
148148 fi
149149
150- MONGODB_BSON="\
151- src/bson.c \
152- ";
150+ PHP_MONGODB_CFLAGS="$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS"
153151
154- MONGODB_BSON_CLASSES="\
155- src/BSON/Type.c \
156- src/BSON/Unserializable.c \
157- src/BSON/Serializable.c \
158- src/BSON/Persistable.c \
152+ PHP_MONGODB_SOURCES="\
153+ php_phongo.c \
154+ phongo_compat.c \
155+ src/bson.c \
159156 src/BSON/Binary.c \
160157 src/BSON/Decimal128.c \
161158 src/BSON/Javascript.c \
162159 src/BSON/MaxKey.c \
163160 src/BSON/MinKey.c \
164161 src/BSON/ObjectID.c \
162+ src/BSON/Persistable.c \
165163 src/BSON/Regex.c \
164+ src/BSON/Serializable.c \
166165 src/BSON/Timestamp.c \
166+ src/BSON/Type.c \
167+ src/BSON/Unserializable.c \
167168 src/BSON/UTCDateTime.c \
168- ";
169- MONGODB_ROOT="\
170- php_phongo.c \
171- phongo_compat.c \
172- ";
173- MONGODB_MONGODB_CLASSES="\
174- src/MongoDB/Command.c \
175- src/MongoDB/Cursor.c \
176- src/MongoDB/CursorId.c \
177- src/MongoDB/Manager.c \
178- src/MongoDB/Query.c \
179- src/MongoDB/ReadConcern.c \
180- src/MongoDB/ReadPreference.c \
181- src/MongoDB/Server.c \
182- src/MongoDB/BulkWrite.c \
183- src/MongoDB/WriteConcern.c \
184- src/MongoDB/WriteConcernError.c \
185- src/MongoDB/WriteError.c \
186- src/MongoDB/WriteResult.c \
187- ";
188- MONGODB_MONGODB_EXCEPTIONS="\
189- src/MongoDB/Exception/Exception.c \
190- src/MongoDB/Exception/LogicException.c \
191- src/MongoDB/Exception/RuntimeException.c \
192- src/MongoDB/Exception/UnexpectedValueException.c \
193- src/MongoDB/Exception/InvalidArgumentException.c \
194- src/MongoDB/Exception/ConnectionException.c \
195- src/MongoDB/Exception/AuthenticationException.c \
196- src/MongoDB/Exception/SSLConnectionException.c \
197- src/MongoDB/Exception/ExecutionTimeoutException.c \
198- src/MongoDB/Exception/ConnectionTimeoutException.c \
199- src/MongoDB/Exception/WriteException.c \
200- src/MongoDB/Exception/BulkWriteException.c \
201- ";
202-
203- YAJL_SOURCES="\
204- yajl_version.c \
205- yajl.c \
206- yajl_encode.c \
207- yajl_lex.c \
208- yajl_parser.c \
209- yajl_buf.c \
210- yajl_tree.c \
211- yajl_alloc.c \
212- yajl_gen.c
213- ";
214-
215- BSON_SOURCES="\
216- bcon.c \
217- bson.c \
218- bson-atomic.c \
219- bson-clock.c \
220- bson-context.c \
221- bson-decimal128.c \
222- bson-error.c \
223- bson-iter.c \
224- bson-iso8601.c \
225- bson-json.c \
226- bson-keys.c \
227- bson-md5.c \
228- bson-memory.c \
229- bson-oid.c \
230- bson-reader.c \
231- bson-string.c \
232- bson-timegm.c \
233- bson-utf8.c \
234- bson-value.c \
235- bson-version-functions.c \
236- bson-writer.c
237- ";
238-
239- MONGOC_SOURCES="\
240- mongoc-apm.c \
241- mongoc-array.c \
242- mongoc-async.c \
243- mongoc-async-cmd.c \
244- mongoc-buffer.c \
245- mongoc-bulk-operation.c \
246- mongoc-b64.c \
247- mongoc-client.c \
248- mongoc-client-pool.c \
249- mongoc-cluster.c \
250- mongoc-collection.c \
251- mongoc-counters.c \
252- mongoc-cursor.c \
253- mongoc-cursor-array.c \
254- mongoc-cursor-cursorid.c \
255- mongoc-cursor-transform.c \
256- mongoc-database.c \
257- mongoc-find-and-modify.c \
258- mongoc-host-list.c \
259- mongoc-init.c \
260- mongoc-gridfs.c \
261- mongoc-gridfs-file.c \
262- mongoc-gridfs-file-page.c \
263- mongoc-gridfs-file-list.c \
264- mongoc-handshake.c \
265- mongoc-index.c \
266- mongoc-linux-distro-scanner.c \
267- mongoc-list.c \
268- mongoc-log.c \
269- mongoc-matcher-op.c \
270- mongoc-matcher.c \
271- mongoc-memcmp.c \
272- mongoc-opcode.c \
273- mongoc-queue.c \
274- mongoc-read-concern.c \
275- mongoc-read-prefs.c \
276- mongoc-rpc.c \
277- mongoc-server-description.c \
278- mongoc-server-stream.c \
279- mongoc-set.c \
280- mongoc-socket.c \
281- mongoc-stream.c \
282- mongoc-stream-buffered.c \
283- mongoc-stream-file.c \
284- mongoc-stream-gridfs.c \
285- mongoc-stream-socket.c \
286- mongoc-topology.c \
287- mongoc-topology-description.c \
288- mongoc-topology-description-apm.c \
289- mongoc-topology-scanner.c \
290- mongoc-uri.c \
291- mongoc-util.c \
292- mongoc-version-functions.c \
293- mongoc-write-command.c \
294- mongoc-write-concern.c
295- ";
296-
297- MONGOC_SOURCES_CRYPTO="\
298- mongoc-crypto.c \
299- mongoc-scram.c
300- ";
301-
302- MONGOC_SOURCES_SSL="\
303- mongoc-stream-tls.c \
304- mongoc-ssl.c
305- ";
306-
307- MONGOC_SOURCES_OPENSSL="\
308- mongoc-crypto-openssl.c \
309- mongoc-openssl.c \
310- mongoc-rand-openssl.c \
311- mongoc-stream-tls-openssl.c \
312- mongoc-stream-tls-openssl-bio.c
313- ";
314-
315- MONGOC_SOURCES_SECURE_TRANSPORT="\
316- mongoc-crypto-common-crypto.c \
317- mongoc-rand-common-crypto.c \
318- mongoc-secure-transport.c \
319- mongoc-stream-tls-secure-transport.c
320- ";
321-
322- MONGOC_SOURCES_SECURE_CHANNEL="\
323- mongoc-crypto-cng.c \
324- mongoc-rand-cng.c \
325- mongoc-secure-channel.c \
326- mongoc-stream-tls-secure-channel.c
327- ";
328-
329- MONGOC_SOURCES_SASL=mongoc-sasl.c
330-
331- if test "$ext_shared" = "no"; then
332- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON)
333- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES)
334- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES)
335- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS)
336- else
337- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
338- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
339- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
340- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
341- fi
169+ src/MongoDB/BulkWrite.c \
170+ src/MongoDB/Command.c \
171+ src/MongoDB/Cursor.c \
172+ src/MongoDB/CursorId.c \
173+ src/MongoDB/Manager.c \
174+ src/MongoDB/Query.c \
175+ src/MongoDB/ReadConcern.c \
176+ src/MongoDB/ReadPreference.c \
177+ src/MongoDB/Server.c \
178+ src/MongoDB/WriteConcern.c \
179+ src/MongoDB/WriteConcernError.c \
180+ src/MongoDB/WriteError.c \
181+ src/MongoDB/WriteResult.c \
182+ src/MongoDB/Exception/AuthenticationException.c \
183+ src/MongoDB/Exception/BulkWriteException.c \
184+ src/MongoDB/Exception/ConnectionException.c \
185+ src/MongoDB/Exception/ConnectionTimeoutException.c \
186+ src/MongoDB/Exception/Exception.c \
187+ src/MongoDB/Exception/ExecutionTimeoutException.c \
188+ src/MongoDB/Exception/InvalidArgumentException.c \
189+ src/MongoDB/Exception/LogicException.c \
190+ src/MongoDB/Exception/RuntimeException.c \
191+ src/MongoDB/Exception/SSLConnectionException.c \
192+ src/MongoDB/Exception/UnexpectedValueException.c \
193+ src/MongoDB/Exception/WriteException.c \
194+ "
342195
343196 PHP_ARG_WITH(libbson, whether to use system libbson,
344197 [ --with-libbson Use system libbson] , no, no)
@@ -368,10 +221,16 @@ if test "$MONGODB" != "no"; then
368221 PHP_EVAL_LIBLINE($LIBBSON_LIB, MONGODB_SHARED_LIBADD)
369222 AC_DEFINE ( HAVE_SYSTEM_LIBBSON , 1 , [ Use system libbson] )
370223 else
371- LIBBSON_CFLAGS="-DBSON_COMPILATION"
224+ PHP_MONGODB_BSON_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION"
225+
226+ # Generated with: find src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
227+ PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c"
228+
229+ # Generated with: find src/libbson/src/yajl -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
230+ PHP_MONGODB_YAJL_SOURCES="yajl_alloc.c yajl_buf.c yajl.c yajl_encode.c yajl_gen.c yajl_lex.c yajl_parser.c yajl_tree.c yajl_version.c"
372231
373- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libbson/src/yajl ] , $YAJL_SOURCES, [ $STD_CFLAGS $LIBBSON_CFLAGS ] , shared_objects_mongodb, yes)
374- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libbson/src/bson ] , $BSON_SOURCES, [ $STD_CFLAGS $LIBBSON_CFLAGS ] , shared_objects_mongodb, yes)
232+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libbson/src/bson ] , $PHP_MONGODB_BSON_SOURCES, $PHP_MONGODB_BSON_CFLAGS , shared_objects_mongodb, yes)
233+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libbson/src/yajl ] , $PHP_MONGODB_YAJL_SOURCES, $PHP_MONGODB_BSON_CFLAGS , shared_objects_mongodb, yes)
375234 fi
376235
377236 AC_MSG_CHECKING ( configuring libmongoc )
@@ -401,16 +260,12 @@ if test "$MONGODB" != "no"; then
401260 PHP_EVAL_LIBLINE($LIBMONGOC_LIB, MONGODB_SHARED_LIBADD)
402261 AC_DEFINE ( HAVE_SYSTEM_LIBMONGOC , 1 , [ Use system libmongoc] )
403262 else
404- LIBMONGOC_CFLAGS=" -DMONGOC_COMPILATION -DMONGOC_TRACE"
263+ PHP_MONGODB_MONGOC_CFLAGS="$STD_CFLAGS -DMONGOC_COMPILATION -DMONGOC_TRACE"
405264
406- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
407- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_CRYPTO, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
408- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SSL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
409- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_OPENSSL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
410- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SECURE_TRANSPORT, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
411- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SECURE_CHANNEL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
412- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SASL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
265+ # Generated with: find src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 4- | sort -z | tr '\000' ' '
266+ PHP_MONGODB_MONGOC_SOURCES="mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-b64.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-client.c mongoc-client-pool.c mongoc-cluster.c mongoc-collection.c mongoc-counters.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-cursorid.c mongoc-cursor-transform.c mongoc-database.c mongoc-find-and-modify.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-index.c mongoc-init.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-opcode.c mongoc-openssl.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-description.c mongoc-server-stream.c mongoc-set.c mongoc-socket.c mongoc-ssl.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c"
413267
268+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $PHP_MONGODB_MONGOC_SOURCES, $PHP_MONGODB_MONGOC_CFLAGS, shared_objects_mongodb, yes)
414269
415270 PHP_SETUP_OPENSSL(MONGODB_SHARED_LIBADD)
416271 AC_SUBST ( MONGOC_ENABLE_CRYPTO , 1 )
501356 MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $PTHREAD_LIBS $SASL_LIBS"
502357 PHP_SUBST(MONGODB_SHARED_LIBADD)
503358
504- PHP_NEW_EXTENSION(mongodb, $MONGODB_ROOT , $ext_shared,, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS ] )
359+ PHP_NEW_EXTENSION(mongodb, $PHP_MONGODB_SOURCES , $ext_shared,, $PHP_MONGODB_CFLAGS )
505360 PHP_ADD_EXTENSION_DEP(mongodb, date)
506361 PHP_ADD_EXTENSION_DEP(mongodb, json)
507362 PHP_ADD_EXTENSION_DEP(mongodb, spl)
0 commit comments