Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 632 lines (531 sloc) 19.039 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
@ECHO OFF
REM **************************************************************************
REM *
REM * configure.bat for setting up compiling STLport under Windows
REM * to see available options, call with option --help
REM *
REM * Copyright (C) 2004,2005 Michael Fink
REM *
REM **************************************************************************

REM Attention! Batch file labels only have 8 significant characters!

echo STLport Configuration Tool for Windows
echo.

REM no options at all?
if NOT "%1xyz123" == "xyz123" goto init

echo Please specify at least the compiler you are going to use,
echo use "configure --help" to see the available ones.
goto skp_comp

:init

REM initially create/overwrite config.mak
echo # STLport Configuration Tool for Windows > build\Makefiles\nmake\config.mak
echo # >> build\Makefiles\nmake\config.mak
echo # config.mak generated with command line: >> build\Makefiles\nmake\config.mak
echo # configure %1 %2 %3 %4 %5 %6 %7 %8 %9 >> build\Makefiles\nmake\config.mak
echo # >> build\Makefiles\nmake\config.mak

REM First parameter can only be help or compiler
REM help option
if "%1" == "-?" goto opt_help
if "%1" == "-h" goto opt_help
if "%1" == "/?" goto opt_help
if "%1" == "/h" goto opt_help
if "%1" == "--help" goto opt_help

REM This is necessarily a compiler
goto opt_comp

REM
REM option loop
REM
:loop

REM platform option
if "%1" == "-p" goto opt_plat
if "%1" == "/p" goto opt_plat
if "%1" == "--platform" goto opt_plat

REM cross compiling
if "%1" == "-x" goto opt_x
if "%1" == "/x" goto opt_x
if "%1" == "--cross" goto opt_x

REM C runtime library
if "%1" == "--with-static-rtl" goto opt_srtl
if "%1" == "--with-dynamic-rtl" goto opt_drtl
if "%1" == "--rtl-static" goto opt_srtl
if "%1" == "--rtl-dynamic" goto opt_drtl

REM boost support
if "%1" == "--use-boost" goto opt_bst

REM multithreading support
if "%1" == "--not-thread-safe" goto opt_st
if "%1" == "--without-thread" goto opt_st

REM rtti support
if "%1" == "--no-rtti" goto opt_rtti
if "%1" == "--without-rtti" goto opt_rtti

REM additional compiler options
if "%1" == "--extra-cxxflag" goto opt_xtra

REM library name customization
if "%1" == "--lib-motif" goto opt_motf
if "%1" == "--with-lib-motif" goto opt_motf

REM build without STLport
if "%1" == "--without-stlport" goto no_sport

REM clean rule
if "%1" == "--clean" goto opt_cln

echo Unknown option: %1

:cont_lp
echo.
shift

REM no more options?
if "%1xyz123" == "xyz123" goto end_loop

goto loop


REM **************************************************************************
REM *
REM * Help
REM *
REM **************************************************************************
:opt_help
echo The first parameter must be the compiler name, here are the available
echo keywords:
echo.
echo msvc6 Microsoft Visual C++ 6.0
echo msvc7 Microsoft Visual C++ .NET 2002
echo msvc71 Microsoft Visual C++ .NET 2003
echo msvc8 Microsoft Visual C++ 2005
echo msvc9 Microsoft Visual C++ 2008
echo icl Intel C++ Compiler
echo evc3 Microsoft eMbedded Visual C++ 3 (*)
echo evc4 Microsoft eMbedded Visual C++ .NET (*)
echo evc8 Microsoft Visual C++ 2005 compiling for CE
echo evc9 Microsoft Visual C++ 2008 compiling for CE
echo.
echo (*) For these compilers the target processor is determined automatically.
echo You must run the WCE*.BAT file you wish to build STLport for before
echo running configure.
echo.
echo Then the following options are available:
echo.
echo "-p <platform>" or "--platform <platform>"
echo Build STLport for the specified platform. Not all existing platforms are
echo available, only the ones that make a difference when building STLport are.
echo The following keywords are available:
echo win95 Windows 95 compatible
echo win98 Windows 98 and up to Windows XP excluded
echo winxp Windows XP or later (default)
echo.
echo "-x"
echo Enables cross-compiling; the result is that all built files that are
echo normally put under "bin" and "lib" get extra subfolders depending on
echo the compiler name.
echo.
echo "--with-static-rtl"
echo "--with-dynamic-rtl"
echo Enables usage of static (libc.lib family) or dynamic (msvcrt.lib family)
echo C/C++ runtime library when linking with STLport. If you want your appli/dll
echo to link statically with STLport but using the dynamic C runtime use
echo --with-dynamic-rtl; if you want to link dynamicaly with STLport but using the
echo static C runtime use --with-static-rtl. See README.options for details.
echo Don't forget to signal the link method when building your appli or dll, in
echo stlport/stl/config/host.h set the following macro depending on the configure
echo option:
echo "--with-static-rtl -> _STLP_USE_DYNAMIC_LIB"
echo "--with-dynamic-rtl -> _STLP_USE_STATIC_LIB"
echo.
echo "--use-boost <boost install path>"
echo Request use of boost support (www.boost.org). For the moment only the boost
echo type_traits library is used to get type information and to implement some
echo specific workaround not directly implemented by STLport. To use the same
echo support when using STLport for your application don't forget to define
echo _STLP_USE_BOOST_SUPPORT in stlport/stl/config/user_config.h file.
echo.
echo "--without-thread"
echo Per default STLport libraries are built in order to be usable in a multithreaded
echo context. If you don't need this you can ask for a not thread safe version with
echo this option.
echo.
echo "--without-rtti"
echo Remove rtti (run time type information) support if available.
echo.
echo "--extra-cxxflag <additional compilation options>"
echo Use this option to add any compilation flag to the build system. For instance
echo it can be used to activate a specific processor optimization depending on your
echo processor. For Visual C++ .Net 2003, to activate pentium 3 optim you will use:
echo --extra-cxxflag /G7
echo If you have several options use several --extra-cxxflag options. For instance
echo to also force use of wchar_t as an intrinsic type:
echo --extra-cxxflag /G7 --extra-cxxflag /Zc:wchar_t
echo.
echo "--with-lib-motif <motif>"
echo Use this option to customize the generated library name. The motif will be used
echo in the last place before version information, separated by an underscore, ex:
echo stlportd_MOTIF.5.0.lib
echo stlportstld_static_MOTIF.5.1.lib
echo Do not forget to define _STLP_LIB_NAME_MOTIF macro in STLport configuration file
echo to the same value if you want to keep the auto link feature supported by some
echo compilers.
echo.
echo "--without-stlport"
echo Option specially targetting build of the unit tests project without STLport. This
echo is a good way to challenge the C++ Standard library implementation comming with
echo your compiler with STLport.
echo.
echo "--clean"
echo Removes the build configuration file.
goto skp_comp

REM **************************************************************************
REM *
REM * Compiler configuration
REM *
REM **************************************************************************
:opt_comp

if "%1" == "msvc6" goto oc_msvc6
if "%1" == "msvc71" goto oc_msv71
if "%1" == "msvc7" goto oc_msvc7
if "%1" == "msvc8" goto oc_msvc8
if "%1" == "msvc9" goto oc_msvc9
if "%1" == "icl" goto oc_icl

if "%1" == "evc3" goto oc_evc3
if "%1" == "evc4" goto oc_evc4
if "%1" == "evc8" goto oc_evc8
if "%1" == "evc9" goto oc_evc9

if "%1" == "watcom" goto oc_wtm

echo Unknown compiler: %1
goto oc_end

:oc_msvc6
:oc_wtm
echo Setting compiler: Microsoft Visual C++ 6.0
echo COMPILER_NAME=vc6 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=60
goto oc_msvc

:oc_msvc7
echo Setting compiler: Microsoft Visual C++ .NET 2002
echo COMPILER_NAME=vc70 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=70
goto oc_msvc

:oc_msv71
echo Setting compiler: Microsoft Visual C++ .NET 2003
echo COMPILER_NAME=vc71 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=71
goto oc_msvc

:oc_msvc8
echo Setting compiler: Microsoft Visual C++ 2005
echo COMPILER_NAME=vc8 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=80
goto oc_msvc

:oc_msvc9
echo Setting compiler: Microsoft Visual C++ 2008
echo COMPILER_NAME=vc9 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=90
goto oc_msvc

:oc_msvc
echo TARGET_OS=x86 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER=msvc
echo !include msvc.mak > .\build\lib\Makefile
echo !include msvc.mak > .\build\test\unit\Makefile
echo !include msvc.mak > .\build\test\eh\Makefile
goto oc_end

:oc_icl
echo Setting compiler: Intel C++ Compiler
echo COMPILER_NAME=icl >> build\Makefiles\nmake\config.mak
echo TARGET_OS=x86 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER=icl
echo !include icl.mak > .\build\lib\Makefile
echo !include icl.mak > .\build\test\unit\Makefile
echo !include icl.mak > .\build\test\eh\Makefile
goto oc_end

:oc_evc3
echo Setting compiler: Microsoft eMbedded Visual C++ 3
echo COMPILER_NAME=evc3 >> build\Makefiles\nmake\config.mak
rem TODO: branch on OSVERSION like below?
echo CEVERSION=300 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=3
goto oc_evc

:oc_evc4
echo Setting compiler: Microsoft eMbedded Visual C++ .NET
echo COMPILER_NAME=evc4 >> build\Makefiles\nmake\config.mak
if "%OSVERSION%"=="" (
    echo OSVERSION not set, assuming target is CE 4.2
    echo CEVERSION=420 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE400" (
    echo CEVERSION=400 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE420" (
    echo CEVERSION=420 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE500" (
    echo CEVERSION=500 >> build\Makefiles\nmake\config.mak
) else (
    echo Unknown value for OSVERSION.
    exit /b 1
)
set SELECTED_COMPILER_VERSION=4
goto oc_evc

:oc_evc8
echo Setting compiler: Microsoft Visual C++ .NET 2005 for Windows CE
echo COMPILER_NAME=evc8 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=80
if "%OSVERSION%"=="" (
    echo OSVERSION not set, assuming target is CE 5.0
    echo CEVERSION=500 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE400" (
    echo CEVERSION=400 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE420" (
    echo CEVERSION=420 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE500" (
    echo CEVERSION=500 >> build\Makefiles\nmake\config.mak
) else (
    echo Unknown value for OSVERSION.
    exit /b 1
)
set PLATFORM_SPECIFIED=1
set SELECTED_COMPILER=msvc
echo !include evc.mak > .\build\lib\Makefile
echo !include evc.mak > .\build\test\unit\Makefile
echo !include evc.mak > .\build\test\eh\Makefile
goto proc

:oc_evc9
echo Setting compiler: Microsoft Visual C++ .NET 2008 for Windows CE
echo COMPILER_NAME=evc9 >> build\Makefiles\nmake\config.mak
set SELECTED_COMPILER_VERSION=90
if "%OSVERSION%"=="" (
    echo OSVERSION not set, assuming target is CE 5.0
    echo CEVERSION=500 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE400" (
    echo CEVERSION=400 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE420" (
    echo CEVERSION=420 >> build\Makefiles\nmake\config.mak
) else if "%OSVERSION%"=="WCE500" (
    echo CEVERSION=500 >> build\Makefiles\nmake\config.mak
) else (
    echo Unknown value for OSVERSION.
    exit /b 1
)
set PLATFORM_SPECIFIED=1
set SELECTED_COMPILER=msvc
echo !include evc.mak > .\build\lib\Makefile
echo !include evc.mak > .\build\test\unit\Makefile
echo !include evc.mak > .\build\test\eh\Makefile
goto proc

:oc_evc
set PLATFORM_SPECIFIED=1
set SELECTED_COMPILER=evc
echo !include evc.mak > .\build\lib\Makefile
echo !include evc.mak > .\build\test\unit\Makefile
echo !include evc.mak > .\build\test\eh\Makefile
goto proc

:oc_end
goto cont_lp


REM **************************************************************************
REM *
REM * Target processor configuration (automatic)
REM *
REM **************************************************************************
:proc

if "%TARGETCPU%" == "ARM" goto pr_arm
if "%TARGETCPU%" == "ARMV4" goto pr_arm
if "%TARGETCPU%" == "ARMV4I" goto pr_arm
if "%TARGETCPU%" == "ARMV4T" goto pr_arm

if "%TARGETCPU%" == "X86" goto pr_x86
REM Type from evc3 and/or PocketPC 2002 SDK reported here
REM to correctly check the platform:
if "%TARGETCPU%" == "X86EMnset CFG=none" goto pr_emul
if "%TARGETCPU%" == "x86" goto pr_x86
if "%TARGETCPU%" == "emulator" goto pr_emul

if "%TARGETCPU%" == "R4100" goto pr_mips
if "%TARGETCPU%" == "R4111" goto pr_mips
if "%TARGETCPU%" == "R4300" goto pr_mips
if "%TARGETCPU%" == "MIPS16" goto pr_mips
if "%TARGETCPU%" == "MIPSII" goto pr_mips
if "%TARGETCPU%" == "MIPSII_FP" goto pr_mips
if "%TARGETCPU%" == "MIPSIV" goto pr_mips
if "%TARGETCPU%" == "MIPSIV_FP" goto pr_mips

if "%TARGETCPU%" == "SH3" goto pr_sh3
if "%TARGETCPU%" == "SH4" goto pr_sh4

:pr_err
echo Unknown target CPU: %TARGETCPU%
goto pr_end

:pr_arm
echo Target processor: ARM
echo TARGET_PROC=arm >> build\Makefiles\nmake\config.mak
echo TARGET_PROC_SUBTYPE=%TARGETCPU% >> build\Makefiles\nmake\config.mak
goto pr_end

:pr_x86
echo Target processor: x86
echo TARGET_PROC=x86 >> build\Makefiles\nmake\config.mak
goto pr_end

:pr_emul
echo Target processor: Emulator
echo TARGET_PROC=x86 >> build\Makefiles\nmake\config.mak
echo TARGET_PROC_SUBTYPE=emulator >> build\Makefiles\nmake\config.mak
goto pr_end

:pr_mips
echo Target processor: MIPS
echo TARGET_PROC=mips >> build\Makefiles\nmake\config.mak
echo TARGET_PROC_SUBTYPE=%TARGETCPU% >> build\Makefiles\nmake\config.mak

goto pr_end

:pr_sh3
echo Target processor: %TARGETCPU%
echo TARGET_PROC=sh3 >> build\Makefiles\nmake\config.mak
goto pr_end

:pr_sh4
echo Target processor: %TARGETCPU%
echo TARGET_PROC=sh4 >> build\Makefiles\nmake\config.mak
goto pr_end

:pr_end
goto oc_end


REM **************************************************************************
REM *
REM * Platform configuration
REM *
REM **************************************************************************
:opt_plat

if "%2" == "win95" goto op_win95
if "%2" == "win98" goto op_win98
if "%2" == "winxp" goto op_winxp

echo Unknown platform: %2
goto op_end

:op_win95
echo Setting platform: Windows 95
echo WINVER=0x0400 >> build\Makefiles\nmake\config.mak
set PLATFORM_SPECIFIED=1
goto op_end

:op_win98
echo Setting platform: Windows 98
echo WINVER=0x0410 >> build\Makefiles\nmake\config.mak
set PLATFORM_SPECIFIED=1
goto op_end

:op_winxp
echo Setting platform: Windows XP
echo WINVER=0x0501 >> build\Makefiles\nmake\config.mak
set PLATFORM_SPECIFIED=1
goto op_end

:op_end
shift

goto cont_lp


REM **************************************************************************
REM *
REM * Cross Compiling option
REM *
REM **************************************************************************

:opt_x
echo Setting up for cross compiling.
echo CROSS_COMPILING=1 >> build\Makefiles\nmake\config.mak
goto cont_lp


REM **************************************************************************
REM *
REM * C runtime library selection
REM *
REM **************************************************************************

:opt_srtl
if "%SELECTED_COMPILER%" == "msvc" goto or_sok
goto or_err

:opt_drtl
if "%SELECTED_COMPILER%" == "msvc" goto or_dok
goto or_err

:or_err
echo Error: Setting C runtime library for compiler other than microsoft ones!
goto or_end

:or_sok
echo Selecting static C runtime library for STLport
echo WITH_STATIC_RTL=1 >> build\Makefiles\nmake\config.mak
goto or_end

:or_dok
echo Selecting dynamic C runtime library for STLport
echo WITH_DYNAMIC_RTL=1 >> build\Makefiles\nmake\config.mak
goto or_end

:or_end
goto cont_lp

REM **************************************************************************
REM *
REM * boost support
REM *
REM **************************************************************************
:opt_bst
REM if (Exists("%2")) goto ob_ok
REM if !("%2" == "") goto ob_ok
goto ob_ok

echo Error: Invalid boost intallation folder ("%2").
goto ob_end

:ob_ok
echo Activating boost support using "%2" path
echo STLP_BUILD_BOOST_PATH="%2" >> build\Makefiles\nmake\config.mak

:ob_end
shift

goto cont_lp

REM **************************************************************************
REM *
REM * Multithreading support
REM *
REM **************************************************************************
:opt_st
echo Removing thread safety support
echo WITHOUT_THREAD=1 >> build\Makefiles\nmake\config.mak
goto cont_lp

REM **************************************************************************
REM *
REM * rtti support
REM *
REM **************************************************************************
:opt_rtti
echo Removing rtti support
echo WITHOUT_RTTI=1 >> build\Makefiles\nmake\config.mak
goto cont_lp

REM **************************************************************************
REM *
REM * Extra compilation flags
REM *
REM **************************************************************************
:opt_xtra
echo Adding '%2' compilation option
if "%ONE_OPTION_ADDED%" == "1" goto ox_n

echo DEFS = %2 >> build\Makefiles\nmake\config.mak
set ONE_OPTION_ADDED=1
goto ox_end

:ox_n
echo DEFS = $(DEFS) %2 >> build\Makefiles\nmake\config.mak

:ox_end
shift
goto cont_lp

REM **************************************************************************
REM *
REM * Library name configuration
REM *
REM **************************************************************************
:opt_motf
echo Using '%2' in generated library names

echo LIB_MOTIF = %2 >> build\Makefiles\nmake\config.mak

shift
goto cont_lp

REM **************************************************************************
REM *
REM * Build without STLport
REM *
REM **************************************************************************
:no_sport
echo Configured to build without STLport

echo WITHOUT_STLPORT=1 >> build\Makefiles\nmake\config.mak

shift
goto cont_lp

REM **************************************************************************
REM *
REM * Clean
REM *
REM **************************************************************************
:opt_cln
del build\Makefiles\nmake\config.mak
echo STLport configuration file removed.
goto skp_comp

REM **************************************************************************
REM *
REM * End loop
REM *
REM **************************************************************************

:end_loop

if "%PLATFORM_SPECIFIED%" == "1" goto comp
echo Setting platform: Windows XP
echo.
echo WINVER=0x0501 >> build\Makefiles\nmake\config.mak

:comp
echo Done configuring STLport.
echo.
echo Go to build/lib folder and type "nmake clean install" to build and
echo install STLport to the "lib" and "bin" folders.
echo Go to build/test/unit folder and type nmake clean install to
echo build unit tests and install them in bin folder.
echo.

:skp_comp
set SELECTED_COMPILER=
set SELECTED_COMPILER_VERSION=
set ONE_OPTION_ADDED=
set PLATFORM_SPECIFIED=
Something went wrong with that request. Please try again.