Mercurial > pub > dyncall > dyncall
annotate configure.bat @ 632:ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
- configure.{bat,rc} now writing Makefile.config, for consistency/compatibility (e.g. configure.bat can now be used to set up env flags for a non-nmake toolchain)
- simplified/decluttered Windows and Plan9 configure scripts (removal of unused/stale options, ...)
- removed stale test/makepkg.sh helper
author | Tassilo Philipp |
---|---|
date | Sat, 19 Nov 2022 15:45:41 +0100 |
parents | f5e9f7f8a932 |
children | 840a870c093c |
rev | line source |
---|---|
0 | 1 @ECHO OFF |
2 REM /////////////////////////////////////////////////////////////////////////// | |
3 REM | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
4 REM Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 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 IF [%PROCESSOR_ARCHITECTURE%] == [AMD64] ( | |
31 SET CONFIG_ARCH=x64 | |
32 ) ELSE IF [%PROCESSOR_ARCHITEW6432%] == [AMD64] ( | |
33 SET CONFIG_ARCH=x64 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
34 ) ELSE IF [%PROCESSOR_ARCHITECTURE%] == [ARM64] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
35 SET CONFIG_ARCH=arm64 |
0 | 36 ) ELSE ( |
37 SET CONFIG_ARCH=x86 | |
38 ) | |
39 | |
40 REM Scan arguments. | |
41 :MAIN_LOOP | |
42 | |
43 | |
44 REM Help. | |
45 IF [%1]==[] ( | |
46 GOTO DONE | |
47 ) ELSE IF [%1]==[/?] ( | |
48 ECHO. | |
49 ECHO.dyncall configuration shell-script | |
50 ECHO.Usage: | |
51 ECHO. configure.bat [ options ] | |
52 ECHO. | |
53 ECHO.Options: | |
54 ECHO. /? print this page | |
55 ECHO. | |
352
f5e9f7f8a932
- removed misleading help test in configure.bat
Tassilo Philipp
parents:
0
diff
changeset
|
56 ECHO. /target-x86 build for x86 architecture |
0 | 57 ECHO. /target-x64 build for x64 architecture |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
58 ECHO. /target-arm64 build for arm64 architecture |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
59 ECHO. /target-psp cross-build for PlayStation Portable ^(homebrew SDK^) |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
60 ECHO. /target-nds-arm cross-build for Nintendo DS ^(devkitPro, ARM mode^) |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
61 ECHO. /target-nds-thumb cross-build for Nintendo DS ^(devkitPro, THUMB mode^) |
0 | 62 ECHO. |
63 ECHO. /tool-msvc use Microsoft Visual C++ compiler ^(default^) | |
64 ECHO. /tool-gcc use GNU Compiler Collection | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
65 ECHO. /tool-clang use LLVM clang compiler |
0 | 66 ECHO. |
67 ECHO. /asm-ml use Microsoft Macro Assembler ^(default^) | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
68 ECHO. /asm-as use the GNU or LLVM Assembler |
0 | 69 ECHO. /asm-nasm use NASM Assembler |
70 GOTO:EOF | |
71 ) ELSE IF [%1]==[/target-x86] ( | |
72 SET CONFIG_ARCH=x86 | |
73 ) ELSE IF [%1]==[/target-x64] ( | |
74 SET CONFIG_ARCH=x64 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
75 ) ELSE IF [%1]==[/target-arm64] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
76 SET CONFIG_ARCH=arm64 |
0 | 77 ) ELSE IF [%1]==[/target-psp] ( |
78 SET CONFIG_ARCH=mips32 | |
79 SET CONFIG_OS=psp | |
80 ) ELSE IF [%1]==[/target-nds-arm] ( | |
81 SET CONFIG_ARCH=arm32_arm | |
82 SET CONFIG_OS=nds | |
83 ) ELSE IF [%1]==[/target-nds-thumb] ( | |
84 SET CONFIG_ARCH=arm32_thumb | |
85 SET CONFIG_OS=nds | |
86 ) ELSE IF [%1]==[/tool-gcc] ( | |
87 SET CONFIG_TOOL=gcc | |
88 SET CONFIG_ASM=as | |
89 ) ELSE IF [%1]==[/tool-msvc] ( | |
90 SET CONFIG_TOOL=msvc | |
91 SET CONFIG_ASM=ml | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
92 ) ELSE IF [%1]==[/tool-clang] ( |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
93 SET CONFIG_TOOL=clang |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
94 SET CONFIG_ASM=as |
0 | 95 ) ELSE IF [%1]==[/asm-as] ( |
96 SET CONFIG_ASM=as | |
97 ) ELSE IF [%1]==[/asm-nasm] ( | |
98 SET CONFIG_ASM=nasm | |
99 ) ELSE IF [%1]==[/asm-ml] ( | |
100 SET CONFIG_ASM=ml | |
101 ) ELSE ( | |
102 ECHO Unknown parameter '%1'. | |
103 GOTO DONE | |
104 ) | |
105 | |
106 SHIFT | |
107 GOTO MAIN_LOOP | |
108 :DONE | |
109 | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
110 ECHO # auto-generated by configure.bat >Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
111 ECHO CONFIG_PACKAGE=%PACKAGE%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
112 ECHO CONFIG_HOST=%CONFIG_HOST%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
113 ECHO CONFIG_OS=%CONFIG_OS%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
114 ECHO CONFIG_ARCH=%CONFIG_ARCH%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
115 ECHO CONFIG_TOOL=%CONFIG_TOOL%#>>Makefile.config |
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
116 ECHO CONFIG_ASM=%CONFIG_ASM%#>>Makefile.config |
0 | 117 |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
118 ECHO Writing following configuration to Makefile.config: |
0 | 119 ECHO. |
120 ECHO Host OS: %CONFIG_HOST% | |
121 ECHO Target OS: %CONFIG_OS% | |
122 ECHO Target Architecture: %CONFIG_ARCH% | |
123 ECHO Compiler: %CONFIG_TOOL% | |
124 ECHO Assembler: %CONFIG_ASM% | |
125 | |
126 | |
127 REM We have to transform some pathes for the nds/devkitPro build. | |
128 IF [%CONFIG_OS%]==[nds] ( | |
129 REM Check if DEVKITPRO is set. | |
130 IF [%DEVKITPRO%]==[] ( | |
131 ECHO ERROR: Environment variable DEVKITPRO must be set to absolute devkitPro path. | |
132 ) ELSE ( | |
133 buildsys\scripts\conf-nds.bat | |
134 ) | |
135 ) | |
632
ed19b429a152
- added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents:
352
diff
changeset
|
136 |