diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 1402bc58..d25f1f12 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -322,16 +322,6 @@ class Extension ->execWithEnv('make -j' . $this->builder->concurrency) ->execWithEnv('make install'); - // copy shared library - $extensionDirFile = (getenv('EXTENSION_DIR') ?: $this->source_dir . '/modules') . '/' . $this->getName() . '.so'; - $sourceDirFile = $this->source_dir . '/modules/' . $this->getName() . '.so'; - if (file_exists($extensionDirFile)) { - copy($extensionDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so'); - } elseif (file_exists($sourceDirFile)) { - copy($sourceDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so'); - } else { - throw new RuntimeException('extension ' . $this->getName() . ' built successfully, but into an unexpected location.'); - } // check shared extension with php-cli if (file_exists(BUILD_BIN_PATH . '/php')) { $this->runSharedExtensionCheckUnix(); diff --git a/src/SPC/builder/extension/pdo_sqlsrv.php b/src/SPC/builder/extension/pdo_sqlsrv.php new file mode 100644 index 00000000..bc1aacf5 --- /dev/null +++ b/src/SPC/builder/extension/pdo_sqlsrv.php @@ -0,0 +1,40 @@ +builder))->config([$this->getName()]); + $env = [ + 'CFLAGS' => $config['cflags'], + 'CXXFLAGS' => $config['cflags'], + 'LDFLAGS' => $config['ldflags'], + 'LIBS' => $config['libs'], + 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, + ]; + // prepare configure args + shell()->cd($this->source_dir) + ->setEnv($env) + ->execWithEnv(BUILD_BIN_PATH . '/phpize') + ->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static') + ->execWithEnv('make clean') + ->execWithEnv('make -j' . $this->builder->concurrency) + ->execWithEnv('make install'); + + // check shared extension with php-cli + if (file_exists(BUILD_BIN_PATH . '/php')) { + $this->runSharedExtensionCheckUnix(); + } + } +}