oh no

i think the prefab djgpp+allegro dos cross compiler i have doesn't recognize 0b binary constants

oh noooooo

after several hours of messing around i have djgpp with a modern version of gcc and allegro 4.2.2 on windows (with soundblaster fix) as well as a test program in dos working!

instructions will be in my next post(s)

#RetroComputing #DOS #RetroDev

i got djgpp binaries from https://github.com/andrewwutw/build-djgpp

and allegro 4 source from https://github.com/msikma/allegro-4.2.2-xc

then i edited xmake.sh to point at djgpp and ran ./xmake.sh lib

but it turns out i needed dependencies anyway so i used this from build-djgpp's readme:

sudo apt-get update
sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip

and then it worked, leaving liballeg.a in lib/djgpp

GitHub - andrewwutw/build-djgpp: Build DJGPP cross compiler and binutils on Windows (MinGW/Cygwin), Mac OSX and Linux

Build DJGPP cross compiler and binutils on Windows (MinGW/Cygwin), Mac OSX and Linux - andrewwutw/build-djgpp

GitHub

i then copied liballeg.a and the include folder from allegro to my windows box where i put liballeg.a in \lib\ and the includes in \include\ folders inside the djgpp folder that i got from the DJGPP for MinGW standalone binaries

i then took this allegro test from here https://github.com/msikma/allegro-dos-example/blob/master/src/main.c

and used i586-pc-msdosdjgpp-gcc to compile it. made a batch file for it which you can find below

oh and i *think* you might want -march=i386 -mtune=i386 cause the prefix for this is i586-pc-msdosdjgpp- and i586 is pentium so idk if it compiles 386/486 compatible binaries without that?
Gosh allegro is annoying. I had to define AL_INLINE to work around inlining/duplicate definition issues. I'll post about it in more detail when I'm actually at my computer again
@eniko Oooo allegro + djgpp. Brings back memories. ... 2002 ... CT simulator for a medical imaging course.