]>
Commit | Line | Data |
---|---|---|
4d8743f4 RL |
1 | @echo off |
2 | ||
3 | rem ======================================================================== | |
4 | rem Batch file to automate building OpenSSL for NetWare. | |
5 | rem | |
6 | rem usage: | |
7 | rem build [target] [debug opts] [assembly opts] [configure opts] | |
8 | rem | |
cbcbd07d | 9 | rem target - "netware-clib" - CLib NetWare build (WinSock Sockets) |
3b0e61a8 DSH |
10 | rem - "netware-clib-bsdsock" - CLib NetWare build (BSD Sockets) |
11 | rem - "netware-libc" - LibC NetWare build (WinSock Sockets) | |
12 | rem - "netware-libc-bsdsock" - LibC NetWare build (BSD Sockets) | |
4d8743f4 RL |
13 | rem |
14 | rem debug opts - "debug" - build debug | |
15 | rem | |
16 | rem assembly opts - "nw-mwasm" - use Metrowerks assembler | |
cbcbd07d RL |
17 | rem - "nw-nasm" - use NASM assembler |
18 | rem - "no-asm" - don't use assembly | |
4d8743f4 RL |
19 | rem |
20 | rem configure opts- all unrecognized arguments are passed to the | |
21 | rem perl configure script | |
22 | rem | |
23 | rem If no arguments are specified the default is to build non-debug with | |
24 | rem no assembly. NOTE: there is no default BLD_TARGET. | |
25 | rem | |
26 | ||
27 | ||
28 | ||
29 | rem No assembly is the default - Uncomment section below to change | |
30 | rem the assembler default | |
31 | set ASM_MODE= | |
32 | set ASSEMBLER= | |
33 | set NO_ASM=no-asm | |
34 | ||
35 | rem Uncomment to default to the Metrowerks assembler | |
36 | rem set ASM_MODE=nw-mwasm | |
37 | rem set ASSEMBLER=Metrowerks | |
38 | rem set NO_ASM= | |
39 | ||
40 | rem Uncomment to default to the NASM assembler | |
41 | rem set ASM_MODE=nw-nasm | |
42 | rem set ASSEMBLER=NASM | |
43 | rem set NO_ASM= | |
44 | ||
45 | rem No default Bld target | |
46 | set BLD_TARGET=no_target | |
47 | rem set BLD_TARGET=netware-clib | |
48 | rem set BLD_TARGET=netware-libc | |
49 | ||
50 | ||
51 | rem Default to build non-debug | |
52 | set DEBUG= | |
53 | ||
54 | rem Uncomment to default to debug build | |
55 | rem set DEBUG=debug | |
56 | ||
57 | ||
58 | set CONFIG_OPTS= | |
59 | set ARG_PROCESSED=NO | |
60 | ||
61 | ||
62 | rem Process command line args | |
63 | :opts | |
64 | if "a%1" == "a" goto endopt | |
65 | if "%1" == "no-asm" set NO_ASM=no-asm | |
66 | if "%1" == "no-asm" set ARG_PROCESSED=YES | |
67 | if "%1" == "debug" set DEBUG=debug | |
68 | if "%1" == "debug" set ARG_PROCESSED=YES | |
69 | if "%1" == "nw-nasm" set ASM_MODE=nw-nasm | |
70 | if "%1" == "nw-nasm" set ASSEMBLER=NASM | |
71 | if "%1" == "nw-nasm" set NO_ASM= | |
72 | if "%1" == "nw-nasm" set ARG_PROCESSED=YES | |
73 | if "%1" == "nw-mwasm" set ASM_MODE=nw-mwasm | |
74 | if "%1" == "nw-mwasm" set ASSEMBLER=Metrowerks | |
3b0e61a8 | 75 | if "%1" == "nw-mwasm" set NO_ASM= |
4d8743f4 RL |
76 | if "%1" == "nw-mwasm" set ARG_PROCESSED=YES |
77 | if "%1" == "netware-clib" set BLD_TARGET=netware-clib | |
78 | if "%1" == "netware-clib" set ARG_PROCESSED=YES | |
3b0e61a8 DSH |
79 | if "%1" == "netware-clib-bsdsock" set BLD_TARGET=netware-clib-bsdsock |
80 | if "%1" == "netware-clib-bsdsock" set ARG_PROCESSED=YES | |
4d8743f4 RL |
81 | if "%1" == "netware-libc" set BLD_TARGET=netware-libc |
82 | if "%1" == "netware-libc" set ARG_PROCESSED=YES | |
cbcbd07d RL |
83 | if "%1" == "netware-libc-bsdsock" set BLD_TARGET=netware-libc-bsdsock |
84 | if "%1" == "netware-libc-bsdsock" set ARG_PROCESSED=YES | |
4d8743f4 RL |
85 | |
86 | rem If we didn't recognize the argument, consider it an option for config | |
87 | if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS=%CONFIG_OPTS% %1 | |
88 | if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED=NO | |
89 | ||
90 | shift | |
91 | goto opts | |
92 | :endopt | |
93 | ||
94 | rem make sure a valid BLD_TARGET was specified | |
95 | if "%BLD_TARGET%" == "no_target" goto no_target | |
96 | ||
97 | rem build the nlm make file name which includes target and debug info | |
98 | set NLM_MAKE= | |
99 | if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE=netware\nlm_clib | |
3b0e61a8 | 100 | if "%BLD_TARGET%" == "netware-clib-bsdsock" set NLM_MAKE=netware\nlm_clib_bsdsock |
4d8743f4 | 101 | if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE=netware\nlm_libc |
cbcbd07d | 102 | if "%BLD_TARGET%" == "netware-libc-bsdsock" set NLM_MAKE=netware\nlm_libc_bsdsock |
4d8743f4 RL |
103 | if "%DEBUG%" == "" set NLM_MAKE=%NLM_MAKE%.mak |
104 | if "%DEBUG%" == "debug" set NLM_MAKE=%NLM_MAKE%_dbg.mak | |
105 | ||
106 | if "%NO_ASM%" == "no-asm" set ASM_MODE= | |
107 | if "%NO_ASM%" == "no-asm" set ASSEMBLER= | |
108 | if "%NO_ASM%" == "no-asm" set CONFIG_OPTS=%CONFIG_OPTS% no-asm | |
109 | if "%NO_ASM%" == "no-asm" goto do_config | |
110 | ||
111 | ||
112 | rem ================================================== | |
113 | echo Generating x86 for %ASSEMBLER% assembler | |
114 | ||
115 | echo Bignum | |
116 | cd crypto\bn\asm | |
3b0e61a8 DSH |
117 | rem perl x86.pl %ASM_MODE% > bn-nw.asm |
118 | perl bn-586.pl %ASM_MODE% > bn-nw.asm | |
119 | perl co-586.pl %ASM_MODE% > co-nw.asm | |
120 | cd ..\..\.. | |
121 | ||
122 | echo AES | |
123 | cd crypto\aes\asm | |
124 | perl aes-586.pl %ASM_MODE% > a-nw.asm | |
4d8743f4 RL |
125 | cd ..\..\.. |
126 | ||
127 | echo DES | |
128 | cd crypto\des\asm | |
129 | perl des-586.pl %ASM_MODE% > d-nw.asm | |
130 | cd ..\..\.. | |
131 | ||
132 | echo "crypt(3)" | |
133 | ||
134 | cd crypto\des\asm | |
135 | perl crypt586.pl %ASM_MODE% > y-nw.asm | |
136 | cd ..\..\.. | |
137 | ||
138 | echo Blowfish | |
139 | ||
140 | cd crypto\bf\asm | |
141 | perl bf-586.pl %ASM_MODE% > b-nw.asm | |
142 | cd ..\..\.. | |
143 | ||
144 | echo CAST5 | |
145 | cd crypto\cast\asm | |
146 | perl cast-586.pl %ASM_MODE% > c-nw.asm | |
147 | cd ..\..\.. | |
148 | ||
149 | echo RC4 | |
150 | cd crypto\rc4\asm | |
151 | perl rc4-586.pl %ASM_MODE% > r4-nw.asm | |
152 | cd ..\..\.. | |
153 | ||
154 | echo MD5 | |
155 | cd crypto\md5\asm | |
156 | perl md5-586.pl %ASM_MODE% > m5-nw.asm | |
157 | cd ..\..\.. | |
158 | ||
159 | echo SHA1 | |
160 | cd crypto\sha\asm | |
161 | perl sha1-586.pl %ASM_MODE% > s1-nw.asm | |
162 | cd ..\..\.. | |
163 | ||
164 | echo RIPEMD160 | |
165 | cd crypto\ripemd\asm | |
166 | perl rmd-586.pl %ASM_MODE% > rm-nw.asm | |
167 | cd ..\..\.. | |
168 | ||
169 | echo RC5\32 | |
170 | cd crypto\rc5\asm | |
171 | perl rc5-586.pl %ASM_MODE% > r5-nw.asm | |
172 | cd ..\..\.. | |
173 | ||
3b0e61a8 DSH |
174 | echo CPUID |
175 | cd crypto | |
176 | perl x86cpuid.pl %ASM_MODE% > x86cpuid-nw.asm | |
177 | cd ..\ | |
178 | ||
4d8743f4 RL |
179 | rem =============================================================== |
180 | rem | |
181 | :do_config | |
182 | ||
183 | echo . | |
184 | echo configure options: %CONFIG_OPTS% %BLD_TARGET% | |
185 | echo . | |
186 | perl configure %CONFIG_OPTS% %BLD_TARGET% | |
187 | ||
188 | perl util\mkfiles.pl >MINFO | |
189 | ||
190 | echo . | |
191 | echo mk1mf.pl options: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% | |
192 | echo . | |
193 | perl util\mk1mf.pl %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE% | |
194 | ||
3b0e61a8 DSH |
195 | make -f %NLM_MAKE% vclean |
196 | echo . | |
4d8743f4 | 197 | echo The makefile "%NLM_MAKE%" has been created use your maketool to |
3b0e61a8 | 198 | echo build (ex: make -f %NLM_MAKE%) |
4d8743f4 RL |
199 | goto end |
200 | ||
201 | rem =============================================================== | |
202 | rem | |
203 | :no_target | |
204 | echo . | |
205 | echo . No build target specified!!! | |
206 | echo . | |
207 | echo . usage: build [target] [debug opts] [assembly opts] [configure opts] | |
208 | echo . | |
cbcbd07d | 209 | echo . target - "netware-clib" - CLib NetWare build (WinSock Sockets) |
3b0e61a8 DSH |
210 | echo . - "netware-clib-bsdsock" - CLib NetWare build (BSD Sockets) |
211 | echo . - "netware-libc" - LibC NetWare build (WinSock Sockets) | |
212 | echo . - "netware-libc-bsdsock" - LibC NetWare build (BSD Sockets) | |
4d8743f4 RL |
213 | echo . |
214 | echo . debug opts - "debug" - build debug | |
215 | echo . | |
216 | echo . assembly opts - "nw-mwasm" - use Metrowerks assembler | |
217 | echo . "nw-nasm" - use NASM assembler | |
218 | echo . "no-asm" - don't use assembly | |
219 | echo . | |
220 | echo . configure opts- all unrecognized arguments are passed to the | |
221 | echo . perl configure script | |
222 | echo . | |
223 | echo . If no debug or assembly opts are specified the default is to build | |
224 | echo . non-debug without assembly | |
225 | echo . | |
226 | ||
227 | ||
228 | :end |