LDC has made this process very simple!
First, go install devkitPro like normal. Make sure to install 3DS support!
Then, clone this repo.
git clone https://github.com/TheGag96/3ds-hello-dlang
Go download/install the latest version of LDC.
Inside the Makefile, notice find line:
export LDC := ldc2
Edit this to be command/path to your LDC executable if need be.
Then, finally...
cd /path/to/3ds-hello-dlang
make
This is how I first got this working, though I don't recommend it due to how difficult it is and how outdated GDC is.
First, go install devkitPro like normal. Make sure to install 3DS support!
Then, clone this repo.
git clone https://github.com/TheGag96/3ds-hello-dlang
Grab the devkitPro buildscripts repo:
git clone https://github.com/devkitPro/buildscripts
cd buildscripts
Follow the "Preparing to build" section in README.txt for your system.
Edit the file dkarm-eabi/scripts/build-gcc.sh
and add d
to the list of enabled languages:
../../gcc-$GCC_VER/configure \
--enable-languages=c,c++,objc,lto,d \
--with-gnu-as --with-gnu-ld --with-gcc \
--with-march=armv4t\
When you're ready to build, do...
./build-devkit.sh
...as it says under "Building the devkits". Make sure to build devkitARM, and when prompted to enter a path to install it to, choose some folder that is NOT /opt/devkitpro
.
Let everything build. In my experience, the script halted because GDB failed to build. If so, that's fine.
Copy the contents of the devkitARM
folder you built to into /opt/devkitpro/devkitARM
sudo cp -r /path/to/my/devkitpro/devkitARM/* /opt/devkitpro/devkitARM
From another GDC installation, copy the D standard library files into the devkitARM folder (on my Ubuntu-based installation, it's in /usr/lib/gcc/x86_64-pc-linux-gnu/9.0.1/include/d
):
sudo cp -r /some/gdc/path/.../include/d /opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/9.1.0/include/
Then, finally...
cd /path/to/3ds-hello-dlang
make
If you want to use my bindings for citro3d and citro2d, follow the setup instructions to install those libraries.
-I
properly. I tried, but I couldn't override the standard library files with my hacked-up versions that way.