86 |
if "%1" == "--cflags" goto usercflags |
if "%1" == "--cflags" goto usercflags |
87 |
if "%1" == "--ldflags" goto userldflags |
if "%1" == "--ldflags" goto userldflags |
88 |
if "%1" == "--without-png" goto withoutpng |
if "%1" == "--without-png" goto withoutpng |
89 |
|
if "%1" == "--without-jpeg" goto withoutjpeg |
90 |
if "%1" == "" goto checkutils |
if "%1" == "" goto checkutils |
91 |
:usage |
:usage |
92 |
echo Usage: configure [options] |
echo Usage: configure [options] |
100 |
echo. --cflags FLAG pass FLAG to compiler |
echo. --cflags FLAG pass FLAG to compiler |
101 |
echo. --ldflags FLAG pass FLAG to compiler when linking |
echo. --ldflags FLAG pass FLAG to compiler when linking |
102 |
echo. --without-png do not use libpng even if it is installed |
echo. --without-png do not use libpng even if it is installed |
103 |
|
echo. --without-jpeg do not use jpeglib even if it is installed |
104 |
goto end |
goto end |
105 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
106 |
:setprefix |
:setprefix |
155 |
goto again |
goto again |
156 |
|
|
157 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
158 |
|
|
159 |
|
:withoutjpeg |
160 |
|
set jpegsupport=N |
161 |
|
set HAVE_JPEG= |
162 |
|
goto again |
163 |
|
|
164 |
|
rem ---------------------------------------------------------------------- |
165 |
rem Check that necessary utilities (cp and rm) are present. |
rem Check that necessary utilities (cp and rm) are present. |
166 |
:checkutils |
:checkutils |
167 |
echo Checking for 'cp'... |
echo Checking for 'cp'... |
282 |
:pngDone |
:pngDone |
283 |
rm -f junk.c junk.obj |
rm -f junk.c junk.obj |
284 |
|
|
285 |
|
if (%jpegsupport%) == (N) goto jpegDone |
286 |
|
|
287 |
|
echo Checking for jpeg ... |
288 |
|
echo #include "jconfig.h" >junk.c |
289 |
|
echo main (){} >>junk.c |
290 |
|
rem -o option is ignored with cl, but allows result to be consistent. |
291 |
|
%COMPILER% %usercflags% -c junk.c -o junk.obj |
292 |
|
if exist junk.obj goto haveJpeg |
293 |
|
|
294 |
|
echo ...building without JPEG support. |
295 |
|
set HAVE_JPEG= |
296 |
|
goto :jpegDone |
297 |
|
|
298 |
|
:haveJpeg |
299 |
|
echo ...JPEG header available, building with JPEG support. |
300 |
|
set HAVE_JPEG=1 |
301 |
|
|
302 |
|
:jpegDone |
303 |
|
rm -f junk.c junk.obj |
304 |
|
|
305 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
306 |
:genmakefiles |
:genmakefiles |
307 |
echo Generating makefiles |
echo Generating makefiles |
329 |
if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
330 |
if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h |
if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h |
331 |
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h |
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h |
332 |
|
if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h |
333 |
echo /* End of settings from configure.bat. */ >>..\src\config.h |
echo /* End of settings from configure.bat. */ >>..\src\config.h |
334 |
|
|
335 |
copy paths.h ..\src\epaths.h |
copy paths.h ..\src\epaths.h |