Skip to content

Commit

Permalink
Update the scripts to build bochscpu-ffi on Windows and Linux (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
0vercl0k authored Aug 17, 2022
1 parent d7477f4 commit 2bcb71c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
27 changes: 11 additions & 16 deletions src/libs/bochscpu-bins/build-bochscpu.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
REM # Axel '0vercl0k' Souchet - May 2 2020
REM This assume to be run from the libs directory.
REM OK here is a bunch of stuff to understand about the structure of the repositories.
REM - bochscpu is the repository that users are supposed to use. Because @ypr604 is such
REM a nice person it is designed to not have to build bochs. So what this repo expects is to
REM find a 'lib' directory with a bunch of .lib as well as a 'bochs' folder which contains bochs'
REM sources as well as the object files generated during compilation etc. So in that case, you
REM would download an archive that has those 'bochs' / 'lib' folder and build bochscpu-ffi (which
REM builds bochscpu for you).
REM - If you want to build it yourself though, there is bochscpu-build which clones the svn repo
REM and where you actually compile bochs. Once you are done with it you drop the .lib I mentioned
REM above in the bochscpu 'lib' folder, same with the 'bochs' tree.
REM
REM If you want to enable source debugging, you can set _CL_=/Z7, set _LINK_=/DEBUG:FULL.
REM set _CL_=/Z7
REM set _LINK_=/DEBUG:FULL

REM Use WSL to configure / clone the bochs repository.
bash -c "cd bochscpu-build && sh prep.sh && cd bochs && sh .conf.cpu-msvc"
pushd .

mkdir bxbuild-win
cd bxbuild-win

REM Use WSL to configure / clone the repositories.
bash -c "git clone https://github.com/yrp604/bochscpu-build.git && git clone https://github.com/yrp604/bochscpu && git clone https://github.com/yrp604/bochscpu-ffi && cd bochscpu-build && bash prep.sh && cd bochs && bash .conf.cpu-msvc"

REM Build bochs; libinstrument.a is expected to fail to build so don't freak out.
REM You can run nmake all-clean to clean up the build.
Expand Down Expand Up @@ -43,5 +38,5 @@ cargo clean
cargo build
cargo build --release

REM Get back to libs.
cd ..
REM Get back to where we were.
popd
17 changes: 13 additions & 4 deletions src/libs/bochscpu-bins/build-bochscpu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# Axel '0vercl0k' Souchet - May 2 2020
# Configure / clone the bochs repository.
# Build / configure bxcpu-ffi
pushd .

mkdir bxbuild-lin
cd bxbuild-lin

git clone https://github.com/yrp604/bochscpu-build.git
git clone https://github.com/yrp604/bochscpu
git clone https://github.com/yrp604/bochscpu-ffi

cd bochscpu-build
export BOCHS_REV=14331 && sh prep.sh && cd bochs && sh .conf.cpu && make || true
bash prep.sh && cd bochs && sh .conf.cpu && make || true

# Remove old files in bochscpu.
rm -rf ../../bochscpu/bochs
Expand All @@ -26,5 +35,5 @@ cargo clean
cargo build
cargo build --release

# Get back to libs.
cd ..
# Get back to where we were.
popd

0 comments on commit 2bcb71c

Please sign in to comment.