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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 @ECHO OFF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 REM ///////////////////////////////////////////////////////////////////////////
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 REM Tassilo Philipp <tphilipp@potion-studios.com>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 REM
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 REM Permission to use, copy, modify, and distribute this software for any
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 REM purpose with or without fee is hereby granted, provided that the above
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9 REM copyright notice and this permission notice appear in all copies.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 REM
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 REM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 REM
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 REM ///////////////////////////////////////////////////////////////////////////
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 SETLOCAL
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 REM Set default values.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25 SET PACKAGE=dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26 SET CONFIG_HOST=windows
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 SET CONFIG_OS=windows
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 SET CONFIG_TOOL=msvc
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 SET CONFIG_ASM=ml
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 IF [%PROCESSOR_ARCHITECTURE%] == [AMD64] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 SET CONFIG_ARCH=x64
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 ) ELSE IF [%PROCESSOR_ARCHITEW6432%] == [AMD64] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 ) ELSE (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37 SET CONFIG_ARCH=x86
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 )
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40 REM Scan arguments.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 :MAIN_LOOP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 REM Help.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 IF [%1]==[] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46 GOTO DONE
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 ) ELSE IF [%1]==[/?] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48 ECHO.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 ECHO.dyncall configuration shell-script
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 ECHO.Usage:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 ECHO. configure.bat [ options ]
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 ECHO.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 ECHO.Options:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 ECHO. /? print this page
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 ECHO.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 ECHO. /tool-msvc use Microsoft Visual C++ compiler ^(default^)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 ECHO.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 ECHO. /asm-nasm use NASM Assembler
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70 GOTO:EOF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71 ) ELSE IF [%1]==[/target-x86] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72 SET CONFIG_ARCH=x86
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 ) ELSE IF [%1]==[/target-x64] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
77 ) ELSE IF [%1]==[/target-psp] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
78 SET CONFIG_ARCH=mips32
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
79 SET CONFIG_OS=psp
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80 ) ELSE IF [%1]==[/target-nds-arm] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81 SET CONFIG_ARCH=arm32_arm
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
82 SET CONFIG_OS=nds
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 ) ELSE IF [%1]==[/target-nds-thumb] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 SET CONFIG_ARCH=arm32_thumb
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 SET CONFIG_OS=nds
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
86 ) ELSE IF [%1]==[/tool-gcc] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
87 SET CONFIG_TOOL=gcc
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
88 SET CONFIG_ASM=as
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
89 ) ELSE IF [%1]==[/tool-msvc] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90 SET CONFIG_TOOL=msvc
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95 ) ELSE IF [%1]==[/asm-as] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
96 SET CONFIG_ASM=as
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
97 ) ELSE IF [%1]==[/asm-nasm] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
98 SET CONFIG_ASM=nasm
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
99 ) ELSE IF [%1]==[/asm-ml] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100 SET CONFIG_ASM=ml
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
101 ) ELSE (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
102 ECHO Unknown parameter '%1'.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
103 GOTO DONE
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
104 )
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
105
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
106 SHIFT
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
107 GOTO MAIN_LOOP
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
108 :DONE
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
119 ECHO.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
120 ECHO Host OS: %CONFIG_HOST%
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
121 ECHO Target OS: %CONFIG_OS%
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
122 ECHO Target Architecture: %CONFIG_ARCH%
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
123 ECHO Compiler: %CONFIG_TOOL%
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
124 ECHO Assembler: %CONFIG_ASM%
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
125
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
126
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
127 REM We have to transform some pathes for the nds/devkitPro build.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
128 IF [%CONFIG_OS%]==[nds] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
129 REM Check if DEVKITPRO is set.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
130 IF [%DEVKITPRO%]==[] (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
131 ECHO ERROR: Environment variable DEVKITPRO must be set to absolute devkitPro path.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
132 ) ELSE (
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
133 buildsys\scripts\conf-nds.bat
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
134 )
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
135 )
632
ed19b429a152 - added explicit arm64 target, and clang tool options to Windows' configure.bat
Tassilo Philipp
parents: 352
diff changeset
136