Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Choosing A Toolchain ====== There are currently 3 toolchains for PSP development in C/C++, Rust, and Zig. Each one is slightly different, and has a different process to set up. Below are instructions for each, and on popular platforms. Nothing prevents you from having all 3 at once, so feel free to experiment! ===== C/C++ ===== === Windows === To install the toolchain on Windows XP and higher, you can go download the installer [[https://darksectordds.github.io/html/MinimalistPSPSDK/index.html|here]]. Once you have installed the PSPSDK, which should be located at C:/pspsdk. We need to add this to our path by going to Windows Icon -> Search -> Set Environmental Variables -> System Environmental Variables -> Set Path to include C:/pspsdk/bin. For modern Windows, this is rather simple - you just need to add a new entry in the list. On older versions, you need to add a semi-colon to the end of the path, then add the direct location. Congratulations! You now have a working installation! === Unix-Based OS === You'll want to make sure you've installed developer tools including git. To get the toolchain, you will need to run <code>git clone https://github.com/pspdev/pspdev.git</code> If you use Linux, use the prepare script according to your distro. For example, on Ubuntu/Debian you can use the ./prepare-debian-ubuntu.sh to get all dependencies (Also make sure to set your terminal to avoid using dash, as it will create issues) If you're on Mac OS, you'll need Ports or Homebrew to develop. After that, you can use the ./prepare-mac-os.sh in order to get all of your dependencies. If you're not on either, you will need the following packages: <code>autoconf, automake, bison, bzip2, cmake, doxygen, diffutils, flex, g++/gcc-c++, gcc, git, gzip, libarchive, libcurl, libelf, libgpgme, libssl, libtool, libusb-dev, m4, make, ncurses, patch, pkg-config, python3, readline, subversion, tar, tcl, texinfo, unzip, wget, xz-utils</code> To setup your working directory: <code> export PSPDEV=/usr/local/pspdev sudo mkdir -p $PSPDEV sudo chown -R $USER: $PSPDEV </code> And in your login script: <code> export PSPDEV=/usr/local/pspdev export PATH=$PATH:$PSPDEV/bin </code> Once that's done you'll need to initiate compilation with: <code>sudo ./build-all.sh</code> After installation, you need to add your toolchain to path with <code>export PATH=$PATH:/usr/local/pspdev/bin</code> or use the login script as described earlier. Congratulations! You now have a working installation! ===== Rust ===== To install Rust on your computer, you'll need to head to the official Rust installer, ''[[https://rustup.rs/|rustup]]''. Follow the instructions and install Rust. If you're on Windows, you'll need [[https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16|Visual Studio C++ Build Tools]]. After you've finished that, you'll need to hop into your favorite terminal (or refresh your terminal instance) and set your toolchain to nightly and add the ''rust-src'' component. Then, we'll install ''cargo-psp''. <code> rustup default nightly rustup component add rust-src cargo install cargo-psp </code> This will set your default Rust toolchain to be ''nightly''. You can also do a per-project override with the following commands: <code> cargo new my-psp-app cd my-psp-app rustup override set nightly </code> Finally, add the ''[[https://lib.rs/crates/psp|psp]]'' crate to your ''Cargo.toml''. Now you've got a working PSP Toolchain in Rust! ===== Zig ===== For working with Zig-PSP, all you need is the v0.8.1 of the Zig compiler installed. You can find the downloads here [[https://ziglang.org/download/|here]]. Once you've installed Zig, and it is in your path (see above), make sure you also have git installed for general repository work. You'll need to make a copy of the GitHub template with the following command: <code> git clone https://github.com/zPSP-Dev/Zig-PSP-Template.git --recursive </code> And there you have it! You should have everything required to get started with Zig. tutorial/toolchain_setup.txt Last modified: 2022/09/26 23:12by iridescence