diff --git a/src/scripts/extensions/cubrid.sh b/src/scripts/extensions/cubrid.sh index 46e6030d..82aa0be4 100644 --- a/src/scripts/extensions/cubrid.sh +++ b/src/scripts/extensions/cubrid.sh @@ -31,7 +31,7 @@ add_cubrid_helper() { set_cubrid_repo set_cubrid_branch patch_phpize - read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration" + read -r "${ext}_CONFIGURE_PREFIX_OPTS" <<< "SED=sed CMAKE_POLICY_VERSION_MINIMUM=3.5 CFLAGS=-std=gnu17" read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)" add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension restore_phpize diff --git a/src/scripts/extensions/patches/pdo_cubrid.sh b/src/scripts/extensions/patches/pdo_cubrid.sh new file mode 100644 index 00000000..308b88c6 --- /dev/null +++ b/src/scripts/extensions/patches/pdo_cubrid.sh @@ -0,0 +1,11 @@ +patch_pdo_cubrid() { + if [[ ${version:?} =~ ^7\.[0-2]$ ]] && [ -f cubrid_driver7.c ]; then + # Match the PHP 7 PDO callbacks and store zvals with the PHP 7 hash API. + sed -i.bak \ + -e 's/const char \*sql, long sql_len/const char *sql, size_t sql_len/g' \ + -e 's/static long cubrid_handle_doer/static zend_long cubrid_handle_doer/' \ + -e 's/zend_hash_index_update_ptr(HASH_OF(arg), index, (void \*)\&tmp_zval)/zend_hash_index_update(HASH_OF(arg), index, \&tmp_zval)/' \ + -e 's/(cubrid_retval = zend_hash_update(HASH_OF(arg), key, (void \*) \&tmp_zval)) == FAILURE/zend_hash_str_update(HASH_OF(arg), key, strlen(key), \&tmp_zval) == NULL/' \ + cubrid_driver7.c + fi +}