mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
909aa376f8
Some checks failed
build / linux-wasi (push) Failing after 0s
build / linux-wasi-api (push) Failing after 0s
build / linux-csnext (push) Failing after 0s
build / tarball (push) Failing after 0s
build / linux-static (push) Failing after 0s
build / check_abi_compatibility (push) Has been skipped
build / linux-acr-rpm-64 (push) Failing after 0s
build / linux-acr-deb (amd64) (push) Failing after 0s
build / linux-acr-deb (arm64, aarch64-linux-gnu) (push) Failing after 0s
build / linux-acr-deb (i386, multilib) (push) Failing after 0s
build / android-acr (16, arm) (push) Failing after 0s
build / android-acr (aarch64) (push) Failing after 0s
build / android-meson (x86_64) (push) Has been skipped
CI / linux-acr-oldlibsbug (push) Failing after 0s
CI / linux-nocs (push) Failing after 0s
CI / linux-acr-gperf (push) Failing after 0s
CI / linux-sys-capstone (push) Failing after 0s
CI / linux-acr-resymlink (push) Failing after 0s
CI / linux-test (push) Failing after 0s
CI / linux-static-meson (push) Failing after 0s
CI / linux-rpath (push) Failing after 0s
CI / linux-meson-spaces (push) Failing after 0s
CI / linux-tinyasan-fuzz (push) Failing after 0s
CI / linux-asan-fuzz (push) Failing after 0s
CI / w32-mingw (push) Failing after 0s
CI / w64-mingw (push) Failing after 0s
Code scanning - action / CodeQL-Build (push) Failing after 0s
Coverity Scan / latest (push) Failing after 0s
tcc / ubuntu-tcc-newabi (push) Failing after 0s
tcc / ubuntu-tcc-test (push) Failing after 0s
tcc / ubuntu-tcc-nodbg (push) Failing after 0s
tcc / r2pm-tcc (push) Failing after 0s
tcc / ubuntu-tcc-syslibs (push) Failing after 0s
Semgrep / Scan (push) Failing after 0s
build / macos-acr (arm64, 13) (push) Has been cancelled
build / macos-acr (x86_64, 12) (push) Has been cancelled
build / ios (cydia32) (push) Has been cancelled
build / ios (true, cydia) (push) Has been cancelled
build / w32-meson (push) Has been cancelled
build / w64-static-2022 (push) Has been cancelled
build / w64-static (push) Has been cancelled
build / w64-meson (push) Has been cancelled
CI / macos-test (push) Has been cancelled
CI / macos-rpath (push) Has been cancelled
CI / w64-make (push) Has been cancelled
build / check_release (push) Has been cancelled
build / release (push) Has been cancelled
159 lines
4.9 KiB
Batchfile
159 lines
4.9 KiB
Batchfile
:: This is a comment
|
|
@echo off
|
|
SETLOCAL EnableDelayedExpansion
|
|
|
|
:: Preconfigure script for Windows
|
|
|
|
echo === Finding Python...
|
|
python --version > NUL 2> NUL
|
|
if %ERRORLEVEL% == 0 (
|
|
echo OK
|
|
pip show setuptools > NUL 1> NUL
|
|
if errorlevel 1 (
|
|
echo === Installing setuptools
|
|
python -m pip install -UI pip setuptools
|
|
)
|
|
) else (
|
|
echo ERROR
|
|
echo You need to install Python from the windows store or something
|
|
exit /b 1
|
|
)
|
|
|
|
echo === Finding Git...
|
|
git --version > NUL 2> NUL
|
|
if %ERRORLEVEL% == 0 (
|
|
echo OK
|
|
) else (
|
|
echo You need to install GIT
|
|
exit /b 1
|
|
)
|
|
git pull
|
|
|
|
echo === Testing for meson and ninja...
|
|
meson --help > NUL 2> NUL
|
|
if %ERRORLEVEL% == 0 (
|
|
echo FOUND
|
|
) else (
|
|
echo === Installing pyenv + meson + ninja
|
|
python -m venv venv
|
|
call venv\Scripts\activate.bat
|
|
echo === Testing for meson and ninja...
|
|
meson --help > NUL 2> NUL
|
|
if %ERRORLEVEL% == 0 (
|
|
echo FOUND
|
|
) else (
|
|
pip install -UI pip ninja
|
|
REM meson==0.59.1
|
|
pip install git+https://github.com/frida/meson.git@f7f25b19a8d71cebf8e2934733eb041eb6862eee
|
|
preconfigure.bat
|
|
exit /b 0
|
|
)
|
|
)
|
|
|
|
REM vs uses HOST_TARGET syntax, so: x86_amd64 means 32bit compiler for 64bit target
|
|
REM: Hosts: x86 amd64 x64
|
|
REM: Targets: x86 amd64 x64 arm arm64
|
|
REM Detect the host architecture intuitively and easily
|
|
|
|
IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
SET "HOST_ARCH=amd64"
|
|
) ELSE IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|
SET "HOST_ARCH=x86"
|
|
) ELSE (
|
|
SET "HOST_ARCH=unknown"
|
|
)
|
|
|
|
REM Check if arguments are passed
|
|
IF "%~1"=="" (
|
|
echo Your current Host Architecture is !HOST_ARCH!
|
|
ECHO Please select the Target Architecture:
|
|
ECHO 1. x86
|
|
ECHO 2. amd64 [x64]
|
|
ECHO 3. arm
|
|
ECHO 4. arm64
|
|
SET /P "CHOICE=Enter your choice (1-4): "
|
|
|
|
REM Set target architecture based on user input
|
|
IF "!CHOICE!"=="1" (
|
|
SET "TARGET_ARCH=x86"
|
|
) ELSE IF "!CHOICE!"=="2" (
|
|
SET "TARGET_ARCH=amd64"
|
|
) ELSE IF "!CHOICE!"=="3" (
|
|
SET "TARGET_ARCH=arm"
|
|
) ELSE IF "!CHOICE!"=="4" (
|
|
SET "TARGET_ARCH=arm64"
|
|
) ELSE (
|
|
ECHO Invalid choice. Defaulting to arm64.
|
|
SET "TARGET_ARCH=arm64"
|
|
)
|
|
|
|
REM Check if target and host are the same and set VSARCH accordingly
|
|
IF "!TARGET_ARCH!"=="!HOST_ARCH!" (
|
|
SET "VSARCH=!HOST_ARCH!"
|
|
) ELSE (
|
|
SET "VSARCH=!HOST_ARCH!_!TARGET_ARCH!"
|
|
)
|
|
|
|
) ELSE (
|
|
REM Use provided host_target argument
|
|
SET "VSARCH=%1"
|
|
)
|
|
|
|
ECHO VSARCH is set to: !VSARCH!
|
|
|
|
echo === Finding Visual Studio...
|
|
cl --help > NUL 2> NUL
|
|
if %ERRORLEVEL% == 0 (
|
|
echo FOUND
|
|
) else if EXIST "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" (
|
|
echo "Found 2022 Enterprise edition"
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files\Microsoft Visual Studio\2022\Community" (
|
|
echo "Found 2022 Community edition"
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" (
|
|
echo "Found 2022 BuildTools"
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" (
|
|
echo "Found 2019 community edition"
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" (
|
|
echo "Found 2019 Enterprise edition"
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" (
|
|
echo "Found 2019 Professional edition"
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else if EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" (
|
|
echo "Found 2019 BuildTools"
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" %VSARCH%
|
|
) else (
|
|
echo "Not Found"
|
|
exit /b 1
|
|
)
|
|
|
|
if EXIST "libr\arch\p\arm\v35\arch-arm64" (
|
|
echo "v35arm64 ok"
|
|
) else (
|
|
pushd "libr\arch\p\arm\v35"
|
|
git clone https://github.com/radareorg/vector35-arch-arm64 arch-arm64
|
|
cd arch-arm64
|
|
git checkout radare2-wip
|
|
git reset --hard 55d73c6bbb94448a5c615933179e73ac618cf876
|
|
popd
|
|
)
|
|
|
|
if EXIST "libr\arch\p\arm\v35\arch-armv7" (
|
|
echo "v35armv7 ok"
|
|
) else (
|
|
pushd "libr\arch\p\arm\v35"
|
|
git clone https://github.com/radareorg/vector35-arch-armv7 arch-armv7
|
|
cd arch-armv7
|
|
git checkout radare2
|
|
git reset --hard f270a6cc99644cb8e76055b6fa632b25abd26024
|
|
popd
|
|
)
|
|
|
|
echo Now you can run 'configure'
|
|
ENDLOCAL
|
|
cmd
|