Automatically detect libXpm.
authorJason Rumney <jasonr@gnu.org>
Sun, 2 Feb 2003 00:01:25 +0000 (00:01 +0000)
committerJason Rumney <jasonr@gnu.org>
Sun, 2 Feb 2003 00:01:25 +0000 (00:01 +0000)
Suppress compiler output when testing for image libraries.
Give names of un-found libraries in messages.

nt/configure.bat

index 8f25217..8b7d442 100755 (executable)
@@ -89,6 +89,7 @@ if "%1" == "--without-png" goto withoutpng
 if "%1" == "--without-jpeg" goto withoutjpeg\r
 if "%1" == "--without-gif" goto withoutgif\r
 if "%1" == "--without-tiff" goto withouttiff\r
+if "%1" == "--without-xpm" goto withoutxpm\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -102,9 +103,10 @@ 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
-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
+echo.   --without-jpeg          do not use jpeg-6b even if it is installed\r
+echo.   --without-gif           do not use libungif even if it is installed\r
+echo.   --without-tiff          do not use tiff even if it is installed\r
+echo.   --without-xpm          do not use libXpm even if it is installed\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -183,6 +185,14 @@ set HAVE_TIFF=
 shift\r
 goto again\r
 \r
+rem ----------------------------------------------------------------------\r
+\r
+:withoutxpm\r
+set xpmsupport=N\r
+set HAVE_XPM=\r
+shift\r
+goto again\r
+\r
 rem ----------------------------------------------------------------------\r
 rem    Check that necessary utilities (cp and rm) are present.\r
 :checkutils\r
@@ -290,10 +300,10 @@ echo Checking for libpng...
 echo #include "png.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
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto havePng\r
 \r
-echo ...building without PNG support.\r
+echo ...png.h not found, building without PNG support.\r
 set HAVE_PNG=\r
 goto :pngDone\r
 \r
@@ -306,14 +316,14 @@ rm -f junk.c junk.obj
 \r
 if (%jpegsupport%) == (N) goto jpegDone\r
 \r
-echo Checking for jpeg...\r
+echo Checking for jpeg-6b...\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
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto haveJpeg\r
 \r
-echo ...building without JPEG support.\r
+echo ...jconfig.h not found, building without JPEG support.\r
 set HAVE_JPEG=\r
 goto :jpegDone\r
 \r
@@ -326,14 +336,14 @@ rm -f junk.c junk.obj
 \r
 if (%gifsupport%) == (N) goto gifDone\r
 \r
-echo Checking for gif...\r
+echo Checking for libgif...\r
 echo #include "gif_lib.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
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto haveGif\r
 \r
-echo ...building without GIF support.\r
+echo ...gif_lib.h not found, building without GIF support.\r
 set HAVE_GIF=\r
 goto :gifDone\r
 \r
@@ -350,10 +360,10 @@ echo Checking for tiff...
 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
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto haveTiff\r
 \r
-echo ...building without TIFF support.\r
+echo ...tiffio.h not found, building without TIFF support.\r
 set HAVE_TIFF=\r
 goto :tiffDone\r
 \r
@@ -364,6 +374,27 @@ set HAVE_TIFF=1
 :tiffDone\r
 rm -f junk.c junk.obj\r
 \r
+if (%xpmsupport%) == (N) goto xpmDone\r
+\r
+echo Checking for libXpm...\r
+echo #define FOR_MSW 1 >junk.c\r
+echo #include "X11/xpm.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 >junk.out 2>junk.err\r
+if exist junk.obj goto haveXpm\r
+\r
+echo ...X11/xpm.h not found, building without XPM support.\r
+set HAVE_XPM=\r
+goto :xpmDone\r
+\r
+:haveXpm\r
+echo ...XPM header available, building with XPM support.\r
+set HAVE_XPM=1\r
+\r
+:xpmDone\r
+rm -f junk.c junk.obj junk.err junk.out\r
+\r
 rem ----------------------------------------------------------------------\r
 :genmakefiles\r
 echo Generating makefiles\r
@@ -394,6 +425,7 @@ if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h
 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
+if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h\r
 echo /* End of settings from configure.bat.  */ >>..\src\config.h\r
 \r
 copy paths.h ..\src\epaths.h\r