aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2003-01-25 20:50:48 +0000
committerJason Rumney2003-01-25 20:50:48 +0000
commite00065384265cb8b1068757d044b2ad565301d68 (patch)
tree306963a395d06713ddd3f3504003d44e6ccab5f3
parentc262430d1174625b0388f5be9a086dc8aedb4247 (diff)
downloademacs-e00065384265cb8b1068757d044b2ad565301d68.tar.gz
emacs-e00065384265cb8b1068757d044b2ad565301d68.zip
Automatically detect libpng.
-rwxr-xr-xnt/configure.bat45
1 files changed, 42 insertions, 3 deletions
diff --git a/nt/configure.bat b/nt/configure.bat
index 0525b53bd21..2aa477ca628 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -85,6 +85,7 @@ if "%1" == "--no-opt" goto noopt
85if "%1" == "--no-cygwin" goto nocygwin 85if "%1" == "--no-cygwin" goto nocygwin
86if "%1" == "--cflags" goto usercflags 86if "%1" == "--cflags" goto usercflags
87if "%1" == "--ldflags" goto userldflags 87if "%1" == "--ldflags" goto userldflags
88if "%1" == "--without-png" goto withoutpng
88if "%1" == "" goto checkutils 89if "%1" == "" goto checkutils
89:usage 90:usage
90echo Usage: configure [options] 91echo Usage: configure [options]
@@ -97,6 +98,7 @@ echo. --no-opt disable optimization
97echo. --no-cygwin use -mno-cygwin option with GCC 98echo. --no-cygwin use -mno-cygwin option with GCC
98echo. --cflags FLAG pass FLAG to compiler 99echo. --cflags FLAG pass FLAG to compiler
99echo. --ldflags FLAG pass FLAG to compiler when linking 100echo. --ldflags FLAG pass FLAG to compiler when linking
101echo. --without-png do not use libpng even if it is installed
100goto end 102goto end
101rem ---------------------------------------------------------------------- 103rem ----------------------------------------------------------------------
102:setprefix 104:setprefix
@@ -143,6 +145,12 @@ set userldflags=%userldflags%%sep2%%1
143set sep2= %nothing% 145set sep2= %nothing%
144shift 146shift
145goto again 147goto again
148rem ----------------------------------------------------------------------
149
150:withoutpng
151set pngsupport=N
152set HAVE_PNG=
153goto again
146 154
147rem ---------------------------------------------------------------------- 155rem ----------------------------------------------------------------------
148rem Check that necessary utilities (cp and rm) are present. 156rem Check that necessary utilities (cp and rm) are present.
@@ -165,7 +173,7 @@ goto end
165rem ---------------------------------------------------------------------- 173rem ----------------------------------------------------------------------
166rem Auto-detect compiler if not specified, and validate GCC if chosen. 174rem Auto-detect compiler if not specified, and validate GCC if chosen.
167:checkcompiler 175:checkcompiler
168if (%COMPILER%)==(cl) goto genmakefiles 176if (%COMPILER%)==(cl) goto compilercheckdone
169if (%COMPILER%)==(gcc) goto checkgcc 177if (%COMPILER%)==(gcc) goto checkgcc
170 178
171echo Checking whether 'cl' is available... 179echo Checking whether 'cl' is available...
@@ -231,13 +239,39 @@ goto end
231set COMPILER=gcc 239set COMPILER=gcc
232rm -f junk.c junk.o 240rm -f junk.c junk.o
233echo Using 'gcc' 241echo Using 'gcc'
234goto genmakefiles 242goto compilercheckdone
235 243
236:clOk 244:clOk
237set COMPILER=cl 245set COMPILER=cl
238rm -f junk.c junk.obj 246rm -f junk.c junk.obj
239echo Using 'MSVC' 247echo Using 'MSVC'
240goto genmakefiles 248
249:compilercheckdone
250
251rem ----------------------------------------------------------------------
252rem Check for external image libraries. Since they are loaded
253rem dynamically, the libraries themselves do not need to be present
254rem at compile time, but the header files are required.
255
256if (%pngsupport%) == (N) goto pngDone
257
258echo Checking for libpng...
259echo #include "png.h" >junk.c
260echo main (){} >>junk.c
261rem -o option is ignored with cl, but allows result to be consistent.
262%COMPILER% %usercflags% -c junk.c -o junk.obj
263if exist junk.obj goto havePng
264
265echo ...building without PNG support.
266set HAVE_PNG=
267goto :pngDone
268
269:havePng
270echo ...PNG header available, building with PNG support.
271set HAVE_PNG=1
272
273:pngDone
274rm -f junk.c junk.obj
241 275
242rem ---------------------------------------------------------------------- 276rem ----------------------------------------------------------------------
243:genmakefiles 277:genmakefiles
@@ -261,8 +295,13 @@ echo # End of settings from configure.bat>>config.settings
261echo. >>config.settings 295echo. >>config.settings
262 296
263copy config.nt ..\src\config.h 297copy config.nt ..\src\config.h
298echo. >>..\src\config.h
299echo /* Start of settings from configure.bat. */ >>..\src\config.h
264if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h 300if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h
265if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h 301if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h
302if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h
303echo /* End of settings from configure.bat. */ >>..\src\config.h
304
266copy paths.h ..\src\epaths.h 305copy paths.h ..\src\epaths.h
267 306
268copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile 307copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile