forked from wolfSSL/wolfssl
copy errors are now only warnings
This commit is contained in:
@ -14,6 +14,7 @@ echo "mklink [[/d] | [/h] | [/j]] <link> <target>"
|
|||||||
echo;
|
echo;
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
|
SET COPYERROR=false
|
||||||
|
|
||||||
:: if there's a setup.sh, we are probably starting in the right place.
|
:: if there's a setup.sh, we are probably starting in the right place.
|
||||||
if NOT EXIST "setup.sh" (
|
if NOT EXIST "setup.sh" (
|
||||||
@ -107,32 +108,34 @@ if exist %WOLFSSL_ESPIDFDIR%\user_settings.h (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
:: do we really want to erase existing user config?
|
::******************************************************************************************************
|
||||||
|
:: check if there's already an existing %WOLFSSLLIB_TRG_DIR% and confirm removal
|
||||||
|
::******************************************************************************************************
|
||||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||||
echo;
|
echo;
|
||||||
echo WARNING: Existing files found in %WOLFSSLLIB_TRG_DIR%
|
echo WARNING: Existing files found in %WOLFSSLLIB_TRG_DIR%
|
||||||
echo;
|
echo;
|
||||||
|
|
||||||
:: clear any prior errorlevel
|
:: clear any prior errorlevel
|
||||||
call;
|
call;
|
||||||
choice /c YN /m "Delete files and proceed with install in %WOLFSSLLIB_TRG_DIR% "
|
choice /c YN /m "Delete files and proceed with install in %WOLFSSLLIB_TRG_DIR% "
|
||||||
if errorlevel 2 GOTO :NODELETE
|
if errorlevel 2 GOTO :NODELETE
|
||||||
GOTO :PURGE
|
GOTO :PURGE
|
||||||
|
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Ready to copy files into %IDF_PATH%
|
echo Ready to copy files into %IDF_PATH%
|
||||||
|
|
||||||
|
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
:NODELETE
|
:NODELETE
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
:: clear any prior errorlevel
|
:: clear any prior errorlevel
|
||||||
echo;
|
echo;
|
||||||
call;
|
call;
|
||||||
choice /c YN /m "Refresh files %WOLFSSLLIB_TRG_DIR% (there will be a prompt to keep or overwrite user_settings and config) "
|
choice /c YN /m "Refresh files %WOLFSSLLIB_TRG_DIR% (there will be a prompt to keep or overwrite user_settings and config) "
|
||||||
if errorlevel 2 GOTO :NOCOPY
|
if errorlevel 2 GOTO :NOCOPY
|
||||||
GOTO :REFRESH
|
GOTO :REFRESH
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -142,22 +145,22 @@ echo Ready to copy files into %IDF_PATH%
|
|||||||
:: purge existing directory
|
:: purge existing directory
|
||||||
|
|
||||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||||
echo;
|
|
||||||
echo Removing %WOLFSSLLIB_TRG_DIR%
|
|
||||||
rmdir %WOLFSSLLIB_TRG_DIR% /S /Q
|
|
||||||
if exist %WOLFSSLLIB_TRG_DIR% (
|
|
||||||
echo;
|
echo;
|
||||||
echo ERROR: Failed to remove %WOLFSSLLIB_TRG_DIR%
|
echo Removing %WOLFSSLLIB_TRG_DIR%
|
||||||
echo;
|
rmdir %WOLFSSLLIB_TRG_DIR% /S /Q
|
||||||
echo Check permissions, open files, read-only attributes, etc.
|
if exist %WOLFSSLLIB_TRG_DIR% (
|
||||||
echo;
|
SET COPYERROR=true
|
||||||
GOTO :ERR
|
echo;
|
||||||
)
|
echo WARNING: Failed to remove %WOLFSSLLIB_TRG_DIR%
|
||||||
echo;
|
echo;
|
||||||
|
echo Check permissions, open files, read-only attributes, etc.
|
||||||
|
echo;
|
||||||
|
)
|
||||||
|
echo;
|
||||||
) else (
|
) else (
|
||||||
echo;
|
echo;
|
||||||
echo Prior %WOLFSSLLIB_TRG_DIR% not found, installing fresh.
|
echo Prior %WOLFSSLLIB_TRG_DIR% not found, installing fresh.
|
||||||
echo;
|
echo;
|
||||||
)
|
)
|
||||||
|
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
@ -176,52 +179,52 @@ rem copying ... files in src/ into $WOLFSSLLIB_TRG_DIR%/src
|
|||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\src\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\src\
|
||||||
xcopy %BASEDIR%\src\*.c %WOLFSSLLIB_TRG_DIR%\src\ /S /E /Q /Y
|
xcopy %BASEDIR%\src\*.c %WOLFSSLLIB_TRG_DIR%\src\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying src\*.c files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
echo Copying src\*.c files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
||||||
xcopy %BASEDIR%\wolfcrypt\src\*.c %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
xcopy %BASEDIR%\wolfcrypt\src\*.c %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying src\*.i files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
echo Copying src\*.i files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
|
||||||
xcopy %BASEDIR%\wolfcrypt\src\*.i %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
xcopy %BASEDIR%\wolfcrypt\src\*.i %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\
|
||||||
xcopy %BASEDIR%\wolfcrypt\src\port %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfcrypt\src\port %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
|
||||||
xcopy %BASEDIR%\wolfcrypt\test %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfcrypt\test %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
rem Copy dummy test_paths.h to handle the case configure hasn't yet executed
|
rem Copy dummy test_paths.h to handle the case configure hasn't yet executed
|
||||||
echo F |xcopy %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h /S /E /Y
|
echo F |xcopy %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h /S /E /Y
|
||||||
xcopy %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLIB_TRG_DIR%\wolfcrypt\test\test_paths.h /S /E /Y
|
xcopy %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLIB_TRG_DIR%\wolfcrypt\test\test_paths.h /S /E /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\
|
||||||
xcopy %BASEDIR%\wolfcrypt\benchmark %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfcrypt\benchmark %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\
|
||||||
xcopy %BASEDIR%\wolfssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to%WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\
|
echo Copying files to%WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\
|
||||||
xcopy %BASEDIR%\wolfssl\openssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfssl\openssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
echo;
|
echo;
|
||||||
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\
|
echo Copying files to %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\
|
||||||
xcopy %BASEDIR%\wolfssl\wolfcrypt %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\ /S /E /Q /Y
|
xcopy %BASEDIR%\wolfssl\wolfcrypt %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\ /S /E /Q /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
|
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
@ -231,27 +234,27 @@ if %errorlevel% NEQ 0 GOTO :COPYERR
|
|||||||
echo;
|
echo;
|
||||||
echo Copying default user_settings.h to %WOLFSSLLIB_TRG_DIR%\include\
|
echo Copying default user_settings.h to %WOLFSSLLIB_TRG_DIR%\include\
|
||||||
xcopy %WOLFSSL_ESPIDFDIR%\user_settings.h %WOLFSSLLIB_TRG_DIR%\include\ /F
|
xcopy %WOLFSSL_ESPIDFDIR%\user_settings.h %WOLFSSLLIB_TRG_DIR%\include\ /F
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
:: echo Creating new config file: %WOLFSSLLIB_TRG_DIR%\include\config.h (default, may be overwritten by prior file)
|
:: echo Creating new config file: %WOLFSSLLIB_TRG_DIR%\include\config.h (default, may be overwritten by prior file)
|
||||||
echo new config > %WOLFSSLLIB_TRG_DIR%\include\config.h
|
echo new config > %WOLFSSLLIB_TRG_DIR%\include\config.h
|
||||||
xcopy %WOLFSSL_ESPIDFDIR%\dummy_config_h. %WOLFSSLLIB_TRG_DIR%\include\config.h /F /Y
|
xcopy %WOLFSSL_ESPIDFDIR%\dummy_config_h. %WOLFSSLLIB_TRG_DIR%\include\config.h /F /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
|
|
||||||
:: Check if operator wants to keep prior config.h
|
:: Check if operator wants to keep prior config.h
|
||||||
if EXIST config_h_%FileStamp%.bak (
|
if EXIST config_h_%FileStamp%.bak (
|
||||||
echo;
|
echo;
|
||||||
:: clear any prior errorlevel
|
:: clear any prior errorlevel
|
||||||
call;
|
call;
|
||||||
choice /c YN /m "Use your prior config.h "
|
choice /c YN /m "Use your prior config.h "
|
||||||
if errorlevel 2 GOTO :NO_CONFIG_RESTORE
|
if errorlevel 2 GOTO :NO_CONFIG_RESTORE
|
||||||
xcopy config_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\config.h /Y
|
xcopy config_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\config.h /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
) else (
|
) else (
|
||||||
echo;
|
echo;
|
||||||
echo Prior config.h not found. Using default file.
|
echo Prior config.h not found. Using default file.
|
||||||
)
|
)
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
:NO_CONFIG_RESTORE
|
:NO_CONFIG_RESTORE
|
||||||
@ -259,17 +262,17 @@ if EXIST config_h_%FileStamp%.bak (
|
|||||||
|
|
||||||
:: Check if operator wants to keep prior config.h
|
:: Check if operator wants to keep prior config.h
|
||||||
if EXIST user_settings_h_%FileStamp%.bak (
|
if EXIST user_settings_h_%FileStamp%.bak (
|
||||||
echo;
|
echo;
|
||||||
:: clear any prior errorlevel
|
:: clear any prior errorlevel
|
||||||
call;
|
call;
|
||||||
choice /c YN /m "User your prior user_settings.h "
|
choice /c YN /m "User your prior user_settings.h "
|
||||||
if errorlevel 2 GOTO :NO_USER_SETTINGS_RESTORE
|
if errorlevel 2 GOTO :NO_USER_SETTINGS_RESTORE
|
||||||
xcopy user_settings_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\user_settings.h /Y
|
xcopy user_settings_h_%FileStamp%.bak %WOLFSSLLIB_TRG_DIR%\include\user_settings.h /Y
|
||||||
if %errorlevel% NEQ 0 GOTO :COPYERR
|
if %errorlevel% NEQ 0 SET COPYERROR=true
|
||||||
|
|
||||||
) else (
|
) else (
|
||||||
echo;
|
echo;
|
||||||
echo Prior user_settings.h not found. Using default file.
|
echo Prior user_settings.h not found. Using default file.
|
||||||
)
|
)
|
||||||
|
|
||||||
::******************************************************************************************************
|
::******************************************************************************************************
|
||||||
@ -384,4 +387,9 @@ echo See additional examples at https://github.com/wolfSSL/wolfssl-examples
|
|||||||
echo;
|
echo;
|
||||||
echo REMINDER: Ensure any wolfSSL #include definitions occur BEFORE include files in your source code.
|
echo REMINDER: Ensure any wolfSSL #include definitions occur BEFORE include files in your source code.
|
||||||
echo;
|
echo;
|
||||||
|
if "%COPYERROR%" == "true" (
|
||||||
|
echo;
|
||||||
|
echo WARNING: Copy completed with errors! Check for files in use, permissions, symbolic links, etc.
|
||||||
|
echo;
|
||||||
|
)
|
||||||
echo setup_win.bat for ESP-IDF completed.
|
echo setup_win.bat for ESP-IDF completed.
|
||||||
|
Reference in New Issue
Block a user