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