DOS Build script for MinGW/Win32

DOS specific questions.
Site Admin
Posts: 6190
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

DOS Build script for MinGW/Win32

Postby counting_pine » Nov 18, 2013 19:56

I've written a batch script which should be able to download the latest FreeBASIC for DOS and setup tools, and make a working version from the source code.

It is based on the instructions at

You just need to have wget and unzip available in the %path%. It also requires a recent version of the FreeBASIC source code to be available in C:\fbc-dos. It probably requires a 32-bit version of Windows so it can run the DOS programs.

I would be interested to hear how it works for people. I have only tested it on my own system, but it did not install DJGPP from scratch since I have it on my system already.

Code: Select all


set FBDOS=FreeBASIC-1.05-dos


:: Installs latest FreeBASIC for DOS to C:\%FBDOS% (where %FBDOS% is the root name of the zip file)

md C:\%FBDOS%
cd C:\%FBDOS%

wget --no-clobber
unzip -n -d C:/

:: Installs DJGPP


wget --no-clobber
unzip -n -d C:/DJGPP

for %%i in (bnu2232a bnu2232b bsh204b fil41b gcc473b gpp473b mak3791b shl2011b txt20b) do (
 wget --no-clobber
 unzip -n -d C:/DJGPP

set path=C:\DJGPP\bin;C:\%FBDOS%
set DJGPP=C:\DJGPP\djgpp.env

:: makes the latest version of FreeBASIC (source must be found in C:\fbc-dos\)

cd C:\fbc-dos
echo ENABLE_STANDALONE := YesPlease> C:\fbc-dos\
make clean

for %%i in (ar as ld) do copy C:\DJGPP\bin\%%i.exe C:\fbc-dos\bin\dos\

for %%i in (crt0 gcrt0) do copy C:\DJGPP\lib\%%i.o C:\fbc-dos\lib\
for %%i in (emu m) do copy C:\DJGPP\lib\lib%%i.a C:\fbc-dos\lib\
copy C:\DJGPP\lib\gcc\djgpp\4.73\libgcc.a C:\fbc-dos\lib\
copy C:\%FBDOS%\lib\dos\libc.a C:\fbc-dos\lib\
copy C:\DJGPP\lib\libsupcxx.a C:\fbc-dos\lib\libsupcx.a


Return to “DOS”

Who is online

Users browsing this forum: No registered users and 4 guests