@@ -83,8 +83,6 @@ AC_DEFUN([PHP_BSON_CLOCK],
8383 fi
8484] )
8585
86- MONGOC_SYMBOL_SUFFIX="priv"
87-
8886AC_MSG_CHECKING ( PHP version )
8987PHP_FOUND_VERSION=`${PHP_CONFIG} --version`
9088PHP_FOUND_VERNUM=`echo "${PHP_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([ $] 1 * 100 + [ $] 2) * 100 + [ $] 3;}'`
@@ -129,12 +127,13 @@ if test "$MONGODB" != "no"; then
129127 PHP_CHECK_GCC_ARG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body")
130128 PHP_CHECK_GCC_ARG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
131129 PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
130+ PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
131+ PHP_CHECK_GCC_ARG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
132+ PHP_CHECK_GCC_ARG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
133+ PHP_CHECK_GCC_ARG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable")
134+ PHP_CHECK_GCC_ARG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers")
132135
133- if test "$PHP_FOUND_VERNUM" -ge "50400"; then
134- PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
135- fi
136-
137- MAINTAINER_CFLAGS="-Wextra $_MAINTAINER_CFLAGS -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-missing-field-initializers"
136+ MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS"
138137 STD_CFLAGS="-g -O0 -Wall"
139138 fi
140139
@@ -148,198 +147,51 @@ if test "$MONGODB" != "no"; then
148147 EXTRA_LDFLAGS="$COVERAGE_CFLAGS"
149148 fi
150149
151- MONGODB_BSON="\
152- src/bson.c \
153- ";
150+ PHP_MONGODB_CFLAGS="$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS"
154151
155- MONGODB_BSON_CLASSES="\
156- src/BSON/Type.c \
157- src/BSON/Unserializable.c \
158- src/BSON/Serializable.c \
159- src/BSON/Persistable.c \
152+ PHP_MONGODB_SOURCES="\
153+ php_phongo.c \
154+ phongo_compat.c \
155+ src/bson.c \
160156 src/BSON/Binary.c \
161157 src/BSON/Decimal128.c \
162158 src/BSON/Javascript.c \
163159 src/BSON/MaxKey.c \
164160 src/BSON/MinKey.c \
165161 src/BSON/ObjectID.c \
162+ src/BSON/Persistable.c \
166163 src/BSON/Regex.c \
164+ src/BSON/Serializable.c \
167165 src/BSON/Timestamp.c \
166+ src/BSON/Type.c \
167+ src/BSON/Unserializable.c \
168168 src/BSON/UTCDateTime.c \
169- ";
170- MONGODB_ROOT="\
171- php_phongo.c \
172- phongo_compat.c \
173- ";
174- MONGODB_MONGODB_CLASSES="\
175- src/MongoDB/Command.c \
176- src/MongoDB/Cursor.c \
177- src/MongoDB/CursorId.c \
178- src/MongoDB/Manager.c \
179- src/MongoDB/Query.c \
180- src/MongoDB/ReadConcern.c \
181- src/MongoDB/ReadPreference.c \
182- src/MongoDB/Server.c \
183- src/MongoDB/BulkWrite.c \
184- src/MongoDB/WriteConcern.c \
185- src/MongoDB/WriteConcernError.c \
186- src/MongoDB/WriteError.c \
187- src/MongoDB/WriteResult.c \
188- ";
189- MONGODB_MONGODB_EXCEPTIONS="\
190- src/MongoDB/Exception/Exception.c \
191- src/MongoDB/Exception/LogicException.c \
192- src/MongoDB/Exception/RuntimeException.c \
193- src/MongoDB/Exception/UnexpectedValueException.c \
194- src/MongoDB/Exception/InvalidArgumentException.c \
195- src/MongoDB/Exception/ConnectionException.c \
196- src/MongoDB/Exception/AuthenticationException.c \
197- src/MongoDB/Exception/SSLConnectionException.c \
198- src/MongoDB/Exception/ExecutionTimeoutException.c \
199- src/MongoDB/Exception/ConnectionTimeoutException.c \
200- src/MongoDB/Exception/WriteException.c \
201- src/MongoDB/Exception/BulkWriteException.c \
202- ";
203-
204- YAJL_SOURCES="\
205- yajl_version.c \
206- yajl.c \
207- yajl_encode.c \
208- yajl_lex.c \
209- yajl_parser.c \
210- yajl_buf.c \
211- yajl_tree.c \
212- yajl_alloc.c \
213- yajl_gen.c
214- ";
215-
216- BSON_SOURCES="\
217- bcon.c \
218- bson.c \
219- bson-atomic.c \
220- bson-clock.c \
221- bson-context.c \
222- bson-decimal128.c \
223- bson-error.c \
224- bson-iter.c \
225- bson-iso8601.c \
226- bson-json.c \
227- bson-keys.c \
228- bson-md5.c \
229- bson-memory.c \
230- bson-oid.c \
231- bson-reader.c \
232- bson-string.c \
233- bson-timegm.c \
234- bson-utf8.c \
235- bson-value.c \
236- bson-version-functions.c \
237- bson-writer.c
238- ";
239-
240- MONGOC_SOURCES="\
241- mongoc-apm.c \
242- mongoc-array.c \
243- mongoc-async.c \
244- mongoc-async-cmd.c \
245- mongoc-buffer.c \
246- mongoc-bulk-operation.c \
247- mongoc-b64.c \
248- mongoc-client.c \
249- mongoc-client-pool.c \
250- mongoc-cluster.c \
251- mongoc-collection.c \
252- mongoc-counters.c \
253- mongoc-cursor.c \
254- mongoc-cursor-array.c \
255- mongoc-cursor-cursorid.c \
256- mongoc-cursor-transform.c \
257- mongoc-database.c \
258- mongoc-find-and-modify.c \
259- mongoc-host-list.c \
260- mongoc-init.c \
261- mongoc-gridfs.c \
262- mongoc-gridfs-file.c \
263- mongoc-gridfs-file-page.c \
264- mongoc-gridfs-file-list.c \
265- mongoc-handshake.c \
266- mongoc-index.c \
267- mongoc-linux-distro-scanner.c \
268- mongoc-list.c \
269- mongoc-log.c \
270- mongoc-matcher-op.c \
271- mongoc-matcher.c \
272- mongoc-memcmp.c \
273- mongoc-opcode.c \
274- mongoc-queue.c \
275- mongoc-read-concern.c \
276- mongoc-read-prefs.c \
277- mongoc-rpc.c \
278- mongoc-server-description.c \
279- mongoc-server-stream.c \
280- mongoc-set.c \
281- mongoc-socket.c \
282- mongoc-stream.c \
283- mongoc-stream-buffered.c \
284- mongoc-stream-file.c \
285- mongoc-stream-gridfs.c \
286- mongoc-stream-socket.c \
287- mongoc-topology.c \
288- mongoc-topology-description.c \
289- mongoc-topology-description-apm.c \
290- mongoc-topology-scanner.c \
291- mongoc-uri.c \
292- mongoc-util.c \
293- mongoc-version-functions.c \
294- mongoc-write-command.c \
295- mongoc-write-concern.c
296- ";
297-
298- MONGOC_SOURCES_CRYPTO="\
299- mongoc-crypto.c \
300- mongoc-scram.c
301- ";
302-
303- MONGOC_SOURCES_SSL="\
304- mongoc-stream-tls.c \
305- mongoc-ssl.c
306- ";
307-
308- MONGOC_SOURCES_OPENSSL="\
309- mongoc-crypto-openssl.c \
310- mongoc-openssl.c \
311- mongoc-rand-openssl.c \
312- mongoc-stream-tls-openssl.c \
313- mongoc-stream-tls-openssl-bio.c
314- ";
315-
316- MONGOC_SOURCES_SECURE_TRANSPORT="\
317- mongoc-crypto-common-crypto.c \
318- mongoc-rand-common-crypto.c \
319- mongoc-secure-transport.c \
320- mongoc-stream-tls-secure-transport.c
321- ";
322-
323- MONGOC_SOURCES_SECURE_CHANNEL="\
324- mongoc-crypto-cng.c \
325- mongoc-rand-cng.c \
326- mongoc-secure-channel.c \
327- mongoc-stream-tls-secure-channel.c
328- ";
329-
330- MONGOC_SOURCES_SASL=mongoc-sasl.c
331-
332- if test "$ext_shared" = "no"; then
333- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON)
334- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES)
335- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES)
336- PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS)
337- else
338- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
339- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
340- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
341- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS, [ $STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS] , shared_objects_mongodb, yes)
342- 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+ "
343195
344196 PHP_ARG_WITH(libbson, whether to use system libbson,
345197 [ --with-libbson Use system libbson] , no, no)
@@ -369,10 +221,16 @@ if test "$MONGODB" != "no"; then
369221 PHP_EVAL_LIBLINE($LIBBSON_LIB, MONGODB_SHARED_LIBADD)
370222 AC_DEFINE ( HAVE_SYSTEM_LIBBSON , 1 , [ Use system libbson] )
371223 else
372- 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"
373231
374- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libbson/src/yajl ] , $YAJL_SOURCES, [ $STD_CFLAGS $LIBBSON_CFLAGS ] , shared_objects_mongodb, yes)
375- 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)
376234 fi
377235
378236 AC_MSG_CHECKING ( configuring libmongoc )
@@ -402,16 +260,12 @@ if test "$MONGODB" != "no"; then
402260 PHP_EVAL_LIBLINE($LIBMONGOC_LIB, MONGODB_SHARED_LIBADD)
403261 AC_DEFINE ( HAVE_SYSTEM_LIBMONGOC , 1 , [ Use system libmongoc] )
404262 else
405- LIBMONGOC_CFLAGS=" -DMONGOC_COMPILATION -DMONGOC_TRACE"
263+ PHP_MONGODB_MONGOC_CFLAGS="$STD_CFLAGS -DMONGOC_COMPILATION -DMONGOC_TRACE"
406264
407- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
408- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_CRYPTO, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
409- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SSL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
410- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_OPENSSL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
411- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SECURE_TRANSPORT, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
412- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[ src/libmongoc/src/mongoc] , $MONGOC_SOURCES_SECURE_CHANNEL, [ $STD_CFLAGS $LIBMONGOC_CFLAGS] , shared_objects_mongodb, yes)
413- 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"
414267
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)
415269
416270 PHP_SETUP_OPENSSL(MONGODB_SHARED_LIBADD)
417271 AC_SUBST ( MONGOC_ENABLE_CRYPTO , 1 )
502356 MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $PTHREAD_LIBS $SASL_LIBS"
503357 PHP_SUBST(MONGODB_SHARED_LIBADD)
504358
505- 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 )
506360 PHP_ADD_EXTENSION_DEP(mongodb, date)
507361 PHP_ADD_EXTENSION_DEP(mongodb, json)
508362 PHP_ADD_EXTENSION_DEP(mongodb, spl)
0 commit comments