3 rem ========================================================================
4 rem Batch file to automate building OpenSSL for NetWare.
7 rem build [target] [debug opts] [assembly opts] [configure opts]
9 rem target - "netware-clib" - CLib NetWare build (WinSock Sockets)
10 rem - "netware-libc" - LibC NKS NetWare build (WinSock Sockets)
11 rem - "netware-libc-bsdsock" - LibC NKS NetWare build (BSD Sockets)
13 rem debug opts - "debug" - build debug
15 rem assembly opts - "nw-mwasm" - use Metrowerks assembler
16 rem - "nw-nasm" - use NASM assembler
17 rem - "no-asm" - don't use assembly
19 rem configure opts- all unrecognized arguments are passed to the
20 rem perl configure script
22 rem If no arguments are specified the default is to build non-debug with
23 rem no assembly. NOTE: there is no default BLD_TARGET.
28 rem No assembly is the default - Uncomment section below to change
29 rem the assembler default
34 rem Uncomment to default to the Metrowerks assembler
35 rem set ASM_MODE=nw-mwasm
36 rem set ASSEMBLER=Metrowerks
39 rem Uncomment to default to the NASM assembler
40 rem set ASM_MODE=nw-nasm
41 rem set ASSEMBLER=NASM
44 rem No default Bld target
45 set BLD_TARGET
=no_target
46 rem set BLD_TARGET=netware-clib
47 rem set BLD_TARGET=netware-libc
50 rem Default to build non-debug
53 rem Uncomment to default to debug build
61 rem Process command line args
63 if "a%1" == "a" goto endopt
64 if "%1" == "no-asm" set NO_ASM
=no
-asm
65 if "%1" == "no-asm" set ARG_PROCESSED
=YES
66 if "%1" == "debug" set DEBUG=debug
67 if "%1" == "debug" set ARG_PROCESSED
=YES
68 if "%1" == "nw-nasm" set ASM_MODE
=nw
-nasm
69 if "%1" == "nw-nasm" set ASSEMBLER
=NASM
70 if "%1" == "nw-nasm" set NO_ASM
=
71 if "%1" == "nw-nasm" set ARG_PROCESSED
=YES
72 if "%1" == "nw-mwasm" set ASM_MODE
=nw
-mwasm
73 if "%1" == "nw-mwasm" set ASSEMBLER
=Metrowerks
74 if "%1" == "nw-mwasm" set NO_ASM
=
75 if "%1" == "nw-mwasm" set ARG_PROCESSED
=YES
76 if "%1" == "netware-clib" set BLD_TARGET
=netware
-clib
77 if "%1" == "netware-clib" set ARG_PROCESSED
=YES
78 if "%1" == "netware-libc" set BLD_TARGET
=netware
-libc
79 if "%1" == "netware-libc" set ARG_PROCESSED
=YES
80 if "%1" == "netware-libc-bsdsock" set BLD_TARGET
=netware
-libc
-bsdsock
81 if "%1" == "netware-libc-bsdsock" set ARG_PROCESSED
=YES
83 rem If we didn't recognize the argument, consider it an option for config
84 if "%ARG_PROCESSED%" == "NO" set CONFIG_OPTS
=%CONFIG_OPTS% %1
85 if "%ARG_PROCESSED%" == "YES" set ARG_PROCESSED
=NO
91 rem make sure a valid BLD_TARGET was specified
92 if "%BLD_TARGET%" == "no_target" goto no_target
94 rem build the nlm make file name which includes target and debug info
96 if "%BLD_TARGET%" == "netware-clib" set NLM_MAKE
=netware
\nlm_clib
97 if "%BLD_TARGET%" == "netware-libc" set NLM_MAKE
=netware
\nlm_libc
98 if "%BLD_TARGET%" == "netware-libc-bsdsock" set NLM_MAKE
=netware
\nlm_libc_bsdsock
99 if "%DEBUG%" == "" set NLM_MAKE
=%NLM_MAKE%.mak
100 if "%DEBUG%" == "debug" set NLM_MAKE
=%NLM_MAKE%_dbg.mak
102 if "%NO_ASM%" == "no-asm" set ASM_MODE
=
103 if "%NO_ASM%" == "no-asm" set ASSEMBLER
=
104 if "%NO_ASM%" == "no-asm" set CONFIG_OPTS
=%CONFIG_OPTS% no
-asm
105 if "%NO_ASM%" == "no-asm" goto do_config
108 rem ==================================================
109 echo Generating x86
for %ASSEMBLER% assembler
113 perl x86.pl
%ASM_MODE% > bn
-nw.asm
118 perl des
-586.pl
%ASM_MODE% > d
-nw.asm
124 perl crypt586.pl
%ASM_MODE% > y
-nw.asm
130 perl bf
-586.pl
%ASM_MODE% > b
-nw.asm
135 perl cast
-586.pl
%ASM_MODE% > c
-nw.asm
140 perl rc4
-586.pl
%ASM_MODE% > r4
-nw.asm
145 perl md5
-586.pl
%ASM_MODE% > m5
-nw.asm
150 perl sha1
-586.pl
%ASM_MODE% > s1
-nw.asm
155 perl rmd
-586.pl
%ASM_MODE% > rm
-nw.asm
160 perl rc5
-586.pl
%ASM_MODE% > r5
-nw.asm
163 rem ===============================================================
168 echo configure options
: %CONFIG_OPTS% %BLD_TARGET%
170 perl configure
%CONFIG_OPTS% %BLD_TARGET%
172 perl util\mkfiles.pl
>MINFO
175 echo mk1mf.pl options
: %DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET%
177 perl util\mk1mf.pl
%DEBUG% %ASM_MODE% %CONFIG_OPTS% %BLD_TARGET% >%NLM_MAKE%
179 echo The makefile
"%NLM_MAKE%" has been created
use your maketool to
180 echo build
(ex
: gmake
-f
%NLM_MAKE%)
183 rem ===============================================================
187 echo . No build target specified
!!!
189 echo . usage
: build
[target
] [debug opts
] [assembly opts
] [configure opts
]
191 echo . target
- "netware-clib" - CLib NetWare build
(WinSock Sockets
)
192 echo .
- "netware-libc" - LibC NKS NetWare build
(WinSock Sockets
)
193 echo .
- "netware-libc-bsdsock" - LibC NKS NetWare build
(BSD Sockets
)
195 echo .
debug opts
- "debug" - build
debug
197 echo . assembly opts
- "nw-mwasm" - use Metrowerks assembler
198 echo .
"nw-nasm" - use NASM assembler
199 echo .
"no-asm" - don
't use assembly
201 echo . configure opts- all unrecognized arguments are passed to the
202 echo . perl configure script
204 echo . If no debug or assembly opts are specified the default is to build
205 echo . non-debug without assembly