Automatically detect jpeglib.
authorJason Rumney <jasonr@gnu.org>
Sun, 26 Jan 2003 01:25:49 +0000 (01:25 +0000)
committerJason Rumney <jasonr@gnu.org>
Sun, 26 Jan 2003 01:25:49 +0000 (01:25 +0000)
nt/configure.bat

index 2aa477c..f284c6b 100755 (executable)
@@ -86,6 +86,7 @@ if "%1" == "--no-cygwin" goto nocygwin
 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
@@ -99,6 +100,7 @@ echo.   --no-cygwin             use -mno-cygwin option with GCC
 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
@@ -152,6 +154,13 @@ set pngsupport=N
 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
@@ -273,6 +282,26 @@ set HAVE_PNG=1
 :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
@@ -300,6 +329,7 @@ echo /* Start of settings from configure.bat.  */ >>..\src\config.h
 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