build.bat 5.7 KB

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