ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/contrib/win32build.bat
Revision: 188
Committed: Sun Oct 23 20:40:34 2005 UTC (20 years, 9 months ago) by adx
Content type: application/x-msdos-program
File size: 5740 byte(s)
Log Message:
* compile dynamic modules under win32

File Contents

# User Rev Content
1 adx 30 @echo off
2    
3     rem Don't change it unless you edit IRCD_PREFIX in setup-win32.h too!
4     set IRCD_PREFIX=C:\IRCD
5    
6     if exist src\ircd.c goto start
7     if exist ..\src\ircd.c goto start2
8     echo Are you sure you are executing this from ircd-hybrid sources directory?
9     goto end
10    
11     :start2
12     cd ..
13    
14     :start
15     if %1'==msvc' goto build
16     if %1'==bcc' goto build
17    
18     cls
19     echo.
20     echo IRCD-Hybrid Windows build script
21     echo (C) Copyright 2005 by the past and present ircd coders, and others.
22     echo.
23     echo Do you want to edit default ircd settings now? [Type YES or NO]
24     echo @echo off >yes.bat
25     echo edit contrib\setup-win32.h >>yes.bat
26     echo exit >>yes.bat
27     copy yes.bat y.bat >nul
28     echo @exit >no.bat
29     echo @exit >n.bat
30     %COMSPEC% /k prompt Your choice?
31     del yes.bat
32     del no.bat
33     del y.bat
34     del n.bat
35    
36     echo.
37     echo ------------------------------------------------
38     echo.
39     echo Which compiler do you want to use?
40     echo * If you are going to compile with Borland C++ Compiler, type: BCC
41     echo * If you want to use Microsoft Visual C++ Compiler, type: MSVC
42     echo @echo off >msvc.bat
43     echo call contrib\win32build msvc >>msvc.bat
44     echo exit >>msvc.bat
45     echo @echo off >bcc.bat
46     echo call contrib\win32build bcc >>bcc.bat
47     echo exit >>bcc.bat
48     %COMSPEC% /k prompt Your choice?
49     del bcc.bat
50     del msvc.bat
51     goto end2
52    
53     :build
54     echo.
55     echo *** Building ircd-hybrid
56     copy contrib\setup-win32.h include\setup.h >nul
57 adx 77 copy nul include\unistd.h >nul
58 adx 30
59 adx 188 for %%a in (ircd.exe src\irc_reslib.c src\rsa.c libio\net\res.c libio\net\reslib.c) do if exist %%a del %%a
60     for %%a in (modules\m_challenge.c modules\m_cryptlink.c contrib\libc_vprintf.c contrib\example_module.c) do if exist %%a del %%a
61 adx 74
62 adx 30 if %1'==msvc' goto msvc
63     set COMPILER=BCC
64 adx 188 bcc32 -q -tWD -6 -O -w- -elibio.dll -DIN_LIBIO -I"include" -I"libio" libio\comm\comm.c libio\comm\fdlist.c libio\comm\fileio.c libio\comm\win32.c libio\mem\*.c libio\misc\*.c libio\net\*.c libio\string\*.c
65 adx 30 if errorlevel 1 goto error
66 adx 153 if not exist libio.dll goto error
67 adx 184 implib libio.lib libio.dll
68 adx 153 if errorlevel 1 goto error
69 adx 184 if not exist libio.lib goto error
70 adx 188 bcc32 -q -tWD -6 -O -w- -eircd.dll -DIN_IRCD -I"include" -I"libio" src\*.c libio.lib
71 adx 184 if errorlevel 1 goto error
72 adx 185 if not exist ircd.dll goto error
73     implib ircd.lib ircd.dll
74     if errorlevel 1 goto error
75     if not exist ircd.lib goto error
76 adx 188 bcc32 -q -tW -6 -O -w- -eircd.exe src\ircd.c ircd.lib
77 adx 185 if errorlevel 1 goto error
78 adx 30 if not exist ircd.exe goto error
79 adx 188 for %%a in (modules\*.c) do bcc32 -q -tWD -6 -O -w- -nmodules -I"include" -I"libio" %%a libio.lib ircd.lib
80     if errorlevel 1 goto error
81     for %%a in (modules\core\*.c contrib\*.c) do bcc32 -q -tWD -6 -O -w- -I"include" -I"libio" %%a libio.lib ircd.lib
82     if errorlevel 1 goto error
83     for %%a in (rehash remotd kill) do bcc32 -q -tW -6 -O -w- -e%%a.exe -I"include" tools\win32\%%a.c
84 adx 30 goto built
85    
86     :msvc
87     set COMPILER=MSVC
88 adx 188 cl /nologo /O2 /Oy /GD /w /Felibio.dll /DIN_LIBIO /I"include" /I"libio" libio\comm\comm.c libio\comm\fdlist.c libio\comm\fileio.c libio\comm\win32.c libio\mem\*.c libio\misc\*.c libio\net\*.c libio\string\*.c user32.lib wsock32.lib /link /dll /subsystem:windows
89 adx 30 if errorlevel 1 goto error
90 adx 153 if not exist libio.dll goto error
91 adx 184 if not exist libio.lib goto error
92 adx 188 cl /nologo /O2 /Oy /GD /w /Feircd.dll /DIN_IRCD /I"include" /I"libio" src\*.c user32.lib wsock32.lib libio.lib /link /dll /subsystem:windows
93 adx 153 if errorlevel 1 goto error
94 adx 185 if not exist ircd.dll goto error
95     if not exist ircd.lib goto error
96 adx 188 cl /nologo /O2 /Oy /GA /w /Feircd.exe src\ircd.c ircd.lib /link /subsystem:windows
97 adx 185 if errorlevel 1 goto error
98 adx 30 if not exist ircd.exe goto error
99 adx 188 cd modules
100     for %%a in (*.c) do cl /nologo /O2 /Oy /GD /w /I"..\include" /I"..\libio" %%a libio.lib ircd.lib /link /dll /subsystem:windows
101     cd ..
102     if errorlevel 1 goto error
103     for %%a in (modules\core\*.c contrib\*.c) do cl /nologo /O2 /Oy /GD /w /I"include" /I"libio" %%a libio.lib ircd.lib /link /dll /subsystem:windows
104     if errorlevel 1 goto error
105     for %%a in (rehash remotd kill) do cl /nologo /O2 /Oy /GD /w /Fe%%a.exe /I"include" tools\win32\%%a.c user32.lib /link /subsystem:windows
106 adx 30
107     :built
108     if errorlevel 1 goto error
109     echo.
110     echo *** Installing ircd-hybrid into %IRCD_PREFIX% ...
111     echo.
112     if not exist %IRCD_PREFIX% md %IRCD_PREFIX%
113 adx 185 for %%a in (bin etc help help\opers help\users logs messages modules modules\autoload) do if not exist %IRCD_PREFIX%\%%a md %IRCD_PREFIX%\%%a
114 adx 188 move libio.dll %IRCD_PREFIX%\bin >nul
115     move ircd.dll %IRCD_PREFIX%\bin >nul
116     copy *.exe %IRCD_PREFIX%\bin >nul
117     copy modules\*.dll %IRCD_PREFIX%\modules\autoload >nul
118     copy *.dll %IRCD_PREFIX%\modules >nul
119 adx 30 for %%a in (etc\*.conf etc\*.conf.quick) do copy %%a %IRCD_PREFIX%\etc >nul
120     for %%a in (cresv.conf dline.conf nresv.conf rkline.conf rxline.conf xline.conf kline.conf) do type nul >>%IRCD_PREFIX%\etc\%%a
121     for %%a in (help\opers\* help\users\*) do copy %%a %IRCD_PREFIX%\%%a >nul
122 adx 188 cd contrib
123     for %%a in (help\opers\* help\users\*) do copy %%a %IRCD_PREFIX%\%%a >nul
124     cd ..
125 adx 30 for %%a in (messages\*.lang messages\README) do copy %%a %IRCD_PREFIX%\%%a >nul
126     echo *** Installation complete!
127     echo.
128     echo Remember to create the 'ircd.conf' file before actually starting the IRCD.
129     goto end
130    
131     :error
132     echo.
133     echo The compilation has failed. Make sure the %COMPILER% compiler you choose
134     echo is actually installed, and that you haven't accidentally corrupted
135     echo your setup.h file. A common problem is also not having the directory of
136     echo compiler binary in PATH environment variable.
137     if %COMPILER%==MSVC goto end
138     echo.
139     echo Borland C++ Compiler 5.5 users please remember to set up BCC32.CFG
140     echo in your C:\BCC\BIN directory (or wherever you installed it)!
141     echo It should contain two lines like -IC:\BCC\INCLUDE and -LC:\BCC\LIB.
142    
143     :end
144 adx 188 for %%a in (*.obj *.lib *.tds *.dll *.exp *.exe modules\*.obj modules\*.lib modules\*.tds modules\*.dll modules\*.exp) do del %%a
145 adx 30 echo.
146     pause
147     :end2
148     rem $Id$

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision