diff --git a/README.md b/README.md index c6e9bc3..e977c3b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project comprises a collection of scripts to build a modern GNUstep toolcha ## Libraries -The toolchain currently consists of the following libraries: +The toolchain consists of the following libraries: - [GNUstep Base Library](https://github.com/gnustep/libs-base) (Foundation) - [GNUstep CoreBase Library](https://github.com/gnustep/libs-corebase) (CoreFoundation) @@ -18,6 +18,7 @@ The toolchain currently consists of the following libraries: - [libiconv](https://github.com/kiyolee/libiconv-win-build) - [libxml2](https://github.com/GNOME/libxml2) - [libxslt](https://github.com/GNOME/libxslt) +- [libcurl](https://github.com/curl/curl) - [ICU](https://docs.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-) (using system-provided DLL on Windows 10 version 1903 or later) diff --git a/phases/19-libcurl.bat b/phases/19-libcurl.bat new file mode 100644 index 0000000..368dd1d --- /dev/null +++ b/phases/19-libcurl.bat @@ -0,0 +1,46 @@ +@echo off +setlocal + +set PROJECT=libcurl +set GITHUB_REPO=curl/curl + +:: get the latest release tag from GitHub +cd %~dp0 +for /f "usebackq delims=" %%i in (`call %BASH% '../scripts/get-latest-github-release-tag.sh %GITHUB_REPO% curl-'`) do ( + set TAG=%%i +) + +:: load environment and prepare project +call "%~dp0\..\scripts\common.bat" prepare_project || exit /b 1 + +cd "%SRCROOT%\%PROJECT%" || exit \b 1 + +:: generate build config +call "buildconf.bat" || exit \b 1 + +set BUILD_DIR="%SRCROOT%\%PROJECT%\build-%ARCH%-%BUILD_TYPE%" +if exist "%BUILD_DIR%" (rmdir /S /Q "%BUILD_DIR%" || exit /b 1) +mkdir "%BUILD_DIR%" || exit /b 1 +cd "%BUILD_DIR%" || exit /b 1 + +echo. +echo ### Running cmake +cmake .. %CMAKE_OPTIONS% ^ + -D BUILD_SHARED_LIBS=YES ^ + -D CURL_USE_SCHANNEL=YES ^ + -D BUILD_CURL_EXE=NO ^ + || exit /b 1 + +echo. +echo ### Building +ninja || exit /b 1 + +echo. +echo ### Installing +ninja install || exit /b 1 + +:: install PDB file +xcopy /Y /F lib\libcurl*.pdb "%INSTALL_PREFIX%\bin\" || exit /b 1 + +:: rename libcurl-d_imp.lib to curl.lib to allow linking using -lcurl +move /y "%INSTALL_PREFIX%\lib\libcurl*.lib" "%INSTALL_PREFIX%\lib\curl.lib" || exit /b 1 diff --git a/scripts/common.bat b/scripts/common.bat index d5102d4..2166dd8 100644 --- a/scripts/common.bat +++ b/scripts/common.bat @@ -49,7 +49,7 @@ exit /b %errorlevel% echo. :: check out tag/branch if any if not "%TAG%" == "" ( - echo ### Checking out %TAG% + echo ### Checking out "%TAG%" git fetch --tags || exit /b 1 git checkout -q %TAG% || exit /b 1 )