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