set_env.bat 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. @echo off
  2. rem ========================================================================
  3. rem Batch file to assist in setting up the necessary enviroment for
  4. rem building OpenSSL for NetWare.
  5. rem
  6. rem usage:
  7. rem set_env [target]
  8. rem
  9. rem target - "netware-clib" - Clib build
  10. rem - "netware-libc" - LibC build
  11. rem
  12. rem
  13. if "a%1" == "a" goto usage
  14. set LIBC_BUILD=
  15. set CLIB_BUILD=
  16. set GNUC=
  17. if "%1" == "netware-clib" set CLIB_BUILD=Y
  18. if "%1" == "netware-clib" set LIBC_BUILD=
  19. if "%1" == "netware-libc" set LIBC_BUILD=Y
  20. if "%1" == "netware-libc" set CLIB_BUILD=
  21. if "%2" == "gnuc" set GNUC=Y
  22. if "%2" == "codewarrior" set GNUC=
  23. rem Location of tools (compiler, linker, etc)
  24. if "%NDKBASE%" == "" set NDKBASE=c:\Novell
  25. rem If Perl for Win32 is not already in your path, add it here
  26. set PERL_PATH=
  27. rem Define path to the Metrowerks command line tools
  28. rem or GNU Crosscompiler gcc / nlmconv
  29. rem ( compiler, assembler, linker)
  30. if "%GNUC%" == "Y" set COMPILER_PATH=c:\usr\i586-netware\bin;c:\usr\bin
  31. if "%GNUC%" == "" set COMPILER_PATH=c:\prg\cwcmdl40
  32. rem If using gnu make define path to utility
  33. rem set GNU_MAKE_PATH=%NDKBASE%\gnu
  34. set GNU_MAKE_PATH=c:\prg\tools
  35. rem If using ms nmake define path to nmake
  36. rem set MS_NMAKE_PATH=%NDKBASE%\msvc\600\bin
  37. rem If using NASM assembler define path
  38. rem set NASM_PATH=%NDKBASE%\nasm
  39. set NASM_PATH=c:\prg\tools
  40. rem Update path to include tool paths
  41. set path=%path%;%COMPILER_PATH%
  42. if not "%GNU_MAKE_PATH%" == "" set path=%path%;%GNU_MAKE_PATH%
  43. if not "%MS_NMAKE_PATH%" == "" set path=%path%;%MS_NMAKE_PATH%
  44. if not "%NASM_PATH%" == "" set path=%path%;%NASM_PATH%
  45. if not "%PERL_PATH%" == "" set path=%path%;%PERL_PATH%
  46. rem Set INCLUDES to location of Novell NDK includes
  47. if "%LIBC_BUILD%" == "Y" set INCLUDE=%NDKBASE%\ndk\libc\include;%NDKBASE%\ndk\libc\include\winsock
  48. if "%CLIB_BUILD%" == "Y" set INCLUDE=%NDKBASE%\ndk\nwsdk\include\nlm;%NDKBASE%\ws295sdk\include
  49. rem Set Imports to location of Novell NDK import files
  50. if "%LIBC_BUILD%" == "Y" set IMPORTS=%NDKBASE%\ndk\libc\imports
  51. if "%CLIB_BUILD%" == "Y" set IMPORTS=%NDKBASE%\ndk\nwsdk\imports
  52. rem Set PRELUDE to the absolute path of the prelude object to link with in
  53. rem the Metrowerks NetWare PDK - NOTE: for Clib builds "clibpre.o" is
  54. rem recommended, for LibC NKS builds libcpre.o must be used
  55. if "%GNUC%" == "Y" goto gnuc
  56. if "%LIBC_BUILD%" == "Y" set PRELUDE=%IMPORTS%\libcpre.o
  57. rem if "%CLIB_BUILD%" == "Y" set PRELUDE=%IMPORTS%\clibpre.o
  58. if "%CLIB_BUILD%" == "Y" set PRELUDE=%IMPORTS%\prelude.o
  59. echo using MetroWerks CodeWarrior
  60. goto info
  61. :gnuc
  62. if "%LIBC_BUILD%" == "Y" set PRELUDE=%IMPORTS%\libcpre.gcc.o
  63. rem if "%CLIB_BUILD%" == "Y" set PRELUDE=%IMPORTS%\clibpre.gcc.o
  64. if "%CLIB_BUILD%" == "Y" set PRELUDE=%IMPORTS%\prelude.gcc.o
  65. echo using GNU GCC Compiler
  66. :info
  67. echo.
  68. if "%LIBC_BUILD%" == "Y" echo Enviroment configured for LibC build
  69. if "%LIBC_BUILD%" == "Y" echo use "netware\build.bat netware-libc ..."
  70. if "%CLIB_BUILD%" == "Y" echo Enviroment configured for CLib build
  71. if "%CLIB_BUILD%" == "Y" echo use "netware\build.bat netware-clib ..."
  72. goto end
  73. :usage
  74. rem ===============================================================
  75. echo.
  76. echo No target build specified!
  77. echo.
  78. echo usage: set_env [target] [compiler]
  79. echo.
  80. echo target - "netware-clib" - Clib build
  81. echo - "netware-libc" - LibC build
  82. echo.
  83. echo compiler - "gnuc" - GNU GCC Compiler
  84. echo - "codewarrior" - MetroWerks CodeWarrior (default)
  85. echo.
  86. :end
  87. echo.