aboutsummaryrefslogtreecommitdiffstats
path: root/projects
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-12-07 09:12:34 -0800
committerElliott Hughes <enh@google.com>2021-12-07 09:32:39 -0800
commitf344baa187700ef5a99c804748a19f4981c033b6 (patch)
tree4ea7d66c596691acc81afb7ae39bf880fc63424c /projects
parenta9bd6e759e95ef0b279ffb13c601b19f113c152c (diff)
downloadexternal_curl-f344baa187700ef5a99c804748a19f4981c033b6.tar.gz
external_curl-f344baa187700ef5a99c804748a19f4981c033b6.tar.bz2
external_curl-f344baa187700ef5a99c804748a19f4981c033b6.zip
Upgrade curl to curl-7_80_0
Test: make Change-Id: I2f2b36867c508812b89f1c8662960150f6b050d4
Diffstat (limited to 'projects')
-rw-r--r--projects/Windows/VC10/src/curl.vcxproj1
-rw-r--r--projects/Windows/VC11/src/curl.vcxproj1
-rw-r--r--projects/Windows/VC12/src/curl.vcxproj1
-rw-r--r--projects/Windows/VC14/src/curl.vcxproj1
-rw-r--r--projects/Windows/VC15/src/curl.vcxproj1
-rw-r--r--projects/Windows/VC6/src/curl.dsp4
-rw-r--r--projects/Windows/VC7.1/src/curl.vcproj3
-rw-r--r--projects/Windows/VC7/src/curl.vcproj3
-rw-r--r--projects/Windows/VC8/src/curl.vcproj4
-rw-r--r--projects/Windows/VC9/src/curl.vcproj4
-rw-r--r--projects/build-wolfssl.bat784
-rw-r--r--projects/checksrc.bat446
-rw-r--r--projects/generate.bat956
13 files changed, 1116 insertions, 1093 deletions
diff --git a/projects/Windows/VC10/src/curl.vcxproj b/projects/Windows/VC10/src/curl.vcxproj
index 0eb7fe66..8c46df4e 100644
--- a/projects/Windows/VC10/src/curl.vcxproj
+++ b/projects/Windows/VC10/src/curl.vcxproj
@@ -2657,6 +2657,7 @@
<ClCompile Include="..\..\..\..\src\tool_homedir.c" />
<ClCompile Include="..\..\..\..\src\tool_hugehelp.c" />
<ClCompile Include="..\..\..\..\src\tool_libinfo.c" />
+ <ClCompile Include="..\..\..\..\src\tool_listhelp.c" />
<ClCompile Include="..\..\..\..\src\tool_main.c" />
<ClCompile Include="..\..\..\..\src\tool_msgs.c" />
<ClCompile Include="..\..\..\..\src\tool_operate.c" />
diff --git a/projects/Windows/VC11/src/curl.vcxproj b/projects/Windows/VC11/src/curl.vcxproj
index 832cc998..456abdde 100644
--- a/projects/Windows/VC11/src/curl.vcxproj
+++ b/projects/Windows/VC11/src/curl.vcxproj
@@ -2713,6 +2713,7 @@
<ClCompile Include="..\..\..\..\src\tool_homedir.c" />
<ClCompile Include="..\..\..\..\src\tool_hugehelp.c" />
<ClCompile Include="..\..\..\..\src\tool_libinfo.c" />
+ <ClCompile Include="..\..\..\..\src\tool_listhelp.c" />
<ClCompile Include="..\..\..\..\src\tool_main.c" />
<ClCompile Include="..\..\..\..\src\tool_msgs.c" />
<ClCompile Include="..\..\..\..\src\tool_operate.c" />
diff --git a/projects/Windows/VC12/src/curl.vcxproj b/projects/Windows/VC12/src/curl.vcxproj
index 7f55bf2b..e0455a48 100644
--- a/projects/Windows/VC12/src/curl.vcxproj
+++ b/projects/Windows/VC12/src/curl.vcxproj
@@ -2713,6 +2713,7 @@
<ClCompile Include="..\..\..\..\src\tool_homedir.c" />
<ClCompile Include="..\..\..\..\src\tool_hugehelp.c" />
<ClCompile Include="..\..\..\..\src\tool_libinfo.c" />
+ <ClCompile Include="..\..\..\..\src\tool_listhelp.c" />
<ClCompile Include="..\..\..\..\src\tool_main.c" />
<ClCompile Include="..\..\..\..\src\tool_msgs.c" />
<ClCompile Include="..\..\..\..\src\tool_operate.c" />
diff --git a/projects/Windows/VC14/src/curl.vcxproj b/projects/Windows/VC14/src/curl.vcxproj
index 33c74573..ee17dee9 100644
--- a/projects/Windows/VC14/src/curl.vcxproj
+++ b/projects/Windows/VC14/src/curl.vcxproj
@@ -2713,6 +2713,7 @@
<ClCompile Include="..\..\..\..\src\tool_homedir.c" />
<ClCompile Include="..\..\..\..\src\tool_hugehelp.c" />
<ClCompile Include="..\..\..\..\src\tool_libinfo.c" />
+ <ClCompile Include="..\..\..\..\src\tool_listhelp.c" />
<ClCompile Include="..\..\..\..\src\tool_main.c" />
<ClCompile Include="..\..\..\..\src\tool_msgs.c" />
<ClCompile Include="..\..\..\..\src\tool_operate.c" />
diff --git a/projects/Windows/VC15/src/curl.vcxproj b/projects/Windows/VC15/src/curl.vcxproj
index 220c71a6..28d3b0fb 100644
--- a/projects/Windows/VC15/src/curl.vcxproj
+++ b/projects/Windows/VC15/src/curl.vcxproj
@@ -2685,6 +2685,7 @@
<ClCompile Include="..\..\..\..\src\tool_homedir.c" />
<ClCompile Include="..\..\..\..\src\tool_hugehelp.c" />
<ClCompile Include="..\..\..\..\src\tool_libinfo.c" />
+ <ClCompile Include="..\..\..\..\src\tool_listhelp.c" />
<ClCompile Include="..\..\..\..\src\tool_main.c" />
<ClCompile Include="..\..\..\..\src\tool_msgs.c" />
<ClCompile Include="..\..\..\..\src\tool_operate.c" />
diff --git a/projects/Windows/VC6/src/curl.dsp b/projects/Windows/VC6/src/curl.dsp
index 0793834b..b4c3002c 100644
--- a/projects/Windows/VC6/src/curl.dsp
+++ b/projects/Windows/VC6/src/curl.dsp
@@ -799,6 +799,10 @@ SOURCE=..\..\..\..\src\tool_libinfo.c
# End Source File
# Begin Source File
+SOURCE=..\..\..\..\src\tool_listhelp.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\..\src\tool_main.c
# End Source File
# Begin Source File
diff --git a/projects/Windows/VC7.1/src/curl.vcproj b/projects/Windows/VC7.1/src/curl.vcproj
index ecb83dc7..67adf588 100644
--- a/projects/Windows/VC7.1/src/curl.vcproj
+++ b/projects/Windows/VC7.1/src/curl.vcproj
@@ -1452,6 +1452,9 @@
RelativePath="..\..\..\..\src\tool_libinfo.c">
</File>
<File
+ RelativePath="..\..\..\..\src\tool_listhelp.c">
+ </File>
+ <File
RelativePath="..\..\..\..\src\tool_main.c">
</File>
<File
diff --git a/projects/Windows/VC7/src/curl.vcproj b/projects/Windows/VC7/src/curl.vcproj
index 0390ef84..5d002f41 100644
--- a/projects/Windows/VC7/src/curl.vcproj
+++ b/projects/Windows/VC7/src/curl.vcproj
@@ -1306,6 +1306,9 @@
RelativePath="..\..\..\..\src\tool_libinfo.c">
</File>
<File
+ RelativePath="..\..\..\..\src\tool_listhelp.c">
+ </File>
+ <File
RelativePath="..\..\..\..\src\tool_main.c">
</File>
<File
diff --git a/projects/Windows/VC8/src/curl.vcproj b/projects/Windows/VC8/src/curl.vcproj
index 9ae8b22c..477179b4 100644
--- a/projects/Windows/VC8/src/curl.vcproj
+++ b/projects/Windows/VC8/src/curl.vcproj
@@ -4201,6 +4201,10 @@
>
</File>
<File
+ RelativePath="..\..\..\..\src\tool_listhelp.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\..\src\tool_main.c"
>
</File>
diff --git a/projects/Windows/VC9/src/curl.vcproj b/projects/Windows/VC9/src/curl.vcproj
index 29402385..fe388fdc 100644
--- a/projects/Windows/VC9/src/curl.vcproj
+++ b/projects/Windows/VC9/src/curl.vcproj
@@ -4058,6 +4058,10 @@
>
</File>
<File
+ RelativePath="..\..\..\..\src\tool_listhelp.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\..\src\tool_main.c"
>
</File>
diff --git a/projects/build-wolfssl.bat b/projects/build-wolfssl.bat
index 8ee61e67..fcd9ba1a 100644
--- a/projects/build-wolfssl.bat
+++ b/projects/build-wolfssl.bat
@@ -1,392 +1,392 @@
-@echo off
-rem ***************************************************************************
-rem * _ _ ____ _
-rem * Project ___| | | | _ \| |
-rem * / __| | | | |_) | |
-rem * | (__| |_| | _ <| |___
-rem * \___|\___/|_| \_\_____|
-rem *
-rem * Copyright (C) 2012 - 2020, Steve Holme, <steve_holme@hotmail.com>.
-rem * Copyright (C) 2015, Jay Satiro, <raysatiro@yahoo.com>.
-rem *
-rem * This software is licensed as described in the file COPYING, which
-rem * you should have received as part of this distribution. The terms
-rem * are also available at https://curl.se/docs/copyright.html.
-rem *
-rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
-rem * copies of the Software, and permit persons to whom the Software is
-rem * furnished to do so, under the terms of the COPYING file.
-rem *
-rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
-rem * KIND, either express or implied.
-rem *
-rem ***************************************************************************
-
-:begin
- rem Check we are running on a Windows NT derived OS
- if not "%OS%" == "Windows_NT" goto nodos
-
- rem Set our variables
- setlocal
- set SUCCESSFUL_BUILDS=
- set VC_VER=
- set BUILD_PLATFORM=
-
- rem Ensure we have the required arguments
- if /i "%~1" == "" goto syntax
-
- rem Calculate the program files directory
- if defined PROGRAMFILES (
- set "PF=%PROGRAMFILES%"
- set OS_PLATFORM=x86
- )
- if defined PROGRAMFILES(x86) (
- set "PF=%PROGRAMFILES(x86)%"
- set OS_PLATFORM=x64
- )
-
-:parseArgs
- if "%~1" == "" goto prerequisites
-
- if /i "%~1" == "vc10" (
- set VC_VER=10.0
- set VC_DESC=VC10
- set VC_TOOLSET=v100
- set "VC_PATH=Microsoft Visual Studio 10.0\VC"
- ) else if /i "%~1" == "vc11" (
- set VC_VER=11.0
- set VC_DESC=VC11
- set VC_TOOLSET=v110
- set "VC_PATH=Microsoft Visual Studio 11.0\VC"
- ) else if /i "%~1" == "vc12" (
- set VC_VER=12.0
- set VC_DESC=VC12
- set VC_TOOLSET=v120
- set "VC_PATH=Microsoft Visual Studio 12.0\VC"
- ) else if /i "%~1" == "vc14" (
- set VC_VER=14.0
- set VC_DESC=VC14
- set VC_TOOLSET=v140
- set "VC_PATH=Microsoft Visual Studio 14.0\VC"
- ) else if /i "%~1" == "vc14.1" (
- set VC_VER=14.1
- set VC_DESC=VC14.1
- set VC_TOOLSET=v141
-
- rem Determine the VC14.1 path based on the installed edition in descending
- rem order (Enterprise, then Professional and finally Community)
- if exist "%PF%\Microsoft Visual Studio\2017\Enterprise\VC" (
- set "VC_PATH=Microsoft Visual Studio\2017\Enterprise\VC"
- ) else if exist "%PF%\Microsoft Visual Studio\2017\Professional\VC" (
- set "VC_PATH=Microsoft Visual Studio\2017\Professional\VC"
- ) else (
- set "VC_PATH=Microsoft Visual Studio\2017\Community\VC"
- )
- ) else if /i "%~1" == "vc14.2" (
- set VC_VER=14.2
- set VC_DESC=VC14.2
- set VC_TOOLSET=v142
-
- rem Determine the VC14.2 path based on the installed edition in descending
- rem order (Enterprise, then Professional and finally Community)
- if exist "%PF%\Microsoft Visual Studio\2019\Enterprise\VC" (
- set "VC_PATH=Microsoft Visual Studio\2019\Enterprise\VC"
- ) else if exist "%PF%\Microsoft Visual Studio\2019\Professional\VC" (
- set "VC_PATH=Microsoft Visual Studio\2019\Professional\VC"
- ) else (
- set "VC_PATH=Microsoft Visual Studio\2019\Community\VC"
- )
- ) else if /i "%~1" == "x86" (
- set BUILD_PLATFORM=x86
- ) else if /i "%~1" == "x64" (
- set BUILD_PLATFORM=x64
- ) else if /i "%~1" == "debug" (
- set BUILD_CONFIG=debug
- ) else if /i "%~1" == "release" (
- set BUILD_CONFIG=release
- ) else if /i "%~1" == "-?" (
- goto syntax
- ) else if /i "%~1" == "-h" (
- goto syntax
- ) else if /i "%~1" == "-help" (
- goto syntax
- ) else (
- if not defined START_DIR (
- set START_DIR=%~1
- ) else (
- goto unknown
- )
- )
-
- shift & goto parseArgs
-
-:prerequisites
- rem Compiler is a required parameter
- if not defined VC_VER goto syntax
-
- rem Default the start directory if one isn't specified
- if not defined START_DIR set START_DIR=..\..\wolfssl
-
- rem Check we have a program files directory
- if not defined PF goto nopf
-
- rem Check we have Visual Studio installed
- if not exist "%PF%\%VC_PATH%" goto novc
-
- rem Check the start directory exists
- if not exist "%START_DIR%" goto nowolfssl
-
-:configure
- if "%BUILD_PLATFORM%" == "" set BUILD_PLATFORM=%OS_PLATFORM%
-
- if "%BUILD_PLATFORM%" == "x86" (
- set VCVARS_PLATFORM=x86
- ) else if "%BUILD_PLATFORM%" == "x64" (
- if "%VC_VER%" == "10.0" set VCVARS_PLATFORM=%BUILD_PLATFORM%
- if "%VC_VER%" == "11.0" set VCVARS_PLATFORM=amd64
- if "%VC_VER%" == "12.0" set VCVARS_PLATFORM=amd64
- if "%VC_VER%" == "14.0" set VCVARS_PLATFORM=amd64
- if "%VC_VER%" == "14.1" set VCVARS_PLATFORM=amd64
- if "%VC_VER%" == "14.2" set VCVARS_PLATFORM=amd64
- )
-
-:start
- echo.
- set SAVED_PATH=%CD%
-
- if "%VC_VER%" == "14.1" (
- call "%PF%\%VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
- ) else if "%VC_VER%" == "14.2" (
- call "%PF%\%VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
- ) else (
- call "%PF%\%VC_PATH%\vcvarsall" %VCVARS_PLATFORM%
- )
-
- echo.
- cd /d %SAVED_PATH%
- if defined START_DIR cd /d %START_DIR%
- goto %BUILD_PLATFORM%
-
-:x64
- rem Calculate our output directory
- set OUTDIR=build\Win64\%VC_DESC%
- if not exist %OUTDIR% md %OUTDIR%
-
- if "%BUILD_CONFIG%" == "release" goto x64release
-
-:x64debug
- rem Perform 64-bit Debug Build
-
- call :build Debug x64
- if errorlevel 1 goto error
-
- call :build "DLL Debug" x64
- if errorlevel 1 goto error
-
- if "%BUILD_CONFIG%" == "debug" goto success
-
-:x64release
- rem Perform 64-bit Release Build
-
- call :build Release x64
- if errorlevel 1 goto error
-
- call :build "DLL Release" x64
- if errorlevel 1 goto error
-
- goto success
-
-:x86
- rem Calculate our output directory
- set OUTDIR=build\Win32\%VC_DESC%
- if not exist %OUTDIR% md %OUTDIR%
-
- if "%BUILD_CONFIG%" == "release" goto x86release
-
-:x86debug
- rem Perform 32-bit Debug Build
-
- call :build Debug Win32
- if errorlevel 1 goto error
-
- call :build "DLL Debug" Win32
- if errorlevel 1 goto error
-
- if "%BUILD_CONFIG%" == "debug" goto success
-
-:x86release
- rem Perform 32-bit Release Build
-
- call :build Release Win32
- if errorlevel 1 goto error
-
- call :build "DLL Release" Win32
- if errorlevel 1 goto error
-
- goto success
-
-:build
- rem This function builds wolfSSL.
- rem Usage: CALL :build <configuration> <platform>
- rem The current directory must be the wolfSSL directory.
- rem VS Configuration: Debug, Release, DLL Debug or DLL Release.
- rem VS Platform: Win32 or x64.
- rem Returns: 1 on fail, 0 on success.
- rem An informational message should be shown before any return.
- setlocal
- set MSBUILD_CONFIG=%~1
- set MSBUILD_PLATFORM=%~2
-
- if not exist wolfssl64.sln (
- echo.
- echo Error: build: wolfssl64.sln not found in "%CD%"
- exit /b 1
- )
-
- rem OUTDIR isn't a full path, only relative. MSBUILD_OUTDIR must be full and
- rem not have trailing backslashes, which are handled later.
- if "%MSBUILD_CONFIG%" == "Debug" (
- set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\LIB Debug"
- ) else if "%MSBUILD_CONFIG%" == "Release" (
- set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\LIB Release"
- ) else if "%MSBUILD_CONFIG%" == "DLL Debug" (
- set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\DLL Debug"
- ) else if "%MSBUILD_CONFIG%" == "DLL Release" (
- set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\DLL Release"
- ) else (
- echo.
- echo Error: build: Configuration not recognized.
- exit /b 1
- )
-
- if not "%MSBUILD_PLATFORM%" == "Win32" if not "%MSBUILD_PLATFORM%" == "x64" (
- echo.
- echo Error: build: Platform not recognized.
- exit /b 1
- )
-
- copy /v /y "%~dp0\wolfssl_options.h" .\cyassl\options.h
- if %ERRORLEVEL% neq 0 (
- echo.
- echo Error: build: Couldn't replace .\cyassl\options.h
- exit /b 1
- )
-
- copy /v /y "%~dp0\wolfssl_options.h" .\wolfssl\options.h
- if %ERRORLEVEL% neq 0 (
- echo.
- echo Error: build: Couldn't replace .\wolfssl\options.h
- exit /b 1
- )
-
- rem Extra trailing \ in Dirs because otherwise it thinks a quote is escaped
- msbuild wolfssl64.sln ^
- -p:CustomAfterMicrosoftCommonTargets="%~dp0\wolfssl_override.props" ^
- -p:Configuration="%MSBUILD_CONFIG%" ^
- -p:Platform="%MSBUILD_PLATFORM%" ^
- -p:PlatformToolset="%VC_TOOLSET%" ^
- -p:OutDir="%MSBUILD_OUTDIR%\\" ^
- -p:IntDir="%MSBUILD_OUTDIR%\obj\\"
-
- if %ERRORLEVEL% neq 0 (
- echo.
- echo Error: Failed building wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
- exit /b 1
- )
-
- rem For tests to run properly the wolfSSL directory must remain the current.
- set "PATH=%MSBUILD_OUTDIR%;%PATH%"
- "%MSBUILD_OUTDIR%\testsuite.exe"
-
- if %ERRORLEVEL% neq 0 (
- echo.
- echo Error: Failed testing wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
- exit /b 1
- )
-
- echo.
- echo Success: Built and tested wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
- echo.
- echo.
- rem This is necessary to export our local variables back to the caller.
- endlocal & set SUCCESSFUL_BUILDS="%MSBUILD_CONFIG%|%MSBUILD_PLATFORM%" ^
- %SUCCESSFUL_BUILDS%
- exit /b 0
-
-:syntax
- rem Display the help
- echo.
- echo Usage: build-wolfssl ^<compiler^> [platform] [configuration] [directory]
- echo.
- echo Compiler:
- echo.
- echo vc10 - Use Visual Studio 2010
- echo vc11 - Use Visual Studio 2012
- echo vc12 - Use Visual Studio 2013
- echo vc14 - Use Visual Studio 2015
- echo vc14.1 - Use Visual Studio 2017
- echo vc14.2 - Use Visual Studio 2019
- echo.
- echo Platform:
- echo.
- echo x86 - Perform a 32-bit build
- echo x64 - Perform a 64-bit build
- echo.
- echo Configuration:
- echo.
- echo debug - Perform a debug build
- echo release - Perform a release build
- echo.
- echo Other:
- echo.
- echo directory - Specifies the wolfSSL source directory
- goto error
-
-:unknown
- echo.
- echo Error: Unknown argument '%1'
- goto error
-
-:nodos
- echo.
- echo Error: Only a Windows NT based Operating System is supported
- goto error
-
-:nopf
- echo.
- echo Error: Cannot obtain the directory for Program Files
- goto error
-
-:novc
- echo.
- echo Error: %VC_DESC% is not installed
- goto error
-
-:nox64
- echo.
- echo Error: %VC_DESC% does not support 64-bit builds
- goto error
-
-:nowolfssl
- echo.
- echo Error: Cannot locate wolfSSL source directory, expected "%START_DIR%"
- goto error
-
-:error
- if "%OS%" == "Windows_NT" endlocal
- exit /B 1
-
-:success
- if defined SUCCESSFUL_BUILDS (
- echo.
- echo.
- echo Build complete.
- echo.
- echo The following configurations were built and tested successfully:
- echo.
- echo %SUCCESSFUL_BUILDS%
- echo.
- )
- cd /d %SAVED_PATH%
- endlocal
- exit /B 0
+@echo off
+rem ***************************************************************************
+rem * _ _ ____ _
+rem * Project ___| | | | _ \| |
+rem * / __| | | | |_) | |
+rem * | (__| |_| | _ <| |___
+rem * \___|\___/|_| \_\_____|
+rem *
+rem * Copyright (C) 2012 - 2020, Steve Holme, <steve_holme@hotmail.com>.
+rem * Copyright (C) 2015, Jay Satiro, <raysatiro@yahoo.com>.
+rem *
+rem * This software is licensed as described in the file COPYING, which
+rem * you should have received as part of this distribution. The terms
+rem * are also available at https://curl.se/docs/copyright.html.
+rem *
+rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+rem * copies of the Software, and permit persons to whom the Software is
+rem * furnished to do so, under the terms of the COPYING file.
+rem *
+rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+rem * KIND, either express or implied.
+rem *
+rem ***************************************************************************
+
+:begin
+ rem Check we are running on a Windows NT derived OS
+ if not "%OS%" == "Windows_NT" goto nodos
+
+ rem Set our variables
+ setlocal
+ set SUCCESSFUL_BUILDS=
+ set VC_VER=
+ set BUILD_PLATFORM=
+
+ rem Ensure we have the required arguments
+ if /i "%~1" == "" goto syntax
+
+ rem Calculate the program files directory
+ if defined PROGRAMFILES (
+ set "PF=%PROGRAMFILES%"
+ set OS_PLATFORM=x86
+ )
+ if defined PROGRAMFILES(x86) (
+ set "PF=%PROGRAMFILES(x86)%"
+ set OS_PLATFORM=x64
+ )
+
+:parseArgs
+ if "%~1" == "" goto prerequisites
+
+ if /i "%~1" == "vc10" (
+ set VC_VER=10.0
+ set VC_DESC=VC10
+ set VC_TOOLSET=v100
+ set "VC_PATH=Microsoft Visual Studio 10.0\VC"
+ ) else if /i "%~1" == "vc11" (
+ set VC_VER=11.0
+ set VC_DESC=VC11
+ set VC_TOOLSET=v110
+ set "VC_PATH=Microsoft Visual Studio 11.0\VC"
+ ) else if /i "%~1" == "vc12" (
+ set VC_VER=12.0
+ set VC_DESC=VC12
+ set VC_TOOLSET=v120
+ set "VC_PATH=Microsoft Visual Studio 12.0\VC"
+ ) else if /i "%~1" == "vc14" (
+ set VC_VER=14.0
+ set VC_DESC=VC14
+ set VC_TOOLSET=v140
+ set "VC_PATH=Microsoft Visual Studio 14.0\VC"
+ ) else if /i "%~1" == "vc14.1" (
+ set VC_VER=14.1
+ set VC_DESC=VC14.1
+ set VC_TOOLSET=v141
+
+ rem Determine the VC14.1 path based on the installed edition in descending
+ rem order (Enterprise, then Professional and finally Community)
+ if exist "%PF%\Microsoft Visual Studio\2017\Enterprise\VC" (
+ set "VC_PATH=Microsoft Visual Studio\2017\Enterprise\VC"
+ ) else if exist "%PF%\Microsoft Visual Studio\2017\Professional\VC" (
+ set "VC_PATH=Microsoft Visual Studio\2017\Professional\VC"
+ ) else (
+ set "VC_PATH=Microsoft Visual Studio\2017\Community\VC"
+ )
+ ) else if /i "%~1" == "vc14.2" (
+ set VC_VER=14.2
+ set VC_DESC=VC14.2
+ set VC_TOOLSET=v142
+
+ rem Determine the VC14.2 path based on the installed edition in descending
+ rem order (Enterprise, then Professional and finally Community)
+ if exist "%PF%\Microsoft Visual Studio\2019\Enterprise\VC" (
+ set "VC_PATH=Microsoft Visual Studio\2019\Enterprise\VC"
+ ) else if exist "%PF%\Microsoft Visual Studio\2019\Professional\VC" (
+ set "VC_PATH=Microsoft Visual Studio\2019\Professional\VC"
+ ) else (
+ set "VC_PATH=Microsoft Visual Studio\2019\Community\VC"
+ )
+ ) else if /i "%~1" == "x86" (
+ set BUILD_PLATFORM=x86
+ ) else if /i "%~1" == "x64" (
+ set BUILD_PLATFORM=x64
+ ) else if /i "%~1" == "debug" (
+ set BUILD_CONFIG=debug
+ ) else if /i "%~1" == "release" (
+ set BUILD_CONFIG=release
+ ) else if /i "%~1" == "-?" (
+ goto syntax
+ ) else if /i "%~1" == "-h" (
+ goto syntax
+ ) else if /i "%~1" == "-help" (
+ goto syntax
+ ) else (
+ if not defined START_DIR (
+ set START_DIR=%~1
+ ) else (
+ goto unknown
+ )
+ )
+
+ shift & goto parseArgs
+
+:prerequisites
+ rem Compiler is a required parameter
+ if not defined VC_VER goto syntax
+
+ rem Default the start directory if one isn't specified
+ if not defined START_DIR set START_DIR=..\..\wolfssl
+
+ rem Check we have a program files directory
+ if not defined PF goto nopf
+
+ rem Check we have Visual Studio installed
+ if not exist "%PF%\%VC_PATH%" goto novc
+
+ rem Check the start directory exists
+ if not exist "%START_DIR%" goto nowolfssl
+
+:configure
+ if "%BUILD_PLATFORM%" == "" set BUILD_PLATFORM=%OS_PLATFORM%
+
+ if "%BUILD_PLATFORM%" == "x86" (
+ set VCVARS_PLATFORM=x86
+ ) else if "%BUILD_PLATFORM%" == "x64" (
+ if "%VC_VER%" == "10.0" set VCVARS_PLATFORM=%BUILD_PLATFORM%
+ if "%VC_VER%" == "11.0" set VCVARS_PLATFORM=amd64
+ if "%VC_VER%" == "12.0" set VCVARS_PLATFORM=amd64
+ if "%VC_VER%" == "14.0" set VCVARS_PLATFORM=amd64
+ if "%VC_VER%" == "14.1" set VCVARS_PLATFORM=amd64
+ if "%VC_VER%" == "14.2" set VCVARS_PLATFORM=amd64
+ )
+
+:start
+ echo.
+ set SAVED_PATH=%CD%
+
+ if "%VC_VER%" == "14.1" (
+ call "%PF%\%VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
+ ) else if "%VC_VER%" == "14.2" (
+ call "%PF%\%VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
+ ) else (
+ call "%PF%\%VC_PATH%\vcvarsall" %VCVARS_PLATFORM%
+ )
+
+ echo.
+ cd /d %SAVED_PATH%
+ if defined START_DIR cd /d %START_DIR%
+ goto %BUILD_PLATFORM%
+
+:x64
+ rem Calculate our output directory
+ set OUTDIR=build\Win64\%VC_DESC%
+ if not exist %OUTDIR% md %OUTDIR%
+
+ if "%BUILD_CONFIG%" == "release" goto x64release
+
+:x64debug
+ rem Perform 64-bit Debug Build
+
+ call :build Debug x64
+ if errorlevel 1 goto error
+
+ call :build "DLL Debug" x64
+ if errorlevel 1 goto error
+
+ if "%BUILD_CONFIG%" == "debug" goto success
+
+:x64release
+ rem Perform 64-bit Release Build
+
+ call :build Release x64
+ if errorlevel 1 goto error
+
+ call :build "DLL Release" x64
+ if errorlevel 1 goto error
+
+ goto success
+
+:x86
+ rem Calculate our output directory
+ set OUTDIR=build\Win32\%VC_DESC%
+ if not exist %OUTDIR% md %OUTDIR%
+
+ if "%BUILD_CONFIG%" == "release" goto x86release
+
+:x86debug
+ rem Perform 32-bit Debug Build
+
+ call :build Debug Win32
+ if errorlevel 1 goto error
+
+ call :build "DLL Debug" Win32
+ if errorlevel 1 goto error
+
+ if "%BUILD_CONFIG%" == "debug" goto success
+
+:x86release
+ rem Perform 32-bit Release Build
+
+ call :build Release Win32
+ if errorlevel 1 goto error
+
+ call :build "DLL Release" Win32
+ if errorlevel 1 goto error
+
+ goto success
+
+:build
+ rem This function builds wolfSSL.
+ rem Usage: CALL :build <configuration> <platform>
+ rem The current directory must be the wolfSSL directory.
+ rem VS Configuration: Debug, Release, DLL Debug or DLL Release.
+ rem VS Platform: Win32 or x64.
+ rem Returns: 1 on fail, 0 on success.
+ rem An informational message should be shown before any return.
+ setlocal
+ set MSBUILD_CONFIG=%~1
+ set MSBUILD_PLATFORM=%~2
+
+ if not exist wolfssl64.sln (
+ echo.
+ echo Error: build: wolfssl64.sln not found in "%CD%"
+ exit /b 1
+ )
+
+ rem OUTDIR isn't a full path, only relative. MSBUILD_OUTDIR must be full and
+ rem not have trailing backslashes, which are handled later.
+ if "%MSBUILD_CONFIG%" == "Debug" (
+ set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\LIB Debug"
+ ) else if "%MSBUILD_CONFIG%" == "Release" (
+ set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\LIB Release"
+ ) else if "%MSBUILD_CONFIG%" == "DLL Debug" (
+ set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\DLL Debug"
+ ) else if "%MSBUILD_CONFIG%" == "DLL Release" (
+ set "MSBUILD_OUTDIR=%CD%\%OUTDIR%\DLL Release"
+ ) else (
+ echo.
+ echo Error: build: Configuration not recognized.
+ exit /b 1
+ )
+
+ if not "%MSBUILD_PLATFORM%" == "Win32" if not "%MSBUILD_PLATFORM%" == "x64" (
+ echo.
+ echo Error: build: Platform not recognized.
+ exit /b 1
+ )
+
+ copy /v /y "%~dp0\wolfssl_options.h" .\cyassl\options.h
+ if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Error: build: Couldn't replace .\cyassl\options.h
+ exit /b 1
+ )
+
+ copy /v /y "%~dp0\wolfssl_options.h" .\wolfssl\options.h
+ if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Error: build: Couldn't replace .\wolfssl\options.h
+ exit /b 1
+ )
+
+ rem Extra trailing \ in Dirs because otherwise it thinks a quote is escaped
+ msbuild wolfssl64.sln ^
+ -p:CustomAfterMicrosoftCommonTargets="%~dp0\wolfssl_override.props" ^
+ -p:Configuration="%MSBUILD_CONFIG%" ^
+ -p:Platform="%MSBUILD_PLATFORM%" ^
+ -p:PlatformToolset="%VC_TOOLSET%" ^
+ -p:OutDir="%MSBUILD_OUTDIR%\\" ^
+ -p:IntDir="%MSBUILD_OUTDIR%\obj\\"
+
+ if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Error: Failed building wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
+ exit /b 1
+ )
+
+ rem For tests to run properly the wolfSSL directory must remain the current.
+ set "PATH=%MSBUILD_OUTDIR%;%PATH%"
+ "%MSBUILD_OUTDIR%\testsuite.exe"
+
+ if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Error: Failed testing wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
+ exit /b 1
+ )
+
+ echo.
+ echo Success: Built and tested wolfSSL %MSBUILD_CONFIG%^|%MSBUILD_PLATFORM%.
+ echo.
+ echo.
+ rem This is necessary to export our local variables back to the caller.
+ endlocal & set SUCCESSFUL_BUILDS="%MSBUILD_CONFIG%|%MSBUILD_PLATFORM%" ^
+ %SUCCESSFUL_BUILDS%
+ exit /b 0
+
+:syntax
+ rem Display the help
+ echo.
+ echo Usage: build-wolfssl ^<compiler^> [platform] [configuration] [directory]
+ echo.
+ echo Compiler:
+ echo.
+ echo vc10 - Use Visual Studio 2010
+ echo vc11 - Use Visual Studio 2012
+ echo vc12 - Use Visual Studio 2013
+ echo vc14 - Use Visual Studio 2015
+ echo vc14.1 - Use Visual Studio 2017
+ echo vc14.2 - Use Visual Studio 2019
+ echo.
+ echo Platform:
+ echo.
+ echo x86 - Perform a 32-bit build
+ echo x64 - Perform a 64-bit build
+ echo.
+ echo Configuration:
+ echo.
+ echo debug - Perform a debug build
+ echo release - Perform a release build
+ echo.
+ echo Other:
+ echo.
+ echo directory - Specifies the wolfSSL source directory
+ goto error
+
+:unknown
+ echo.
+ echo Error: Unknown argument '%1'
+ goto error
+
+:nodos
+ echo.
+ echo Error: Only a Windows NT based Operating System is supported
+ goto error
+
+:nopf
+ echo.
+ echo Error: Cannot obtain the directory for Program Files
+ goto error
+
+:novc
+ echo.
+ echo Error: %VC_DESC% is not installed
+ goto error
+
+:nox64
+ echo.
+ echo Error: %VC_DESC% does not support 64-bit builds
+ goto error
+
+:nowolfssl
+ echo.
+ echo Error: Cannot locate wolfSSL source directory, expected "%START_DIR%"
+ goto error
+
+:error
+ if "%OS%" == "Windows_NT" endlocal
+ exit /B 1
+
+:success
+ if defined SUCCESSFUL_BUILDS (
+ echo.
+ echo.
+ echo Build complete.
+ echo.
+ echo The following configurations were built and tested successfully:
+ echo.
+ echo %SUCCESSFUL_BUILDS%
+ echo.
+ )
+ cd /d %SAVED_PATH%
+ endlocal
+ exit /B 0
diff --git a/projects/checksrc.bat b/projects/checksrc.bat
index 9b4dc44d..3f04f0cd 100644
--- a/projects/checksrc.bat
+++ b/projects/checksrc.bat
@@ -1,223 +1,223 @@
-@echo off
-rem ***************************************************************************
-rem * _ _ ____ _
-rem * Project ___| | | | _ \| |
-rem * / __| | | | |_) | |
-rem * | (__| |_| | _ <| |___
-rem * \___|\___/|_| \_\_____|
-rem *
-rem * Copyright (C) 2014 - 2020, Steve Holme, <steve_holme@hotmail.com>.
-rem *
-rem * This software is licensed as described in the file COPYING, which
-rem * you should have received as part of this distribution. The terms
-rem * are also available at https://curl.se/docs/copyright.html.
-rem *
-rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
-rem * copies of the Software, and permit persons to whom the Software is
-rem * furnished to do so, under the terms of the COPYING file.
-rem *
-rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
-rem * KIND, either express or implied.
-rem *
-rem ***************************************************************************
-
-:begin
- rem Check we are running on a Windows NT derived OS
- if not "%OS%" == "Windows_NT" goto nodos
-
- rem Set our variables
- setlocal
- set CHECK_LIB=TRUE
- set CHECK_SRC=TRUE
- set CHECK_TESTS=TRUE
- set CHECK_EXAMPLES=TRUE
- set SRC_DIR=
- set CUR_DIR=%cd%
- set ARG0_DIR=%~dp0
-
-:parseArgs
- if "%~1" == "" goto prerequisites
-
- if /i "%~1" == "-?" (
- goto syntax
- ) else if /i "%~1" == "-h" (
- goto syntax
- ) else if /i "%~1" == "-help" (
- goto syntax
- ) else if /i "%~1" == "lib" (
- set CHECK_LIB=TRUE
- set CHECK_SRC=FALSE
- set CHECK_TESTS=FALSE
- set CHECK_EXAMPLES=FALSE
- ) else if /i "%~1" == "src" (
- set CHECK_LIB=FALSE
- set CHECK_SRC=TRUE
- set CHECK_TESTS=FALSE
- set CHECK_EXAMPLES=FALSE
- ) else if /i "%~1" == "tests" (
- set CHECK_LIB=FALSE
- set CHECK_SRC=FALSE
- set CHECK_TESTS=TRUE
- set CHECK_EXAMPLES=FALSE
- ) else if /i "%~1" == "examples" (
- set CHECK_LIB=FALSE
- set CHECK_SRC=FALSE
- set CHECK_TESTS=FALSE
- set CHECK_EXAMPLES=TRUE
- ) else (
- if not defined SRC_DIR (
- set SRC_DIR=%~1%
- ) else (
- goto unknown
- )
- )
-
- shift & goto parseArgs
-
-:prerequisites
- rem Check we have Perl in our path
- perl --version <NUL 1>NUL 2>&1
- if errorlevel 1 (
- rem It isn't so check we have it installed and set the path if it is
- if exist "%SystemDrive%\Perl" (
- set "PATH=%SystemDrive%\Perl\bin;%PATH%"
- ) else (
- if exist "%SystemDrive%\Perl64" (
- set "PATH=%SystemDrive%\Perl64\bin;%PATH%"
- ) else (
- goto noperl
- )
- )
- )
-
-:configure
- if "%SRC_DIR%" == "" (
- rem Are we being executed from the "projects" or main directory?
- if "%CUR_DIR%\" == "%ARG0_DIR%" (
- set SRC_DIR=..
- ) else if exist projects (
- if exist docs (
- if exist lib (
- if exist src (
- if exist tests (
- set SRC_DIR=.
- )
- )
- )
- )
- )
- )
- if not exist "%SRC_DIR%" goto nosrc
-
-:start
- if "%CHECK_SRC%" == "TRUE" (
- rem Check the src directory
- if exist %SRC_DIR%\src (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" "%%i"
- )
- )
-
- if "%CHECK_LIB%" == "TRUE" (
- rem Check the lib directory
- if exist %SRC_DIR%\lib (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" -Wcurl_config.h.cmake -Wcurl_config.h.in -Wcurl_config.h "%%i"
- )
-
- rem Check the lib\vauth directory
- if exist %SRC_DIR%\lib\vauth (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vauth\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vauth" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vauth\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vauth" "%%i"
- )
-
- rem Check the lib\vquic directory
- if exist %SRC_DIR%\lib\vquic (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vquic\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vquic" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vquic\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vquic" "%%i"
- )
-
- rem Check the lib\vssh directory
- if exist %SRC_DIR%\lib\vssh (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vssh\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vssh" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vssh\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vssh" "%%i"
- )
-
- rem Check the lib\vtls directory
- if exist %SRC_DIR%\lib\vtls (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
- )
- )
-
- if "%CHECK_TESTS%" == "TRUE" (
- rem Check the tests\libtest directory
- if exist %SRC_DIR%\tests\libtest (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\libtest\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\libtest" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\libtest\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\libtest" "%%i"
- )
-
- rem Check the tests\unit directory
- if exist %SRC_DIR%\tests\unit (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\unit\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\unit" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\unit\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\unit" "%%i"
- )
-
- rem Check the tests\server directory
- if exist %SRC_DIR%\tests\server (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\server\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\server" "%%i"
- for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\server\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\server" "%%i"
- )
- )
-
- if "%CHECK_EXAMPLES%" == "TRUE" (
- rem Check the docs\examples directory
- if exist %SRC_DIR%\docs\examples (
- for /f "delims=" %%i in ('dir "%SRC_DIR%\docs\examples\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\docs\examples" -ASNPRINTF "%%i"
- )
- )
-
- goto success
-
-:syntax
- rem Display the help
- echo.
- echo Usage: checksrc [what] [directory]
- echo.
- echo What to scan:
- echo.
- echo lib - Scan the libcurl source
- echo src - Scan the command-line tool source
- echo tests - Scan the library tests and unit tests
- echo examples - Scan the examples
- echo.
- echo directory - Specifies the curl source directory
- goto success
-
-:unknown
- echo.
- echo Error: Unknown argument '%1'
- goto error
-
-:nodos
- echo.
- echo Error: Only a Windows NT based Operating System is supported
- goto error
-
-:noperl
- echo.
- echo Error: Perl is not installed
- goto error
-
-:nosrc
- echo.
- echo Error: "%SRC_DIR%" does not exist
- goto error
-
-:error
- if "%OS%" == "Windows_NT" endlocal
- exit /B 1
-
-:success
- endlocal
- exit /B 0
+@echo off
+rem ***************************************************************************
+rem * _ _ ____ _
+rem * Project ___| | | | _ \| |
+rem * / __| | | | |_) | |
+rem * | (__| |_| | _ <| |___
+rem * \___|\___/|_| \_\_____|
+rem *
+rem * Copyright (C) 2014 - 2020, Steve Holme, <steve_holme@hotmail.com>.
+rem *
+rem * This software is licensed as described in the file COPYING, which
+rem * you should have received as part of this distribution. The terms
+rem * are also available at https://curl.se/docs/copyright.html.
+rem *
+rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+rem * copies of the Software, and permit persons to whom the Software is
+rem * furnished to do so, under the terms of the COPYING file.
+rem *
+rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+rem * KIND, either express or implied.
+rem *
+rem ***************************************************************************
+
+:begin
+ rem Check we are running on a Windows NT derived OS
+ if not "%OS%" == "Windows_NT" goto nodos
+
+ rem Set our variables
+ setlocal
+ set CHECK_LIB=TRUE
+ set CHECK_SRC=TRUE
+ set CHECK_TESTS=TRUE
+ set CHECK_EXAMPLES=TRUE
+ set SRC_DIR=
+ set CUR_DIR=%cd%
+ set ARG0_DIR=%~dp0
+
+:parseArgs
+ if "%~1" == "" goto prerequisites
+
+ if /i "%~1" == "-?" (
+ goto syntax
+ ) else if /i "%~1" == "-h" (
+ goto syntax
+ ) else if /i "%~1" == "-help" (
+ goto syntax
+ ) else if /i "%~1" == "lib" (
+ set CHECK_LIB=TRUE
+ set CHECK_SRC=FALSE
+ set CHECK_TESTS=FALSE
+ set CHECK_EXAMPLES=FALSE
+ ) else if /i "%~1" == "src" (
+ set CHECK_LIB=FALSE
+ set CHECK_SRC=TRUE
+ set CHECK_TESTS=FALSE
+ set CHECK_EXAMPLES=FALSE
+ ) else if /i "%~1" == "tests" (
+ set CHECK_LIB=FALSE
+ set CHECK_SRC=FALSE
+ set CHECK_TESTS=TRUE
+ set CHECK_EXAMPLES=FALSE
+ ) else if /i "%~1" == "examples" (
+ set CHECK_LIB=FALSE
+ set CHECK_SRC=FALSE
+ set CHECK_TESTS=FALSE
+ set CHECK_EXAMPLES=TRUE
+ ) else (
+ if not defined SRC_DIR (
+ set SRC_DIR=%~1%
+ ) else (
+ goto unknown
+ )
+ )
+
+ shift & goto parseArgs
+
+:prerequisites
+ rem Check we have Perl in our path
+ perl --version <NUL 1>NUL 2>&1
+ if errorlevel 1 (
+ rem It isn't so check we have it installed and set the path if it is
+ if exist "%SystemDrive%\Perl" (
+ set "PATH=%SystemDrive%\Perl\bin;%PATH%"
+ ) else (
+ if exist "%SystemDrive%\Perl64" (
+ set "PATH=%SystemDrive%\Perl64\bin;%PATH%"
+ ) else (
+ goto noperl
+ )
+ )
+ )
+
+:configure
+ if "%SRC_DIR%" == "" (
+ rem Are we being executed from the "projects" or main directory?
+ if "%CUR_DIR%\" == "%ARG0_DIR%" (
+ set SRC_DIR=..
+ ) else if exist projects (
+ if exist docs (
+ if exist lib (
+ if exist src (
+ if exist tests (
+ set SRC_DIR=.
+ )
+ )
+ )
+ )
+ )
+ )
+ if not exist "%SRC_DIR%" goto nosrc
+
+:start
+ if "%CHECK_SRC%" == "TRUE" (
+ rem Check the src directory
+ if exist %SRC_DIR%\src (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" "%%i"
+ )
+ )
+
+ if "%CHECK_LIB%" == "TRUE" (
+ rem Check the lib directory
+ if exist %SRC_DIR%\lib (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" -Wcurl_config.h.cmake -Wcurl_config.h.in -Wcurl_config.h "%%i"
+ )
+
+ rem Check the lib\vauth directory
+ if exist %SRC_DIR%\lib\vauth (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vauth\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vauth" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vauth\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vauth" "%%i"
+ )
+
+ rem Check the lib\vquic directory
+ if exist %SRC_DIR%\lib\vquic (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vquic\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vquic" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vquic\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vquic" "%%i"
+ )
+
+ rem Check the lib\vssh directory
+ if exist %SRC_DIR%\lib\vssh (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vssh\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vssh" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vssh\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vssh" "%%i"
+ )
+
+ rem Check the lib\vtls directory
+ if exist %SRC_DIR%\lib\vtls (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
+ )
+ )
+
+ if "%CHECK_TESTS%" == "TRUE" (
+ rem Check the tests\libtest directory
+ if exist %SRC_DIR%\tests\libtest (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\libtest\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\libtest" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\libtest\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\libtest" "%%i"
+ )
+
+ rem Check the tests\unit directory
+ if exist %SRC_DIR%\tests\unit (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\unit\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\unit" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\unit\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\unit" "%%i"
+ )
+
+ rem Check the tests\server directory
+ if exist %SRC_DIR%\tests\server (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\server\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\server" "%%i"
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\tests\server\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\tests\server" "%%i"
+ )
+ )
+
+ if "%CHECK_EXAMPLES%" == "TRUE" (
+ rem Check the docs\examples directory
+ if exist %SRC_DIR%\docs\examples (
+ for /f "delims=" %%i in ('dir "%SRC_DIR%\docs\examples\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\docs\examples" -ASNPRINTF "%%i"
+ )
+ )
+
+ goto success
+
+:syntax
+ rem Display the help
+ echo.
+ echo Usage: checksrc [what] [directory]
+ echo.
+ echo What to scan:
+ echo.
+ echo lib - Scan the libcurl source
+ echo src - Scan the command-line tool source
+ echo tests - Scan the library tests and unit tests
+ echo examples - Scan the examples
+ echo.
+ echo directory - Specifies the curl source directory
+ goto success
+
+:unknown
+ echo.
+ echo Error: Unknown argument '%1'
+ goto error
+
+:nodos
+ echo.
+ echo Error: Only a Windows NT based Operating System is supported
+ goto error
+
+:noperl
+ echo.
+ echo Error: Perl is not installed
+ goto error
+
+:nosrc
+ echo.
+ echo Error: "%SRC_DIR%" does not exist
+ goto error
+
+:error
+ if "%OS%" == "Windows_NT" endlocal
+ exit /B 1
+
+:success
+ endlocal
+ exit /B 0
diff --git a/projects/generate.bat b/projects/generate.bat
index 5ef562fa..840094e3 100644
--- a/projects/generate.bat
+++ b/projects/generate.bat
@@ -1,478 +1,478 @@
-@echo off
-rem ***************************************************************************
-rem * _ _ ____ _
-rem * Project ___| | | | _ \| |
-rem * / __| | | | |_) | |
-rem * | (__| |_| | _ <| |___
-rem * \___|\___/|_| \_\_____|
-rem *
-rem * Copyright (C) 2014 - 2020, Steve Holme, <steve_holme@hotmail.com>.
-rem *
-rem * This software is licensed as described in the file COPYING, which
-rem * you should have received as part of this distribution. The terms
-rem * are also available at https://curl.se/docs/copyright.html.
-rem *
-rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
-rem * copies of the Software, and permit persons to whom the Software is
-rem * furnished to do so, under the terms of the COPYING file.
-rem *
-rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
-rem * KIND, either express or implied.
-rem *
-rem ***************************************************************************
-
-:begin
- rem Check we are running on a Windows NT derived OS
- if not "%OS%" == "Windows_NT" goto nodos
-
- rem Set our variables
- setlocal ENABLEEXTENSIONS
- set VERSION=ALL
- set MODE=GENERATE
-
- rem Check we are not running on a network drive
- if "%~d0."=="\\." goto nonetdrv
-
- rem Switch to this batch file's directory
- cd /d "%~0\.." 1>NUL 2>&1
-
- rem Check we are running from a curl git repository
- if not exist ..\GIT-INFO goto norepo
-
-:parseArgs
- if "%~1" == "" goto start
-
- if /i "%~1" == "pre" (
- set VERSION=PRE
- ) else if /i "%~1" == "vc6" (
- set VERSION=VC6
- ) else if /i "%~1" == "vc7" (
- set VERSION=VC7
- ) else if /i "%~1" == "vc7.1" (
- set VERSION=VC7.1
- ) else if /i "%~1" == "vc8" (
- set VERSION=VC8
- ) else if /i "%~1" == "vc9" (
- set VERSION=VC9
- ) else if /i "%~1" == "vc10" (
- set VERSION=VC10
- ) else if /i "%~1" == "vc11" (
- set VERSION=VC11
- ) else if /i "%~1" == "vc12" (
- set VERSION=VC12
- ) else if /i "%~1" == "vc14" (
- set VERSION=VC14
- ) else if /i "%~1" == "vc15" (
- set VERSION=VC15
- ) else if /i "%~1" == "-clean" (
- set MODE=CLEAN
- ) else if /i "%~1" == "-?" (
- goto syntax
- ) else if /i "%~1" == "-h" (
- goto syntax
- ) else if /i "%~1" == "-help" (
- goto syntax
- ) else (
- goto unknown
- )
-
- shift & goto parseArgs
-
-:start
- if exist ..\buildconf.bat (
- if "%MODE%" == "GENERATE" (
- call ..\buildconf
- ) else if "%VERSION%" == "PRE" (
- call ..\buildconf -clean
- ) else if "%VERSION%" == "ALL" (
- call ..\buildconf -clean
- )
- )
- if "%VERSION%" == "PRE" goto success
- if "%VERSION%" == "VC6" goto vc6
- if "%VERSION%" == "VC7" goto vc7
- if "%VERSION%" == "VC7.1" goto vc71
- if "%VERSION%" == "VC8" goto vc8
- if "%VERSION%" == "VC9" goto vc9
- if "%VERSION%" == "VC10" goto vc10
- if "%VERSION%" == "VC11" goto vc11
- if "%VERSION%" == "VC12" goto vc12
- if "%VERSION%" == "VC14" goto vc14
- if "%VERSION%" == "VC15" goto vc15
-
-:vc6
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC6 project files
- call :generate dsp Windows\VC6\src\curl.tmpl Windows\VC6\src\curl.dsp
- call :generate dsp Windows\VC6\lib\libcurl.tmpl Windows\VC6\lib\libcurl.dsp
- ) else (
- echo Removing VC6 project files
- call :clean Windows\VC6\src\curl.dsp
- call :clean Windows\VC6\lib\libcurl.dsp
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc7
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC7 project files
- call :generate vcproj1 Windows\VC7\src\curl.tmpl Windows\VC7\src\curl.vcproj
- call :generate vcproj1 Windows\VC7\lib\libcurl.tmpl Windows\VC7\lib\libcurl.vcproj
- ) else (
- echo Removing VC7 project files
- call :clean Windows\VC7\src\curl.vcproj
- call :clean Windows\VC7\lib\libcurl.vcproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc71
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC7.1 project files
- call :generate vcproj1 Windows\VC7.1\src\curl.tmpl Windows\VC7.1\src\curl.vcproj
- call :generate vcproj1 Windows\VC7.1\lib\libcurl.tmpl Windows\VC7.1\lib\libcurl.vcproj
- ) else (
- echo Removing VC7.1 project files
- call :clean Windows\VC7.1\src\curl.vcproj
- call :clean Windows\VC7.1\lib\libcurl.vcproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc8
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC8 project files
- call :generate vcproj2 Windows\VC8\src\curl.tmpl Windows\VC8\src\curl.vcproj
- call :generate vcproj2 Windows\VC8\lib\libcurl.tmpl Windows\VC8\lib\libcurl.vcproj
- ) else (
- echo Removing VC8 project files
- call :clean Windows\VC8\src\curl.vcproj
- call :clean Windows\VC8\lib\libcurl.vcproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc9
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC9 project files
- call :generate vcproj2 Windows\VC9\src\curl.tmpl Windows\VC9\src\curl.vcproj
- call :generate vcproj2 Windows\VC9\lib\libcurl.tmpl Windows\VC9\lib\libcurl.vcproj
- ) else (
- echo Removing VC9 project files
- call :clean Windows\VC9\src\curl.vcproj
- call :clean Windows\VC9\lib\libcurl.vcproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc10
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC10 project files
- call :generate vcxproj Windows\VC10\src\curl.tmpl Windows\VC10\src\curl.vcxproj
- call :generate vcxproj Windows\VC10\lib\libcurl.tmpl Windows\VC10\lib\libcurl.vcxproj
- ) else (
- echo Removing VC10 project files
- call :clean Windows\VC10\src\curl.vcxproj
- call :clean Windows\VC10\lib\libcurl.vcxproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc11
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC11 project files
- call :generate vcxproj Windows\VC11\src\curl.tmpl Windows\VC11\src\curl.vcxproj
- call :generate vcxproj Windows\VC11\lib\libcurl.tmpl Windows\VC11\lib\libcurl.vcxproj
- ) else (
- echo Removing VC11 project files
- call :clean Windows\VC11\src\curl.vcxproj
- call :clean Windows\VC11\lib\libcurl.vcxproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc12
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC12 project files
- call :generate vcxproj Windows\VC12\src\curl.tmpl Windows\VC12\src\curl.vcxproj
- call :generate vcxproj Windows\VC12\lib\libcurl.tmpl Windows\VC12\lib\libcurl.vcxproj
- ) else (
- echo Removing VC12 project files
- call :clean Windows\VC12\src\curl.vcxproj
- call :clean Windows\VC12\lib\libcurl.vcxproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc14
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC14 project files
- call :generate vcxproj Windows\VC14\src\curl.tmpl Windows\VC14\src\curl.vcxproj
- call :generate vcxproj Windows\VC14\lib\libcurl.tmpl Windows\VC14\lib\libcurl.vcxproj
- ) else (
- echo Removing VC14 project files
- call :clean Windows\VC14\src\curl.vcxproj
- call :clean Windows\VC14\lib\libcurl.vcxproj
- )
-
- if not "%VERSION%" == "ALL" goto success
-
-:vc15
- echo.
-
- if "%MODE%" == "GENERATE" (
- echo Generating VC15 project files
- call :generate vcxproj Windows\VC15\src\curl.tmpl Windows\VC15\src\curl.vcxproj
- call :generate vcxproj Windows\VC15\lib\libcurl.tmpl Windows\VC15\lib\libcurl.vcxproj
- ) else (
- echo Removing VC15 project files
- call :clean Windows\VC15\src\curl.vcxproj
- call :clean Windows\VC15\lib\libcurl.vcxproj
- )
-
- goto success
-
-rem Main generate function.
-rem
-rem %1 - Project Type (dsp for VC6, vcproj1 for VC7 and VC7.1, vcproj2 for VC8 and VC9
-rem or vcxproj for VC10, VC11, VC12, VC14 and VC15)
-rem %2 - Input template file
-rem %3 - Output project file
-rem
-:generate
- if not exist %2 (
- echo.
- echo Error: Cannot open %2
- exit /B
- )
-
- if exist %3 (
- del %3
- )
-
- echo * %CD%\%3
- for /f "usebackq delims=" %%i in (`"findstr /n ^^ %2"`) do (
- set "var=%%i"
- setlocal enabledelayedexpansion
- set "var=!var:*:=!"
-
- if "!var!" == "CURL_SRC_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\src\*.c') do call :element %1 src "%%c" %3
- ) else if "!var!" == "CURL_SRC_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\src\*.h') do call :element %1 src "%%h" %3
- ) else if "!var!" == "CURL_SRC_RC_FILES" (
- for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element %1 src "%%r" %3
- ) else if "!var!" == "CURL_SRC_X_C_FILES" (
- call :element %1 lib "strtoofft.c" %3
- call :element %1 lib "nonblock.c" %3
- call :element %1 lib "warnless.c" %3
- call :element %1 lib "curl_ctype.c" %3
- call :element %1 lib "curl_multibyte.c" %3
- call :element %1 lib "version_win32.c" %3
- call :element %1 lib "dynbuf.c" %3
- ) else if "!var!" == "CURL_SRC_X_H_FILES" (
- call :element %1 lib "config-win32.h" %3
- call :element %1 lib "curl_setup.h" %3
- call :element %1 lib "strtoofft.h" %3
- call :element %1 lib "nonblock.h" %3
- call :element %1 lib "warnless.h" %3
- call :element %1 lib "curl_ctype.h" %3
- call :element %1 lib "curl_multibyte.h" %3
- call :element %1 lib "version_win32.h" %3
- call :element %1 lib "dynbuf.h" %3
- ) else if "!var!" == "CURL_LIB_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element %1 lib "%%c" %3
- ) else if "!var!" == "CURL_LIB_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\include\curl\*.h') do call :element %1 include\curl "%%h" %3
- for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element %1 lib "%%h" %3
- ) else if "!var!" == "CURL_LIB_RC_FILES" (
- for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib "%%r" %3
- ) else if "!var!" == "CURL_LIB_VAUTH_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\lib\vauth\*.c') do call :element %1 lib\vauth "%%c" %3
- ) else if "!var!" == "CURL_LIB_VAUTH_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\lib\vauth\*.h') do call :element %1 lib\vauth "%%h" %3
- ) else if "!var!" == "CURL_LIB_VQUIC_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\lib\vquic\*.c') do call :element %1 lib\vquic "%%c" %3
- ) else if "!var!" == "CURL_LIB_VQUIC_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\lib\vquic\*.h') do call :element %1 lib\vquic "%%h" %3
- ) else if "!var!" == "CURL_LIB_VSSH_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\lib\vssh\*.c') do call :element %1 lib\vssh "%%c" %3
- ) else if "!var!" == "CURL_LIB_VSSH_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\lib\vssh\*.h') do call :element %1 lib\vssh "%%h" %3
- ) else if "!var!" == "CURL_LIB_VTLS_C_FILES" (
- for /f "delims=" %%c in ('dir /b ..\lib\vtls\*.c') do call :element %1 lib\vtls "%%c" %3
- ) else if "!var!" == "CURL_LIB_VTLS_H_FILES" (
- for /f "delims=" %%h in ('dir /b ..\lib\vtls\*.h') do call :element %1 lib\vtls "%%h" %3
- ) else (
- echo.!var!>> %3
- )
-
- endlocal
- )
- exit /B
-
-rem Generates a single file xml element.
-rem
-rem %1 - Project Type (dsp for VC6, vcproj1 for VC7 and VC7.1, vcproj2 for VC8 and VC9
-rem or vcxproj for VC10, VC11, VC12, VC14 and VC15)
-rem %2 - Directory (src, lib, lib\vauth, lib\vquic, lib\vssh, lib\vtls)
-rem %3 - Source filename
-rem %4 - Output project file
-rem
-:element
- set "SPACES= "
- if "%2" == "lib\vauth" (
- set "TABS= "
- ) else if "%2" == "lib\vquic" (
- set "TABS= "
- ) else if "%2" == "lib\vssh" (
- set "TABS= "
- ) else if "%2" == "lib\vtls" (
- set "TABS= "
- ) else (
- set "TABS= "
- )
-
- call :extension %3 ext
-
- if "%1" == "dsp" (
- echo # Begin Source File>> %4
- echo.>> %4
- echo SOURCE=..\..\..\..\%2\%~3>> %4
- echo # End Source File>> %4
- ) else if "%1" == "vcproj1" (
- echo %TABS%^<File>> %4
- echo %TABS% RelativePath="..\..\..\..\%2\%~3"^>>> %4
- echo %TABS%^</File^>>> %4
- ) else if "%1" == "vcproj2" (
- echo %TABS%^<File>> %4
- echo %TABS% RelativePath="..\..\..\..\%2\%~3">> %4
- echo %TABS%^>>> %4
- echo %TABS%^</File^>>> %4
- ) else if "%1" == "vcxproj" (
- if "%ext%" == "c" (
- echo %SPACES%^<ClCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
- ) else if "%ext%" == "h" (
- echo %SPACES%^<ClInclude Include=^"..\..\..\..\%2\%~3^" /^>>> %4
- ) else if "%ext%" == "rc" (
- echo %SPACES%^<ResourceCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
- )
- )
-
- exit /B
-
-rem Returns the extension for a given filename.
-rem
-rem %1 - The filename
-rem %2 - The return value
-rem
-:extension
- set fname=%~1
- set ename=
-:loop1
- if "%fname%"=="" (
- set %2=
- exit /B
- )
-
- if not "%fname:~-1%"=="." (
- set ename=%fname:~-1%%ename%
- set fname=%fname:~0,-1%
- goto loop1
- )
-
- set %2=%ename%
- exit /B
-
-rem Removes the given project file.
-rem
-rem %1 - The filename
-rem
-:clean
- echo * %CD%\%1
-
- if exist %1 (
- del %1
- )
-
- exit /B
-
-:syntax
- rem Display the help
- echo.
- echo Usage: generate [what] [-clean]
- echo.
- echo What to generate:
- echo.
- echo pre - Prerequisites only
- echo vc6 - Use Visual Studio 6
- echo vc7 - Use Visual Studio .NET
- echo vc7.1 - Use Visual Studio .NET 2003
- echo vc8 - Use Visual Studio 2005
- echo vc9 - Use Visual Studio 2008
- echo vc10 - Use Visual Studio 2010
- echo vc11 - Use Visual Studio 2012
- echo vc12 - Use Visual Studio 2013
- echo vc14 - Use Visual Studio 2015
- echo vc15 - Use Visual Studio 2017
- echo.
- echo -clean - Removes the project files
- goto error
-
-:unknown
- echo.
- echo Error: Unknown argument '%1'
- goto error
-
-:nodos
- echo.
- echo Error: Only a Windows NT based Operating System is supported
- goto error
-
-:nonetdrv
- echo.
- echo Error: This batch file cannot run from a network drive
- goto error
-
-:norepo
- echo.
- echo Error: This batch file should only be used from a curl git repository
- goto error
-
-:seterr
- rem Set the caller's errorlevel.
- rem %1[opt]: Errorlevel as integer.
- rem If %1 is empty the errorlevel will be set to 0.
- rem If %1 is not empty and not an integer the errorlevel will be set to 1.
- setlocal
- set EXITCODE=%~1
- if not defined EXITCODE set EXITCODE=0
- echo %EXITCODE%|findstr /r "[^0-9\-]" 1>NUL 2>&1
- if %ERRORLEVEL% EQU 0 set EXITCODE=1
- exit /b %EXITCODE%
-
-:error
- if "%OS%" == "Windows_NT" endlocal
- exit /B 1
-
-:success
- endlocal
- exit /B 0
+@echo off
+rem ***************************************************************************
+rem * _ _ ____ _
+rem * Project ___| | | | _ \| |
+rem * / __| | | | |_) | |
+rem * | (__| |_| | _ <| |___
+rem * \___|\___/|_| \_\_____|
+rem *
+rem * Copyright (C) 2014 - 2020, Steve Holme, <steve_holme@hotmail.com>.
+rem *
+rem * This software is licensed as described in the file COPYING, which
+rem * you should have received as part of this distribution. The terms
+rem * are also available at https://curl.se/docs/copyright.html.
+rem *
+rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+rem * copies of the Software, and permit persons to whom the Software is
+rem * furnished to do so, under the terms of the COPYING file.
+rem *
+rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+rem * KIND, either express or implied.
+rem *
+rem ***************************************************************************
+
+:begin
+ rem Check we are running on a Windows NT derived OS
+ if not "%OS%" == "Windows_NT" goto nodos
+
+ rem Set our variables
+ setlocal ENABLEEXTENSIONS
+ set VERSION=ALL
+ set MODE=GENERATE
+
+ rem Check we are not running on a network drive
+ if "%~d0."=="\\." goto nonetdrv
+
+ rem Switch to this batch file's directory
+ cd /d "%~0\.." 1>NUL 2>&1
+
+ rem Check we are running from a curl git repository
+ if not exist ..\GIT-INFO goto norepo
+
+:parseArgs
+ if "%~1" == "" goto start
+
+ if /i "%~1" == "pre" (
+ set VERSION=PRE
+ ) else if /i "%~1" == "vc6" (
+ set VERSION=VC6
+ ) else if /i "%~1" == "vc7" (
+ set VERSION=VC7
+ ) else if /i "%~1" == "vc7.1" (
+ set VERSION=VC7.1
+ ) else if /i "%~1" == "vc8" (
+ set VERSION=VC8
+ ) else if /i "%~1" == "vc9" (
+ set VERSION=VC9
+ ) else if /i "%~1" == "vc10" (
+ set VERSION=VC10
+ ) else if /i "%~1" == "vc11" (
+ set VERSION=VC11
+ ) else if /i "%~1" == "vc12" (
+ set VERSION=VC12
+ ) else if /i "%~1" == "vc14" (
+ set VERSION=VC14
+ ) else if /i "%~1" == "vc15" (
+ set VERSION=VC15
+ ) else if /i "%~1" == "-clean" (
+ set MODE=CLEAN
+ ) else if /i "%~1" == "-?" (
+ goto syntax
+ ) else if /i "%~1" == "-h" (
+ goto syntax
+ ) else if /i "%~1" == "-help" (
+ goto syntax
+ ) else (
+ goto unknown
+ )
+
+ shift & goto parseArgs
+
+:start
+ if exist ..\buildconf.bat (
+ if "%MODE%" == "GENERATE" (
+ call ..\buildconf
+ ) else if "%VERSION%" == "PRE" (
+ call ..\buildconf -clean
+ ) else if "%VERSION%" == "ALL" (
+ call ..\buildconf -clean
+ )
+ )
+ if "%VERSION%" == "PRE" goto success
+ if "%VERSION%" == "VC6" goto vc6
+ if "%VERSION%" == "VC7" goto vc7
+ if "%VERSION%" == "VC7.1" goto vc71
+ if "%VERSION%" == "VC8" goto vc8
+ if "%VERSION%" == "VC9" goto vc9
+ if "%VERSION%" == "VC10" goto vc10
+ if "%VERSION%" == "VC11" goto vc11
+ if "%VERSION%" == "VC12" goto vc12
+ if "%VERSION%" == "VC14" goto vc14
+ if "%VERSION%" == "VC15" goto vc15
+
+:vc6
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC6 project files
+ call :generate dsp Windows\VC6\src\curl.tmpl Windows\VC6\src\curl.dsp
+ call :generate dsp Windows\VC6\lib\libcurl.tmpl Windows\VC6\lib\libcurl.dsp
+ ) else (
+ echo Removing VC6 project files
+ call :clean Windows\VC6\src\curl.dsp
+ call :clean Windows\VC6\lib\libcurl.dsp
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc7
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC7 project files
+ call :generate vcproj1 Windows\VC7\src\curl.tmpl Windows\VC7\src\curl.vcproj
+ call :generate vcproj1 Windows\VC7\lib\libcurl.tmpl Windows\VC7\lib\libcurl.vcproj
+ ) else (
+ echo Removing VC7 project files
+ call :clean Windows\VC7\src\curl.vcproj
+ call :clean Windows\VC7\lib\libcurl.vcproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc71
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC7.1 project files
+ call :generate vcproj1 Windows\VC7.1\src\curl.tmpl Windows\VC7.1\src\curl.vcproj
+ call :generate vcproj1 Windows\VC7.1\lib\libcurl.tmpl Windows\VC7.1\lib\libcurl.vcproj
+ ) else (
+ echo Removing VC7.1 project files
+ call :clean Windows\VC7.1\src\curl.vcproj
+ call :clean Windows\VC7.1\lib\libcurl.vcproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc8
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC8 project files
+ call :generate vcproj2 Windows\VC8\src\curl.tmpl Windows\VC8\src\curl.vcproj
+ call :generate vcproj2 Windows\VC8\lib\libcurl.tmpl Windows\VC8\lib\libcurl.vcproj
+ ) else (
+ echo Removing VC8 project files
+ call :clean Windows\VC8\src\curl.vcproj
+ call :clean Windows\VC8\lib\libcurl.vcproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc9
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC9 project files
+ call :generate vcproj2 Windows\VC9\src\curl.tmpl Windows\VC9\src\curl.vcproj
+ call :generate vcproj2 Windows\VC9\lib\libcurl.tmpl Windows\VC9\lib\libcurl.vcproj
+ ) else (
+ echo Removing VC9 project files
+ call :clean Windows\VC9\src\curl.vcproj
+ call :clean Windows\VC9\lib\libcurl.vcproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc10
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC10 project files
+ call :generate vcxproj Windows\VC10\src\curl.tmpl Windows\VC10\src\curl.vcxproj
+ call :generate vcxproj Windows\VC10\lib\libcurl.tmpl Windows\VC10\lib\libcurl.vcxproj
+ ) else (
+ echo Removing VC10 project files
+ call :clean Windows\VC10\src\curl.vcxproj
+ call :clean Windows\VC10\lib\libcurl.vcxproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc11
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC11 project files
+ call :generate vcxproj Windows\VC11\src\curl.tmpl Windows\VC11\src\curl.vcxproj
+ call :generate vcxproj Windows\VC11\lib\libcurl.tmpl Windows\VC11\lib\libcurl.vcxproj
+ ) else (
+ echo Removing VC11 project files
+ call :clean Windows\VC11\src\curl.vcxproj
+ call :clean Windows\VC11\lib\libcurl.vcxproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc12
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC12 project files
+ call :generate vcxproj Windows\VC12\src\curl.tmpl Windows\VC12\src\curl.vcxproj
+ call :generate vcxproj Windows\VC12\lib\libcurl.tmpl Windows\VC12\lib\libcurl.vcxproj
+ ) else (
+ echo Removing VC12 project files
+ call :clean Windows\VC12\src\curl.vcxproj
+ call :clean Windows\VC12\lib\libcurl.vcxproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc14
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC14 project files
+ call :generate vcxproj Windows\VC14\src\curl.tmpl Windows\VC14\src\curl.vcxproj
+ call :generate vcxproj Windows\VC14\lib\libcurl.tmpl Windows\VC14\lib\libcurl.vcxproj
+ ) else (
+ echo Removing VC14 project files
+ call :clean Windows\VC14\src\curl.vcxproj
+ call :clean Windows\VC14\lib\libcurl.vcxproj
+ )
+
+ if not "%VERSION%" == "ALL" goto success
+
+:vc15
+ echo.
+
+ if "%MODE%" == "GENERATE" (
+ echo Generating VC15 project files
+ call :generate vcxproj Windows\VC15\src\curl.tmpl Windows\VC15\src\curl.vcxproj
+ call :generate vcxproj Windows\VC15\lib\libcurl.tmpl Windows\VC15\lib\libcurl.vcxproj
+ ) else (
+ echo Removing VC15 project files
+ call :clean Windows\VC15\src\curl.vcxproj
+ call :clean Windows\VC15\lib\libcurl.vcxproj
+ )
+
+ goto success
+
+rem Main generate function.
+rem
+rem %1 - Project Type (dsp for VC6, vcproj1 for VC7 and VC7.1, vcproj2 for VC8 and VC9
+rem or vcxproj for VC10, VC11, VC12, VC14 and VC15)
+rem %2 - Input template file
+rem %3 - Output project file
+rem
+:generate
+ if not exist %2 (
+ echo.
+ echo Error: Cannot open %2
+ exit /B
+ )
+
+ if exist %3 (
+ del %3
+ )
+
+ echo * %CD%\%3
+ for /f "usebackq delims=" %%i in (`"findstr /n ^^ %2"`) do (
+ set "var=%%i"
+ setlocal enabledelayedexpansion
+ set "var=!var:*:=!"
+
+ if "!var!" == "CURL_SRC_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\src\*.c') do call :element %1 src "%%c" %3
+ ) else if "!var!" == "CURL_SRC_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\src\*.h') do call :element %1 src "%%h" %3
+ ) else if "!var!" == "CURL_SRC_RC_FILES" (
+ for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element %1 src "%%r" %3
+ ) else if "!var!" == "CURL_SRC_X_C_FILES" (
+ call :element %1 lib "strtoofft.c" %3
+ call :element %1 lib "nonblock.c" %3
+ call :element %1 lib "warnless.c" %3
+ call :element %1 lib "curl_ctype.c" %3
+ call :element %1 lib "curl_multibyte.c" %3
+ call :element %1 lib "version_win32.c" %3
+ call :element %1 lib "dynbuf.c" %3
+ ) else if "!var!" == "CURL_SRC_X_H_FILES" (
+ call :element %1 lib "config-win32.h" %3
+ call :element %1 lib "curl_setup.h" %3
+ call :element %1 lib "strtoofft.h" %3
+ call :element %1 lib "nonblock.h" %3
+ call :element %1 lib "warnless.h" %3
+ call :element %1 lib "curl_ctype.h" %3
+ call :element %1 lib "curl_multibyte.h" %3
+ call :element %1 lib "version_win32.h" %3
+ call :element %1 lib "dynbuf.h" %3
+ ) else if "!var!" == "CURL_LIB_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element %1 lib "%%c" %3
+ ) else if "!var!" == "CURL_LIB_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\include\curl\*.h') do call :element %1 include\curl "%%h" %3
+ for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element %1 lib "%%h" %3
+ ) else if "!var!" == "CURL_LIB_RC_FILES" (
+ for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib "%%r" %3
+ ) else if "!var!" == "CURL_LIB_VAUTH_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\lib\vauth\*.c') do call :element %1 lib\vauth "%%c" %3
+ ) else if "!var!" == "CURL_LIB_VAUTH_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\lib\vauth\*.h') do call :element %1 lib\vauth "%%h" %3
+ ) else if "!var!" == "CURL_LIB_VQUIC_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\lib\vquic\*.c') do call :element %1 lib\vquic "%%c" %3
+ ) else if "!var!" == "CURL_LIB_VQUIC_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\lib\vquic\*.h') do call :element %1 lib\vquic "%%h" %3
+ ) else if "!var!" == "CURL_LIB_VSSH_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\lib\vssh\*.c') do call :element %1 lib\vssh "%%c" %3
+ ) else if "!var!" == "CURL_LIB_VSSH_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\lib\vssh\*.h') do call :element %1 lib\vssh "%%h" %3
+ ) else if "!var!" == "CURL_LIB_VTLS_C_FILES" (
+ for /f "delims=" %%c in ('dir /b ..\lib\vtls\*.c') do call :element %1 lib\vtls "%%c" %3
+ ) else if "!var!" == "CURL_LIB_VTLS_H_FILES" (
+ for /f "delims=" %%h in ('dir /b ..\lib\vtls\*.h') do call :element %1 lib\vtls "%%h" %3
+ ) else (
+ echo.!var!>> %3
+ )
+
+ endlocal
+ )
+ exit /B
+
+rem Generates a single file xml element.
+rem
+rem %1 - Project Type (dsp for VC6, vcproj1 for VC7 and VC7.1, vcproj2 for VC8 and VC9
+rem or vcxproj for VC10, VC11, VC12, VC14 and VC15)
+rem %2 - Directory (src, lib, lib\vauth, lib\vquic, lib\vssh, lib\vtls)
+rem %3 - Source filename
+rem %4 - Output project file
+rem
+:element
+ set "SPACES= "
+ if "%2" == "lib\vauth" (
+ set "TABS= "
+ ) else if "%2" == "lib\vquic" (
+ set "TABS= "
+ ) else if "%2" == "lib\vssh" (
+ set "TABS= "
+ ) else if "%2" == "lib\vtls" (
+ set "TABS= "
+ ) else (
+ set "TABS= "
+ )
+
+ call :extension %3 ext
+
+ if "%1" == "dsp" (
+ echo # Begin Source File>> %4
+ echo.>> %4
+ echo SOURCE=..\..\..\..\%2\%~3>> %4
+ echo # End Source File>> %4
+ ) else if "%1" == "vcproj1" (
+ echo %TABS%^<File>> %4
+ echo %TABS% RelativePath="..\..\..\..\%2\%~3"^>>> %4
+ echo %TABS%^</File^>>> %4
+ ) else if "%1" == "vcproj2" (
+ echo %TABS%^<File>> %4
+ echo %TABS% RelativePath="..\..\..\..\%2\%~3">> %4
+ echo %TABS%^>>> %4
+ echo %TABS%^</File^>>> %4
+ ) else if "%1" == "vcxproj" (
+ if "%ext%" == "c" (
+ echo %SPACES%^<ClCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
+ ) else if "%ext%" == "h" (
+ echo %SPACES%^<ClInclude Include=^"..\..\..\..\%2\%~3^" /^>>> %4
+ ) else if "%ext%" == "rc" (
+ echo %SPACES%^<ResourceCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
+ )
+ )
+
+ exit /B
+
+rem Returns the extension for a given filename.
+rem
+rem %1 - The filename
+rem %2 - The return value
+rem
+:extension
+ set fname=%~1
+ set ename=
+:loop1
+ if "%fname%"=="" (
+ set %2=
+ exit /B
+ )
+
+ if not "%fname:~-1%"=="." (
+ set ename=%fname:~-1%%ename%
+ set fname=%fname:~0,-1%
+ goto loop1
+ )
+
+ set %2=%ename%
+ exit /B
+
+rem Removes the given project file.
+rem
+rem %1 - The filename
+rem
+:clean
+ echo * %CD%\%1
+
+ if exist %1 (
+ del %1
+ )
+
+ exit /B
+
+:syntax
+ rem Display the help
+ echo.
+ echo Usage: generate [what] [-clean]
+ echo.
+ echo What to generate:
+ echo.
+ echo pre - Prerequisites only
+ echo vc6 - Use Visual Studio 6
+ echo vc7 - Use Visual Studio .NET
+ echo vc7.1 - Use Visual Studio .NET 2003
+ echo vc8 - Use Visual Studio 2005
+ echo vc9 - Use Visual Studio 2008
+ echo vc10 - Use Visual Studio 2010
+ echo vc11 - Use Visual Studio 2012
+ echo vc12 - Use Visual Studio 2013
+ echo vc14 - Use Visual Studio 2015
+ echo vc15 - Use Visual Studio 2017
+ echo.
+ echo -clean - Removes the project files
+ goto error
+
+:unknown
+ echo.
+ echo Error: Unknown argument '%1'
+ goto error
+
+:nodos
+ echo.
+ echo Error: Only a Windows NT based Operating System is supported
+ goto error
+
+:nonetdrv
+ echo.
+ echo Error: This batch file cannot run from a network drive
+ goto error
+
+:norepo
+ echo.
+ echo Error: This batch file should only be used from a curl git repository
+ goto error
+
+:seterr
+ rem Set the caller's errorlevel.
+ rem %1[opt]: Errorlevel as integer.
+ rem If %1 is empty the errorlevel will be set to 0.
+ rem If %1 is not empty and not an integer the errorlevel will be set to 1.
+ setlocal
+ set EXITCODE=%~1
+ if not defined EXITCODE set EXITCODE=0
+ echo %EXITCODE%|findstr /r "[^0-9\-]" 1>NUL 2>&1
+ if %ERRORLEVEL% EQU 0 set EXITCODE=1
+ exit /b %EXITCODE%
+
+:error
+ if "%OS%" == "Windows_NT" endlocal
+ exit /B 1
+
+:success
+ endlocal
+ exit /B 0