changeset 49563:5c18aa000ef4

Automatically detect libXpm. Suppress compiler output when testing for image libraries. Give names of un-found libraries in messages.
author Jason Rumney <jasonr@gnu.org>
date Sun, 02 Feb 2003 00:01:25 +0000
parents e31e2b0f73c7
children 0887554be235
files nt/configure.bat
diffstat 1 files changed, 45 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/nt/configure.bat	Sat Feb 01 23:54:34 2003 +0000
+++ b/nt/configure.bat	Sun Feb 02 00:01:25 2003 +0000
@@ -89,6 +89,7 @@
 if "%1" == "--without-jpeg" goto withoutjpeg
 if "%1" == "--without-gif" goto withoutgif
 if "%1" == "--without-tiff" goto withouttiff
+if "%1" == "--without-xpm" goto withoutxpm
 if "%1" == "" goto checkutils
 :usage
 echo Usage: configure [options]
@@ -102,9 +103,10 @@
 echo.   --cflags FLAG           pass FLAG to compiler
 echo.   --ldflags FLAG          pass FLAG to compiler when linking
 echo.   --without-png           do not use libpng even if it is installed
-echo.   --without-jpeg          do not use jpeglib even if it is installed
-echo.   --without-gif           do not use giflib even if it is installed
-echo.   --without-tiff          do not use tifflib even if it is installed
+echo.   --without-jpeg          do not use jpeg-6b even if it is installed
+echo.   --without-gif           do not use libungif even if it is installed
+echo.   --without-tiff          do not use tiff even if it is installed
+echo.   --without-xpm		do not use libXpm even if it is installed
 goto end
 rem ----------------------------------------------------------------------
 :setprefix
@@ -184,6 +186,14 @@
 goto again
 
 rem ----------------------------------------------------------------------
+
+:withoutxpm
+set xpmsupport=N
+set HAVE_XPM=
+shift
+goto again
+
+rem ----------------------------------------------------------------------
 rem    Check that necessary utilities (cp and rm) are present.
 :checkutils
 echo Checking for 'cp'...
@@ -290,10 +300,10 @@
 echo #include "png.h" >junk.c
 echo main (){} >>junk.c
 rem   -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
 if exist junk.obj goto havePng
 
-echo ...building without PNG support.
+echo ...png.h not found, building without PNG support.
 set HAVE_PNG=
 goto :pngDone
 
@@ -306,14 +316,14 @@
 
 if (%jpegsupport%) == (N) goto jpegDone
 
-echo Checking for jpeg...
+echo Checking for jpeg-6b...
 echo #include "jconfig.h" >junk.c
 echo main (){} >>junk.c
 rem   -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
 if exist junk.obj goto haveJpeg
 
-echo ...building without JPEG support.
+echo ...jconfig.h not found, building without JPEG support.
 set HAVE_JPEG=
 goto :jpegDone
 
@@ -326,14 +336,14 @@
 
 if (%gifsupport%) == (N) goto gifDone
 
-echo Checking for gif...
+echo Checking for libgif...
 echo #include "gif_lib.h" >junk.c
 echo main (){} >>junk.c
 rem   -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
 if exist junk.obj goto haveGif
 
-echo ...building without GIF support.
+echo ...gif_lib.h not found, building without GIF support.
 set HAVE_GIF=
 goto :gifDone
 
@@ -350,10 +360,10 @@
 echo #include "tiffio.h" >junk.c
 echo main (){} >>junk.c
 rem   -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
 if exist junk.obj goto haveTiff
 
-echo ...building without TIFF support.
+echo ...tiffio.h not found, building without TIFF support.
 set HAVE_TIFF=
 goto :tiffDone
 
@@ -364,6 +374,27 @@
 :tiffDone
 rm -f junk.c junk.obj
 
+if (%xpmsupport%) == (N) goto xpmDone
+
+echo Checking for libXpm...
+echo #define FOR_MSW 1 >junk.c
+echo #include "X11/xpm.h" >>junk.c
+echo main (){} >>junk.c
+rem   -o option is ignored with cl, but allows result to be consistent.
+%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+if exist junk.obj goto haveXpm
+
+echo ...X11/xpm.h not found, building without XPM support.
+set HAVE_XPM=
+goto :xpmDone
+
+:haveXpm
+echo ...XPM header available, building with XPM support.
+set HAVE_XPM=1
+
+:xpmDone
+rm -f junk.c junk.obj junk.err junk.out
+
 rem ----------------------------------------------------------------------
 :genmakefiles
 echo Generating makefiles
@@ -394,6 +425,7 @@
 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h
 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h
 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h
+if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h
 echo /* End of settings from configure.bat.  */ >>..\src\config.h
 
 copy paths.h ..\src\epaths.h