2
0

build.bat 6.5 KB

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