Merge branch 'dev' of https://github.com/Microsoft/msphpsql into dev
This commit is contained in:
commit
eafe64842c
|
@ -56,7 +56,7 @@ WORKDIR $PHPSQLDIR/source/
|
||||||
RUN chmod +x ./packagize.sh
|
RUN chmod +x ./packagize.sh
|
||||||
RUN /bin/bash -c "./packagize.sh"
|
RUN /bin/bash -c "./packagize.sh"
|
||||||
|
|
||||||
RUN echo "extension = pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
RUN echo "extension = pdo_sqlsrv.so" >> /etc/php/7.0/cli/conf.d/20-pdo_sqlsrv.ini
|
||||||
RUN echo "extension = sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
RUN echo "extension = sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
||||||
|
|
||||||
WORKDIR $PHPSQLDIR/source/sqlsrv
|
WORKDIR $PHPSQLDIR/source/sqlsrv
|
||||||
|
|
|
@ -279,9 +279,12 @@ Note that [Microsoft ODBC Driver 17][odbc17] is required for Ubuntu 17 and Debia
|
||||||
|
|
||||||
*Note: You can run `sudo pecl search sqlsrv` to search for the latest releases and `sudo pecl install sqlsrv-[version]` to install a specific version. PECL installs the stable version when version is not specified. Drivers are Mac-compatible starting from `4.1.7preview` release.
|
*Note: You can run `sudo pecl search sqlsrv` to search for the latest releases and `sudo pecl install sqlsrv-[version]` to install a specific version. PECL installs the stable version when version is not specified. Drivers are Mac-compatible starting from `4.1.7preview` release.
|
||||||
|
|
||||||
On Ubuntu, Debian, and SUSE systems only, run:
|
On Linux systems, run:
|
||||||
|
|
||||||
sudo pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system
|
sudo su
|
||||||
|
echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini
|
||||||
|
echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini
|
||||||
|
exit
|
||||||
|
|
||||||
On macOS, run:
|
On macOS, run:
|
||||||
|
|
||||||
|
|
|
@ -1,74 +1,78 @@
|
||||||
PHP_ARG_WITH(pdo_sqlsrv, for pdo_sqlsrv support,
|
PHP_ARG_WITH(pdo_sqlsrv, for pdo_sqlsrv support,
|
||||||
[ --with-pdo_sqlsrv Include pdo_sqlsrv support])
|
[ --with-pdo_sqlsrv Include pdo_sqlsrv support])
|
||||||
|
|
||||||
if test "$PHP_PDO_SQLSRV" != "no"; then
|
if test "$PHP_PDO_SQLSRV" != "no"; then
|
||||||
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
|
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
|
||||||
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
|
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ifdef([PHP_CHECK_PDO_INCLUDES],
|
ifdef([PHP_CHECK_PDO_INCLUDES],
|
||||||
[
|
[
|
||||||
PHP_CHECK_PDO_INCLUDES
|
PHP_CHECK_PDO_INCLUDES
|
||||||
],[
|
],[
|
||||||
AC_MSG_CHECKING([for PDO includes])
|
AC_MSG_CHECKING([for PDO includes])
|
||||||
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
|
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
|
||||||
pdo_cv_inc_path=$abs_srcdir/ext
|
pdo_cv_inc_path=$abs_srcdir/ext
|
||||||
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
|
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
|
||||||
pdo_cv_inc_path=$abs_srcdir/ext
|
pdo_cv_inc_path=$abs_srcdir/ext
|
||||||
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
|
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
|
||||||
pdo_cv_inc_path=$phpincludedir/ext
|
pdo_cv_inc_path=$phpincludedir/ext
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
|
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($pdo_cv_inc_path)
|
AC_MSG_RESULT($pdo_cv_inc_path)
|
||||||
])
|
])
|
||||||
|
|
||||||
pdo_sqlsrv_src_class="\
|
pdo_sqlsrv_src_class="\
|
||||||
pdo_dbh.cpp \
|
pdo_dbh.cpp \
|
||||||
pdo_parser.cpp \
|
pdo_parser.cpp \
|
||||||
pdo_util.cpp \
|
pdo_util.cpp \
|
||||||
pdo_init.cpp \
|
pdo_init.cpp \
|
||||||
pdo_stmt.cpp \
|
pdo_stmt.cpp \
|
||||||
"
|
"
|
||||||
|
|
||||||
shared_src_class="\
|
shared_src_class="\
|
||||||
shared/core_conn.cpp \
|
shared/core_conn.cpp \
|
||||||
shared/core_results.cpp \
|
shared/core_results.cpp \
|
||||||
shared/core_stream.cpp \
|
shared/core_stream.cpp \
|
||||||
shared/core_init.cpp \
|
shared/core_init.cpp \
|
||||||
shared/core_stmt.cpp \
|
shared/core_stmt.cpp \
|
||||||
shared/core_util.cpp \
|
shared/core_util.cpp \
|
||||||
shared/FormattedPrint.cpp \
|
shared/FormattedPrint.cpp \
|
||||||
shared/localizationimpl.cpp \
|
shared/localizationimpl.cpp \
|
||||||
shared/StringFunctions.cpp \
|
shared/StringFunctions.cpp \
|
||||||
"
|
"
|
||||||
AC_MSG_CHECKING([for PDO_SQLSRV headers])
|
AC_MSG_CHECKING([for PDO_SQLSRV headers])
|
||||||
if test -f $srcdir/ext/pdo_sqlsrv/shared/core_sqlsrv.h; then
|
if test -f $srcdir/ext/pdo_sqlsrv/shared/core_sqlsrv.h; then
|
||||||
pdo_sqlsrv_inc_path=$srcdir/ext/pdo_sqlsrv/shared/
|
pdo_sqlsrv_inc_path=$srcdir/ext/pdo_sqlsrv/shared/
|
||||||
elif test -f $srcdir/shared/core_sqlsrv.h; then
|
elif test -f $srcdir/shared/core_sqlsrv.h; then
|
||||||
pdo_sqlsrv_inc_path=$srcdir/shared/
|
pdo_sqlsrv_inc_path=$srcdir/shared/
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR([Cannot find PDO_SQLSRV headers])
|
AC_MSG_ERROR([Cannot find PDO_SQLSRV headers])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($pdo_sqlsrv_inc_path)
|
AC_MSG_RESULT($pdo_sqlsrv_inc_path)
|
||||||
|
|
||||||
HOST_OS_ARCH=`uname`
|
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||||
if test "${HOST_OS_ARCH}" = "Darwin"; then
|
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -O2"
|
||||||
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
|
CXXFLAGS="$CXXFLAGS -fstack-protector"
|
||||||
fi
|
|
||||||
|
HOST_OS_ARCH=`uname`
|
||||||
CXXFLAGS="$CXXFLAGS -std=c++11"
|
if test "${HOST_OS_ARCH}" = "Darwin"; then
|
||||||
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -O2"
|
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
|
||||||
CXXFLAGS="$CXXFLAGS -fstack-protector"
|
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
|
||||||
PHP_REQUIRE_CXX()
|
else
|
||||||
PHP_ADD_LIBRARY(stdc++, 1, PDO_SQLSRV_SHARED_LIBADD)
|
PDO_SQLSRV_SHARED_LIBADD="$PDO_SQLSRV_SHARED_LIBADD -Wl,-z,now"
|
||||||
PHP_ADD_LIBRARY(odbc, 1, PDO_SQLSRV_SHARED_LIBADD)
|
fi
|
||||||
PHP_ADD_LIBRARY(odbcinst, 1, PDO_SQLSRV_SHARED_LIBADD)
|
|
||||||
AC_DEFINE(HAVE_PDO_SQLSRV, 1, [ ])
|
PHP_REQUIRE_CXX()
|
||||||
PHP_ADD_INCLUDE([$pdo_sqlsrv_inc_path])
|
PHP_ADD_LIBRARY(stdc++, 1, PDO_SQLSRV_SHARED_LIBADD)
|
||||||
PHP_NEW_EXTENSION(pdo_sqlsrv, $pdo_sqlsrv_src_class $shared_src_class, $ext_shared,,-I$pdo_cv_inc_path -std=c++11)
|
PHP_ADD_LIBRARY(odbc, 1, PDO_SQLSRV_SHARED_LIBADD)
|
||||||
PHP_SUBST(PDO_SQLSRV_SHARED_LIBADD)
|
PHP_ADD_LIBRARY(odbcinst, 1, PDO_SQLSRV_SHARED_LIBADD)
|
||||||
PHP_ADD_EXTENSION_DEP(pdo_sqlsrv, pdo)
|
AC_DEFINE(HAVE_PDO_SQLSRV, 1, [ ])
|
||||||
PHP_ADD_BUILD_DIR([$ext_builddir/shared], 1)
|
PHP_ADD_INCLUDE([$pdo_sqlsrv_inc_path])
|
||||||
fi
|
PHP_NEW_EXTENSION(pdo_sqlsrv, $pdo_sqlsrv_src_class $shared_src_class, $ext_shared,,-I$pdo_cv_inc_path -std=c++11)
|
||||||
|
PHP_SUBST(PDO_SQLSRV_SHARED_LIBADD)
|
||||||
|
PHP_ADD_EXTENSION_DEP(pdo_sqlsrv, pdo)
|
||||||
|
PHP_ADD_BUILD_DIR([$ext_builddir/shared], 1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,18 @@ if test "$PHP_SQLSRV" != "no"; then
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT($sqlsrv_inc_path)
|
AC_MSG_RESULT($sqlsrv_inc_path)
|
||||||
|
|
||||||
HOST_OS_ARCH=`uname`
|
|
||||||
if test "${HOST_OS_ARCH}" = "Darwin"; then
|
|
||||||
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
|
|
||||||
fi
|
|
||||||
|
|
||||||
CXXFLAGS="$CXXFLAGS -std=c++11"
|
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||||
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -O2"
|
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -O2"
|
||||||
CXXFLAGS="$CXXFLAGS -fstack-protector"
|
CXXFLAGS="$CXXFLAGS -fstack-protector"
|
||||||
|
|
||||||
|
HOST_OS_ARCH=`uname`
|
||||||
|
if test "${HOST_OS_ARCH}" = "Darwin"; then
|
||||||
|
SQLSRV_SHARED_LIBADD="$SQLSRV_SHARED_LIBADD -Wl,-bind_at_load"
|
||||||
|
MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`
|
||||||
|
else
|
||||||
|
SQLSRV_SHARED_LIBADD="$SQLSRV_SHARED_LIBADD -Wl,-z,now"
|
||||||
|
fi
|
||||||
|
|
||||||
PHP_REQUIRE_CXX()
|
PHP_REQUIRE_CXX()
|
||||||
PHP_ADD_LIBRARY(stdc++, 1, SQLSRV_SHARED_LIBADD)
|
PHP_ADD_LIBRARY(stdc++, 1, SQLSRV_SHARED_LIBADD)
|
||||||
PHP_ADD_LIBRARY(odbc, 1, SQLSRV_SHARED_LIBADD)
|
PHP_ADD_LIBRARY(odbc, 1, SQLSRV_SHARED_LIBADD)
|
||||||
|
|
Loading…
Reference in a new issue