41 Commits

Author SHA1 Message Date
Jeremy Mikola 8dfe6c31ec PHPC-2256: Build configuration improvements (#1483)
* PHPC-2311: Note that with-libbson and with-libmongoc are deprecated

* PHPC-2312: MONGOC_ENABLE_SASL_GSSAPI is obsolete

* PHPC-1218: Use m4_include with base path for including m4 scripts

This removes the custom _include macro, which used sinclude on two different paths in order to support both shared and static builds. Unlike m4_sinclude, m4_include reports an error if the file is not found, so this also addresses the validation that was disabled to support PECL installs.

* PHPC-2300 and PHPC-2302: Fix configure output for bundled libbson/libmongoc versions

This was missed in 7ccb0949ba and 1c533ffa2d.

* PHPC-2225: Validate PHP_ARG_ENABLE and PHP_ARG_WITH configure options

Introduce a PHP_MONGODB_VALIDATE_ARG macro, which is called after processing a configure option.

PHP may still assign "yes" as a value during parsing, so map that to another value when necessary (e.g. selecting a crypto/TLS library).

* Add deprecation notice for --enable-system-ciphers in shared builds

* PHPC-2155: Remove prefixes for quoted shell variable references

* PHPC-1017: Allow configure options to be specified with PECL install

Introducing <configureoption> tags in package.xml means that PECL installs will now prompt for input. Non-interactive installs can still be achieved by either piping input (e.g. `yes '' | pecl install mongodb`) or explicitly specifying configure options (--configureoptions option for pecl install).

* Refer to update-submodule-sources.php in config.m4/w32 and fix macOS compatibility

* PHPC-2314: Require OpenSSL 1.0.1+ for libmongoc 1.24+

* PHPC-2315: Use PKG_CHECK_MODULES for detecting libmongoc system libs

* Remove superfluous AC_MSG_NOTICE output in CheckSSL.m4
2023-11-01 21:41:56 -04:00
Jeremy Mikola f6a8f00a4e PHPC-2274 and PHPC-2308: Endian detection for KMS sources (#1479)
* PHPC-2274: Apply libmongocrypt defs to PHP_MONGODB_LIBMONGOCRYPT_CFLAGS

This ensures PHP_MONGODB_LIBMONGOCRYPT_CFLAGS is used instead of PHP_MONGODB_BUNDLED_CFLAGS for libmongocrypt-specific checks.

A libmongoc-specific copy of Endian.m4 has been created to use when building without libmongocrypt, since the endianness check is still required by libmongoc's bundled KMS sources.

* PHPC-2308: Handle unknown and universal cases for AC_C_BIGENDIAN
2023-10-17 14:02:06 -04:00
Jeremy Mikola 4177e66bf3 PHPC-2194: Updates for autoconf 2.70+ (#1476)
* Do not call AC_PROG_CC_C99 on autoconf 2.70+

* Replace obsolete AC_TRY_COMPILE with AC_COMPILE_IFELSE

* Update pkg.m4 to pkg-config-0.29

* Update ax_check_compile_flag.m4

* Update ax_pthread.m4

* Update ax_prototype.m4 and introduce ax_prototype_accept.m4

This also moves the accept() checking to libmongoc/FindDependencies.m4, since it is specific to libmongoc.

* PHPC-2272: as_var_copy.m4 is obsolete

PHP 7.4 requires autoconf 2.68+ and AS_VAR_COPY was introduced in 2.64
2023-10-06 08:55:34 -04:00
Jeremy Mikola 1c533ffa2d PHPC-2302: Update build configs for renamed libmongoc substitutions (#1475)
Bumps libmongoc to 1.25-dev
2023-09-27 18:52:54 -04:00
Jeremy Mikola 7ccb0949ba PHPC-2300: Update build configs for renamed libbson substitutions (#1474)
Bumps libmongoc to 1.25-dev
2023-09-23 19:43:53 -04:00
Andreas Braun 50f1a80bbe PHPC-2280 Prefer OpenSSL on MacOS over Secure Transport (#1463) 2023-09-08 09:26:01 +02:00
Jeremy Mikola 73c0490847 Merge branch 'v1.16'
Bumps the libmongoc submodule to mongodb/mongo-c-driver@d933a8c996, which is the 1.25-dev commit for the corresponding patch in the 1.24.3 release for PHPC's 1.16 branch.
2023-08-15 15:35:44 -04:00
Jeremy Mikola cd1f3ee60c PHPC-2270 and PHPC-2271: Bump to libmongoc 1.24.3 and update build configuration (#1458)
* Update to libmongoc 1.24.3

* Define constants for POSIX features and extensions used by libmongoc 1.24

This removes old logic to not define _DEFAULT_SOURCE on Windows (technically MinGW or Cygwin). It's not clear whether that was ever necessary; it was introduced in ab44b0cbeb based on upstream work in mongodb/mongo-c-driver@9d2d8b157c, but libmongoc did not utilize the same logic.

In any event, these constants are now defined unconditionally for libmongoc since mongodb/mongo-c-driver@c5206511cd, so this change should restore parity between PHPC's autoconf and libmongoc's CMake configurations.

* Remove obsolete conditional defines for glibc 2.19

It's not clear what purpose this originally served. It dates back to mongodb/mongo-c-driver@50f701ce6a, but PHPC never incorporated the defines into its own CPPFLAGS.

The recent additions to PlatformFlags.m4 should be sufficient.
2023-08-15 09:16:37 -04:00
Jeremy Mikola d2a600bae6 PHPC-2262: Replace ICU dep with vendored utf8proc lib (#1447)
Bumps libmongoc to 1.25-dev. 

This introduces a --with-mongodb-utf8proc configure flag, which accepts "bundled" (default) and "system". Windows will always use bundled sources.

CheckICU.m4 and the --with-mongodb-icu configure flag have been removed.

For the libmongoc bump, this also adds support for a new MONGOC_ENABLE_SRV config constant, which is currently set based on detection in CheckResolv.m4. We can consider exposing that as a configure option down the line in PHPC-2256.
2023-07-19 10:29:43 -04:00
Jeremy Mikola c4d1951f97 PHPC-2236: Allow compression libraries to be configured at build time (#1438)
This introduces several configure options:

  --with-mongodb-snappy=[auto/yes/no]
  --with-mongodb-zlib=[auto/yes/system/bundled/no]
  --with-mongodb-zstd=[auto/yes/no]

The "auto", "yes", and "no" options behave like existing options: "auto" attempts to use a library but allows it to not be found; "yes" requires a library and errors if it's not found; "no" disables a library.

The "system" and "bundled" options for zlib function like "yes", but for using the system library or bundled zlib sources in libmongoc, respectively. Since bundled sources are always available, configuring zlib with "auto", "yes", or "bundled" should never fail.
2023-06-22 09:35:48 +02:00
Jeremy Mikola c18862139b PHPC-2133: Fix building with SRV support on FreeBSD (#1432) 2023-06-14 13:26:30 -04:00
Jeremy Mikola 6a7a2ba546 Bump to libmongoc to 1.24-dev (#1388)
* Update expected output for libmongoc 1.24-dev

See mongodb/mongo-c-driver@40a64c2ffd

* Require C99 when compiling
2022-11-30 03:06:12 -05:00
Jeremy Mikola 57f8068f32 PHPC-2152: Link libresolv when detecting res_nsearch (#1371)
This fixes a bug inadvertently introduced in b581f2a3e4.
2022-10-18 22:25:43 -04:00
Jeremy Mikola db4fe3dc8b PHPC-2049: BulkWrite and Query support comment option of any type (#1320)
* PHPC-2049: Bump libmongoc and libmongocrypt submodules

libmongoc master (1.22-dev) now depends on libmongocrypt master (1.5-dev).

libmongoc's bundled zlib library was updated to 1.2.12.

* PHPC-2049: BulkWrite and Query support comment option of any type

MongoDB 4.4+ allows a comment option of any type on most commands. Previously, find required a string type and write commands did not support comment at all. The driver does not validate the option and relies on the server to raise an error.

* Fix title and variable access in BulkWrite and Query let option tests

* Fix grammar in php_phongo_bulkwrite_delete_apply_options comment

* Undefine additional Query option macros
2022-05-20 11:11:18 -04:00
Jeremy Mikola 91a1585db1 Remove _DARWIN_C_SOURCE definition for bundled sources on macOS
Reverts a change introduced in ab44b0cbeb. This was previously in mongodb/mongo-c-driver#920 but removed before merging in mongodb/mongo-c-driver@9d2d8b157c.
2022-01-05 15:50:21 -05:00
Jeremy Mikola ab44b0cbeb PHPC-1647: Use mongoc_client_new_from_uri_with_error
This allows PHPC to defer entirely to libmongoc for cross-option URI validation

Bump libmongoc to 1.21-dev

Build changes are ported from upstream CMake changes (see: CDRIVER-4249)
2022-01-05 13:10:45 -05:00
Jeremy Mikola 968958fe46 PHPC-2019: Remove Solaris checks in m4 build scripts
libmongoc removed Solaris support in version 1.8.0 so there is no reason to retain these checks.
2022-01-05 13:10:45 -05:00
Jeremy Mikola 8a4670becd PHPC-2011: Upgrade libmongoc to 1.20.0 and libmongocrypt to 1.3.0 (#1279)
* PHPC-2011: Bump libmongocrypt to 1.3.0

* PHPC-2011: Bump libmongoc to 1.20.0

* Script to update submodule sources in config.m4 and config.w32
2021-12-06 11:15:20 -05:00
Calvin Buckley b581f2a3e4 PHPC-1706: Don't try linking against libresolv on AIX (#1172)
On AIX, the resolver functions are in libc, so trying libresolv
will cause the checks to fail. The behaviour should be instead
like AC_SEARCH_LIBS.

This hardcodes a check not to use libresolv on AIX. Better than
nothing, but it may not compensate for other systems without a
libresolv.
2020-11-24 10:47:31 +01:00
Andreas Braun 9e9acf427c Fix wrong assignment of MONGOC_HAVE_SS_FAMILY (#1169) 2020-10-22 14:34:55 +02:00
Jeremy Mikola d97a66a545 PHPC-1313: Support Zstandard compression 2020-05-13 10:56:14 -04:00
Andreas Braun 9ac6f237b0 Update to latest libmongoc version 2020-02-28 08:20:25 +01:00
Andreas Braun 7cea21a25a PHPC-1496: Add support for compiling with libmongocrypt 2020-01-08 12:41:41 +01:00
Andreas Braun 6abb38feb7 Update to latest libmongoc version 2019-12-19 15:38:04 +01:00
Andreas Braun ea7489bf72 PHPC-1369: Update libmongoc to latest 1.15-dev 2019-08-12 07:49:29 +02:00
Jeremy Mikola d145409286 PHPC-1364: Upgrade libmongoc to 1.14.0
Per src/libmongoc/doc/installing.rst, the VERSION_CURRENT and VERSION_RELEASED files must now be generated. This requires Python and the GitPython pip module to run src/libmongoc/build/calc_release_version.py. A new libmongoc-version-current Makefile target has been added.
2019-05-01 13:42:38 -04:00
Peter Kokot 644a2b355c Fix AC_CHECK_FUNC macro call syntax for rand_r()
The AC_CHECK_FUNC macro has only the following form:
AC_CHECK_FUNC(function, [action-if-found], [action-if-not-found])
In most cases adding more arguments to macro call don't cause errors,
but it also doesn't have any functionality either.
2018-10-02 13:54:32 +01:00
Peter Kokot 394eb79c3d Replace obsolete AC_TRY_LINK with AC_LINK_IFELSE
The AC_TRY_LINK macro has been made obsolete in Autoconf 2.50 in 2001.
It should be replaced with AC_LINK_IFELSE instead.

Systems should by now well support this, since PHP 5.3 required Autoconf
2.13+ (released in 1999) or newer, PHP 5.4 required Autoconf 2.59+
(released in 2003), and since PHP 7.2, Autoconf 2.64+ (released in 2008)
is required and for PHP 7.2 phpize the Autoconf 2.59+ is required.

Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/AC_005fACT_005fIFELSE-vs-AC_005fTRY_005fACT.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
2018-07-24 11:11:47 +01:00
Peter Kokot a3d806c155 Remove unused autotools macro AC_COMPILE_CHECK_SIZEOF
The AC_COMPILE_CHECK_SIZEOF is from the GNU Autoconf Archive and was
renamed to AX_COMPILE_CHECK_SIZEOF. However this macro is not used in
current MongoDB PHP extension nor in the mongo-c-driver dependency
anymore.
2018-07-24 11:09:06 +01:00
Peter Kokot 0d8d7be941 Replace AC_HELP_STRING with AS_HELP_STRING
The AC_HELP_STRING has been made obsolete since Autoconf 2.58 somewhere
in 2003. The new AS_HELP_STRING macro has been since recommended to be
used and should be today supported on most systems out there. The phpize
script for PHP 7.2+ requires Autoconf 2.59 and PHP requires 2.64.

This patch has been made with the help of the autoupdate script.

Autoconf changelog:
- http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.3
2018-07-20 09:02:50 +02:00
Derick Rethans da240406d3 PHPC-1241: OpenSSL 1.1 not found if pkg-config is not available 2018-07-17 11:11:11 +01:00
Chris Wright d2b2bd5037 Fix build against OpenSSL 1.1 without pkg-config 2018-07-17 11:10:01 +01:00
Derick Rethans ab2f578ca3 PHPC-1221: Accept "yes" and no value for non-binary PHP_ARG_WITH() options 2018-06-28 16:38:45 +01:00
Derick Rethans ab1f151e04 PHPC-1193: Bump libmongoc to 1.11 (and add ICU check) 2018-06-07 16:40:22 +01:00
Jeremy Mikola b9f1a1fcf8 PHPC-1198: Use PHP_MONGODB_BUNDLED_CFLAGS in bundled m4 scripts
This was missed in ce45de41fa.
2018-05-30 12:22:47 -04:00
Jeremy Mikola 73489c5463 PHPC-1174: Remove traces of bson-stdint.h
The output path for this file was left incorrect in the previous PR for PHPC-1174, but the file isn't actually even used anymore per mongodb/mongo-c-driver@abc882dec9 (CDRIVER-2473).
2018-05-24 15:57:54 -04:00
Jeremy Mikola 66bdd83c98 PHPC-1185: Restore sasl_client_done check
The check for sasl_client_done was inadvertently removed by aab92e1d3e. This ensures that we check for the symbol regardless of whether SASL was found with pgk-config or PHP_CHECK_LIBRARY.
2018-05-22 16:25:24 -04:00
Jeremy Mikola dee8c6d25a PHPC-1185: Revert support for building with GSSAPI
libmongoc does not actually support GSSAPI (CDRIVER-2170), so we should not allow building with it. This also reverts preference for the GSS framework on macOS (PHPC-1142).
2018-05-22 16:25:24 -04:00
Jeremy Mikola 7c0ccd3e20 PHPC-1174: Upgrade bundled libmongoc to 1.10.0 2018-05-21 12:41:35 -04:00
Jeremy Mikola ce45de41fa PHPC-1174: Bump libbson and libmongoc to 1.10.0-dev
This consolidates CFLAGS for bundled libraries, adds a new "common/" build path, and defines new constants as needed.
2018-05-18 11:45:35 -04:00
Jeremy Mikola 4d9dd87c2c Remove "build/" from autotools scripts path
GitHub's file finder filters out "build/" directories, among others, which can make it difficult to quickly access these files. Also, the "build/" directory doesn't provide much value here, since it only contains "autotools/".
2018-05-16 11:03:46 -04:00