0
|
1 @ECHO OFF
|
|
2 REM ///////////////////////////////////////////////////////////////////////////
|
|
3 REM
|
|
4 REM Copyright (c) 2007-2009 Daniel Adler <dadler@uni-goettingen.de>,
|
|
5 REM Tassilo Philipp <tphilipp@potion-studios.com>
|
|
6 REM
|
|
7 REM Permission to use, copy, modify, and distribute this software for any
|
|
8 REM purpose with or without fee is hereby granted, provided that the above
|
|
9 REM copyright notice and this permission notice appear in all copies.
|
|
10 REM
|
|
11 REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12 REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13 REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14 REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15 REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16 REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17 REM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18 REM
|
|
19 REM ///////////////////////////////////////////////////////////////////////////
|
|
20
|
|
21
|
|
22 SETLOCAL
|
|
23
|
|
24 REM Set default values.
|
|
25 SET PACKAGE=dyncall
|
|
26 SET CONFIG_HOST=windows
|
|
27 SET CONFIG_OS=windows
|
|
28 SET CONFIG_TOOL=msvc
|
|
29 SET CONFIG_ASM=ml
|
|
30 SET CONFIG_CONFIG=release
|
|
31 IF [%PROCESSOR_ARCHITECTURE%] == [AMD64] (
|
|
32 SET CONFIG_ARCH=x64
|
|
33 ) ELSE IF [%PROCESSOR_ARCHITEW6432%] == [AMD64] (
|
|
34 SET CONFIG_ARCH=x64
|
|
35 ) ELSE (
|
|
36 SET CONFIG_ARCH=x86
|
|
37 )
|
|
38
|
|
39 REM Scan arguments.
|
|
40 :MAIN_LOOP
|
|
41
|
|
42
|
|
43 REM Help.
|
|
44 IF [%1]==[] (
|
|
45 GOTO DONE
|
|
46 ) ELSE IF [%1]==[/?] (
|
|
47 ECHO.
|
|
48 ECHO.dyncall configuration shell-script
|
|
49 ECHO.Usage:
|
|
50 ECHO. configure.bat [ options ]
|
|
51 ECHO.
|
|
52 ECHO.Options:
|
|
53 ECHO. /? print this page
|
|
54 ECHO.
|
|
55 ECHO. /prefix PATH set installation prefix ^(GNU make only^)
|
|
56 ECHO. /prefix-bd PATH set build directory prefix ^(GNU make only^)
|
|
57 ECHO. ^(only for use with gmake^)
|
|
58 ECHO.
|
|
59 ECHO. /target-x86 build for x86 architecture ^(default^)
|
|
60 ECHO. /target-x64 build for x64 architecture
|
|
61 ECHO. /target-psp build for PlayStation Portable ^(homebrew SDK^)
|
|
62 ECHO. /target-nds-arm build for Nintendo DS ^(devkitPro, ARM mode^)
|
|
63 ECHO. /target-nds-thumb build for Nintendo DS ^(devkitPro, THUMB mode^)
|
|
64 ECHO.
|
|
65 ECHO. /tool-msvc use Microsoft Visual C++ compiler ^(default^)
|
|
66 ECHO. /tool-gcc use GNU Compiler Collection
|
|
67 ECHO.
|
|
68 ECHO. /asm-ml use Microsoft Macro Assembler ^(default^)
|
|
69 ECHO. /asm-as use the GNU Assembler
|
|
70 ECHO. /asm-nasm use NASM Assembler
|
|
71 ECHO.
|
|
72 ECHO. /config-release build release version ^(default^)
|
|
73 ECHO. /config-debug build debug version
|
|
74 GOTO:EOF
|
|
75 ) ELSE IF [%1]==[/prefix] (
|
|
76 SET CONFIG_PREFIX=%2
|
|
77 SHIFT
|
|
78 ) ELSE IF [%1]==[/prefix-bd] (
|
|
79 SET CONFIG_BUILDPREFIX=%2
|
|
80 SHIFT
|
|
81 ) ELSE IF [%1]==[/target-x86] (
|
|
82 SET CONFIG_ARCH=x86
|
|
83 ) ELSE IF [%1]==[/target-x64] (
|
|
84 SET CONFIG_ARCH=x64
|
|
85 ) ELSE IF [%1]==[/target-psp] (
|
|
86 SET CONFIG_ARCH=mips32
|
|
87 SET CONFIG_OS=psp
|
|
88 ) ELSE IF [%1]==[/target-nds-arm] (
|
|
89 SET CONFIG_ARCH=arm32_arm
|
|
90 SET CONFIG_OS=nds
|
|
91 ) ELSE IF [%1]==[/target-nds-thumb] (
|
|
92 SET CONFIG_ARCH=arm32_thumb
|
|
93 SET CONFIG_OS=nds
|
|
94 ) ELSE IF [%1]==[/tool-gcc] (
|
|
95 SET CONFIG_TOOL=gcc
|
|
96 SET CONFIG_ASM=as
|
|
97 ) ELSE IF [%1]==[/tool-msvc] (
|
|
98 SET CONFIG_TOOL=msvc
|
|
99 SET CONFIG_ASM=ml
|
|
100 ) ELSE IF [%1]==[/asm-as] (
|
|
101 SET CONFIG_ASM=as
|
|
102 ) ELSE IF [%1]==[/asm-nasm] (
|
|
103 SET CONFIG_ASM=nasm
|
|
104 ) ELSE IF [%1]==[/asm-ml] (
|
|
105 SET CONFIG_ASM=ml
|
|
106 ) ELSE IF [%1]==[/config-release] (
|
|
107 SET CONFIG_CONFIG=release
|
|
108 ) ELSE IF [%1]==[/config-debug] (
|
|
109 SET CONFIG_CONFIG=debug
|
|
110 ) ELSE (
|
|
111 ECHO Unknown parameter '%1'.
|
|
112 GOTO DONE
|
|
113 )
|
|
114
|
|
115 SHIFT
|
|
116 GOTO MAIN_LOOP
|
|
117 :DONE
|
|
118
|
|
119 IF [%CONFIG_PREFIX%]==[] (
|
|
120 SET CONFIG_PREFIX=%CD%\install_%CONFIG_OS%_%CONFIG_ARCH%_%CONFIG_TOOL%_%CONFIG_CONFIG%
|
|
121 )
|
|
122 IF [%CONFIG_BUILDPREFIX%]==[] (
|
|
123 SET CONFIG_BUILDPREFIX=%CD%\build_out\%CONFIG_OS%_%CONFIG_ARCH%_%CONFIG_TOOL%_%CONFIG_CONFIG%
|
|
124 )
|
|
125
|
|
126 ECHO # auto-generated by configure.bat >ConfigVars
|
|
127 ECHO CONFIG_PACKAGE=%PACKAGE%#>>ConfigVars
|
|
128 ECHO CONFIG_HOST=%CONFIG_HOST%#>>ConfigVars
|
|
129 ECHO CONFIG_OS=%CONFIG_OS%#>>ConfigVars
|
|
130 ECHO CONFIG_ARCH=%CONFIG_ARCH%#>>ConfigVars
|
|
131 ECHO CONFIG_TOOL=%CONFIG_TOOL%#>>ConfigVars
|
|
132 ECHO CONFIG_ASM=%CONFIG_ASM%#>>ConfigVars
|
|
133 ECHO CONFIG_CONFIG=%CONFIG_CONFIG%#>>ConfigVars
|
|
134 ECHO CONFIG_PREFIX=%CONFIG_PREFIX%#>>ConfigVars
|
|
135 ECHO CONFIG_BUILDPREFIX=%CONFIG_BUILDPREFIX%#>>ConfigVars
|
|
136
|
|
137 ECHO Writing following configuration to ConfigVars:
|
|
138 ECHO.
|
|
139 ECHO Host OS: %CONFIG_HOST%
|
|
140 ECHO Target OS: %CONFIG_OS%
|
|
141 ECHO Target Architecture: %CONFIG_ARCH%
|
|
142 ECHO Compiler: %CONFIG_TOOL%
|
|
143 ECHO Assembler: %CONFIG_ASM%
|
|
144 ECHO Build configuration: %CONFIG_CONFIG%
|
|
145 ECHO Install prefix: %CONFIG_PREFIX%
|
|
146 ECHO Build prefix: %CONFIG_BUILDPREFIX%
|
|
147
|
|
148
|
|
149 REM We have to transform some pathes for the nds/devkitPro build.
|
|
150 IF [%CONFIG_OS%]==[nds] (
|
|
151 REM Check if DEVKITPRO is set.
|
|
152 IF [%DEVKITPRO%]==[] (
|
|
153 ECHO ERROR: Environment variable DEVKITPRO must be set to absolute devkitPro path.
|
|
154 ) ELSE (
|
|
155 buildsys\scripts\conf-nds.bat
|
|
156 )
|
|
157 )
|