Automatically detect tifflib.
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 31 Jan 2003 11:03:11 +0000 (11:03 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 31 Jan 2003 11:03:11 +0000 (11:03 +0000)
nt/configure.bat

index 384c376..8f25217 100755 (executable)
@@ -88,6 +88,7 @@ if "%1" == "--ldflags" goto userldflags
 if "%1" == "--without-png" goto withoutpng\r
 if "%1" == "--without-jpeg" goto withoutjpeg\r
 if "%1" == "--without-gif" goto withoutgif\r
+if "%1" == "--without-tiff" goto withouttiff\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -103,6 +104,7 @@ echo.   --ldflags FLAG          pass FLAG to compiler when linking
 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
 echo.   --without-gif           do not use giflib even if it is installed\r
+echo.   --without-tiff          do not use tifflib even if it is installed\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -173,6 +175,14 @@ set HAVE_GIF=
 shift\r
 goto again\r
 \r
+rem ----------------------------------------------------------------------\r
+\r
+:withouttiff\r
+set tiffsupport=N\r
+set HAVE_TIFF=\r
+shift\r
+goto again\r
+\r
 rem ----------------------------------------------------------------------\r
 rem    Check that necessary utilities (cp and rm) are present.\r
 :checkutils\r
@@ -334,6 +344,26 @@ set HAVE_GIF=1
 :gifDone\r
 rm -f junk.c junk.obj\r
 \r
+if (%tiffsupport%) == (N) goto tiffDone\r
+\r
+echo Checking for tiff...\r
+echo #include "tiffio.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 haveTiff\r
+\r
+echo ...building without TIFF support.\r
+set HAVE_TIFF=\r
+goto :tiffDone\r
+\r
+:haveTiff\r
+echo ...TIFF header available, building with TIFF support.\r
+set HAVE_TIFF=1\r
+\r
+:tiffDone\r
+rm -f junk.c junk.obj\r
+\r
 rem ----------------------------------------------------------------------\r
 :genmakefiles\r
 echo Generating makefiles\r
@@ -363,6 +393,7 @@ if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\
 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
 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h\r
+if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h\r
 echo /* End of settings from configure.bat.  */ >>..\src\config.h\r
 \r
 copy paths.h ..\src\epaths.h\r