if "%1" == "--cflags" goto usercflags\r
if "%1" == "--ldflags" goto userldflags\r
if "%1" == "--without-png" goto withoutpng\r
+if "%1" == "--without-jpeg" goto withoutjpeg\r
if "%1" == "" goto checkutils\r
:usage\r
echo Usage: configure [options]\r
echo. --cflags FLAG pass FLAG to compiler\r
echo. --ldflags FLAG pass FLAG to compiler when linking\r
echo. --without-png do not use libpng even if it is installed \r
+echo. --without-jpeg do not use jpeglib even if it is installed \r
goto end\r
rem ----------------------------------------------------------------------\r
:setprefix\r
set HAVE_PNG=\r
goto again\r
\r
+rem ----------------------------------------------------------------------\r
+\r
+:withoutjpeg\r
+set jpegsupport=N\r
+set HAVE_JPEG=\r
+goto again\r
+\r
rem ----------------------------------------------------------------------\r
rem Check that necessary utilities (cp and rm) are present.\r
:checkutils\r
:pngDone\r
rm -f junk.c junk.obj\r
\r
+if (%jpegsupport%) == (N) goto jpegDone\r
+\r
+echo Checking for jpeg ...\r
+echo #include "jconfig.h" >junk.c\r
+echo main (){} >>junk.c\r
+rem -o option is ignored with cl, but allows result to be consistent.\r
+%COMPILER% %usercflags% -c junk.c -o junk.obj\r
+if exist junk.obj goto haveJpeg\r
+\r
+echo ...building without JPEG support.\r
+set HAVE_JPEG=\r
+goto :jpegDone\r
+\r
+:haveJpeg\r
+echo ...JPEG header available, building with JPEG support.\r
+set HAVE_JPEG=1\r
+\r
+:jpegDone\r
+rm -f junk.c junk.obj\r
+\r
rem ----------------------------------------------------------------------\r
:genmakefiles\r
echo Generating makefiles\r
if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h\r
if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h\r
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h\r
+if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h\r
echo /* End of settings from configure.bat. */ >>..\src\config.h\r
\r
copy paths.h ..\src\epaths.h\r