@echo off
set XSRC=.
if not "%1" == "" set XSRC=%1
test -d %XSRC%
if not errorlevel 1 goto chkdir
echo %XSRC% is not a directory
goto end
:chkdir
test -f %XSRC%/configure
if not errorlevel 1 goto argsok
echo I cannot find the configure script in the directory %XSRC%
goto end
:argsok
rem set SYSROOT=c:
set PATH_SEPARATOR=:
set PATH_EXPAND=y
if not "%HOSTNAME%" == "" goto hostdone
if "%windir%" == "" goto msdos
set OS=MS-Windows
goto haveos
:msdos
set OS=MS-DOS
:haveos
if not "%USERNAME%" == "" goto haveuname
if not "%USER%" == "" goto haveuser
echo No USERNAME and no USER found in the environment, using default values
set HOSTNAME=Unknown PC
:haveuser
set HOSTNAME=%USER%'s PC
goto userdone
:haveuname
set HOSTNAME=%USERNAME%'s PC
:userdone
set HOSTNAME=%HOSTNAME%, %OS%
:hostdone
set OS=
echo updating configure script and Makefiles for DJGPP...
if not exist configure.orig cp -p %XSRC%/configure configure.orig
update %XSRC%/djgpp/configure configure
echo configuring...
set CONFIG_SHELL=bash.exe
set INSTALL=${DJDIR}/bin/ginstall
set LPR=lpr
set LPQ=lpq
set PAGE=A4
sh %XSRC%/configure --prefix='${DJDIR}' --disable-nls --without-x
set XSRC=
set INSTALL=
set LPR=
set LPQ=
set PAGE=
:end
