Browse Source

Make UnrealIRCd compile on Windows again.

Updated the makefile to build unrealircdctl.exe etc.
pull/41/head
Bram Matthys 11 months ago
parent
commit
98c0e786b5
No known key found for this signature in database
GPG Key ID: BF8116B163EAAE98
  1. 46
      Makefile.windows
  2. 23
      include/h.h
  3. 1
      include/sys.h
  4. 1
      include/windows/setup.h
  5. 23
      src/ircd.c
  6. 5
      src/proc_io_client.c
  7. 2
      src/unrealircdctl.c
  8. 1
      src/windows/unrealinst.iss
  9. 10
      src/windows/unrealircdctl.exe.manifest

46
Makefile.windows

@ -165,8 +165,7 @@ CFLAGS=$(DBGCFLAG) $(STDOPTIONS) /FS /MP1 /c /Fosrc/
CFLAGSST=$(DBGCFLAGST) $(STDOPTIONS) /FS /MP1 /c /Fosrc/
LFLAGS=kernel32.lib user32.lib gdi32.lib shell32.lib ws2_32.lib advapi32.lib \
dbghelp.lib oldnames.lib comctl32.lib comdlg32.lib $(STDLIBS) \
/def:UnrealIRCd.def /implib:UnrealIRCd.lib \
/nologo $(DBGLFLAG) /out:UnrealIRCd.exe
/nologo $(DBGLFLAG)
MODCFLAGS=$(MODDBGCFLAG) $(STDOPTIONS) /D DYNAMIC_LINKING /D MODULE_COMPILE
MODLFLAGS=/link /def:src/modules/module.def UnrealIRCd.lib ws2_32.lib $(STDLIBS)
@ -174,10 +173,10 @@ INCLUDES=./include/struct.h ./include/config.h ./include/sys.h \
./include/common.h ./include/version.h ./include/h.h ./include/numeric.h \
./include/msg.h ./include/setup.h ./include/dynconf.h
EXP_OBJ_FILES=src/channel.obj src/send.obj src/socket.obj \
src/conf.obj src/conf_preprocessor.obj \
EXP_OBJ_FILES=src/ircd_vars.obj src/channel.obj src/send.obj src/socket.obj \
src/conf.obj src/proc_io_server.obj src/conf_preprocessor.obj \
src/fdlist.obj src/dbuf.obj \
src/hash.obj src/parse.obj src/ircd.obj \
src/hash.obj src/parse.obj \
src/whowas.obj \
src/misc.obj src/match.obj src/crule.obj \
src/debug.obj src/support.obj src/list.obj \
@ -194,7 +193,7 @@ EXP_OBJ_FILES=src/channel.obj src/send.obj src/socket.obj \
src/utf8.obj src/log.obj $(CURLOBJ)
OBJ_FILES=$(EXP_OBJ_FILES) src/gui.obj src/service.obj src/windebug.obj src/rtf.obj \
src/editor.obj src/win.obj
src/editor.obj src/win.obj src/ircd.obj src/proc_io_client.obj
DLL_FILES=\
src/modules/account-notify.dll \
@ -411,7 +410,7 @@ DLL_FILES=\
src/modules/whox.dll
ALL: CONF UNREALSVC.EXE UnrealIRCd.exe MODULES
ALL: CONF unrealircdctl.exe UNREALSVC.EXE UnrealIRCd.exe MODULES
CLEAN:
-@del /Q /S *.dll *.exe *.obj *.pdb *.res *.lib *.exp *.ilk src\version.c >NUL
@ -424,21 +423,27 @@ CONF:
$(CC) src/windows/config.c
-@config.exe
UnrealIRCd.exe: $(OBJ_FILES) src/windows/win.res
$(LINK) $(LFLAGS) $(OBJ_FILES) src/windows/win.res /MAP
UnrealIRCd.exe: $(OBJ_FILES) src/ircd.obj src/windows/win.res
$(LINK) $(LFLAGS) /out:UnrealIRCd.exe /def:UnrealIRCd.def /implib:UnrealIRCd.lib $(OBJ_FILES) src/windows/win.res /MAP
-@erase src\windows\win.res
$(MT) -manifest src\windows\UnrealIRCd.exe.manifest -outputresource:UnrealIRCd.exe;1
!IFNDEF DEBUGEXTRA
@echo Standard version built
!ELSE
@echo Extra-Debug version built ...
!ENDIF
unrealircdctl.exe: $(OBJ_FILES) src/unrealircdctl.obj src/proc_io_client.obj
$(LINK) $(LFLAGS) /SUBSYSTEM:CONSOLE /out:unrealircdctl.exe $(OBJ_FILES) src/unrealircdctl.obj
$(MT) -manifest src\windows\unrealircdctl.exe.manifest -outputresource:unrealircdctl.exe;1
# alternative option -- FIXME: REMOVE / CHOOSE
#unrealircdctl.exe: $(OBJ_FILES) src/unrealircdctl.obj src/proc_io_client.obj src/windows/unrealircdctl.res
# $(LINK) $(LFLAGS) /out:unrealircdctl.exe $(OBJ_FILES) src/unrealircdctl.obj src/windows/unrealircdctl.res
#Source files
src/version.obj: src/version.c
$(CC) $(CFLAGS) src/version.c
src/ircd_vars.obj: src/ircd_vars.c $(INCLUDES)
$(CC) $(CFLAGS) src/ircd_vars.c
src/parse.obj: src/parse.c $(INCLUDES)
$(CC) $(CFLAGS) src/parse.c
@ -485,6 +490,12 @@ src/dns.obj: src/dns.c $(INCLUDES)
src/conf.obj: src/conf.c $(INCLUDES)
$(CC) $(CFLAGS) src/conf.c
src/proc_io_server.obj: src/proc_io_server.c $(INCLUDES)
$(CC) $(CFLAGS) src/proc_io_server.c
src/proc_io_client.obj: src/proc_io_client.c $(INCLUDES)
$(CC) $(CFLAGS) src/proc_io_client.c
src/conf_preprocessor.obj: src/conf_preprocessor.c $(INCLUDES)
$(CC) $(CFLAGS) src/conf_preprocessor.c
@ -540,6 +551,9 @@ src/win.obj: src/windows/win.c $(INCLUDES)
src/unrealsvc.obj: src/windows/unrealsvc.c $(INCLUDES)
$(CC) $(CFLAGSST) src/windows/unrealsvc.c
src/unrealircdctl.obj: src/unrealircdctl.c $(INCLUDES)
$(CC) $(CFLAGS) src/unrealircdctl.c
src/modules.obj: src/modules.c $(INCLUDES)
$(CC) $(CFLAGS) src/modules.c
@ -623,6 +637,10 @@ src/windows/unrealsvc.res: src/windows/unrealsvc.rc
$(RC) /l 0x409 /fosrc/windows/unrealsvc.res /i ./include /i ./src \
/d NDEBUG src/windows/unrealsvc.rc
src/windows/unrealircdctl.res: src/windows/unrealircdctl.rc
$(RC) /l 0x409 /fosrc/windows/unrealircdctl.res /i ./include /i ./src \
/d NDEBUG src/windows/unrealircdctl.rc
################# Modules #################
CUSTOMMODULE: src/modules/third/$(MODULEFILE).c

23
include/h.h

@ -34,6 +34,28 @@ extern char **myargv;
#else
extern LPCSTR cmdLine;
#endif
/* Externals */
extern MODVAR char *buildid;
extern MODVAR char backupbuf[8192];
extern EVENT(unrealdns_removeoldrecords);
extern EVENT(unrealdb_expire_secret_cache);
extern void init_glines(void);
extern void tkl_init(void);
extern void process_clients(void);
extern void unrealdb_test(void);
extern void ignore_this_signal();
extern void s_rehash();
extern void s_reloadcert();
extern void s_restart();
extern void s_die();
#ifndef _WIN32
// nix specific
extern char unreallogo[];
#else
// windows specific
extern SERVICE_STATUS_HANDLE IRCDStatusHandle;
extern SERVICE_STATUS IRCDStatus;
#endif
extern MODVAR char *extraflags;
extern MODVAR int tainted;
extern MODVAR Member *freemember;
@ -670,7 +692,6 @@ extern int spamfilter_getconftargets(const char *s);
extern void remove_all_snomasks(Client *client);
extern void remove_oper_modes(Client *client);
extern char *spamfilter_inttostring_long(int v);
extern MODVAR char backupbuf[];
extern int is_invited(Client *client, Channel *channel);
extern void channel_modes(Client *client, char *mbuf, char *pbuf, size_t mbuf_size, size_t pbuf_size, Channel *channel, int hide_local_modes);
extern int op_can_override(const char *acl, Client *client,Channel *channel,void* extra);

1
include/sys.h

@ -63,6 +63,7 @@
#else
#include <winsock2.h>
#include <ws2tcpip.h>
#include <afunix.h>
#endif
#ifndef _WIN32

1
include/windows/setup.h

@ -33,6 +33,7 @@
#define CACHEDIR "cache"
#define TMPDIR "tmp"
#define PIDFILE PERMDATADIR"/unrealircd.pid"
#define CONTROLFILE PERMDATADIR"/unrealircd.ctl"
#define NO_U_TYPES
#define NEED_U_INT32_T
#define strcasecmp _stricmp

23
src/ircd.c

@ -25,29 +25,6 @@
char *malloc_options = "h" MALLOC_FLAGS_EXTRA;
#endif
/* Externals */
extern MODVAR char *buildid;
extern char backupbuf[8192];
extern EVENT(unrealdns_removeoldrecords);
extern EVENT(unrealdb_expire_secret_cache);
extern void init_glines(void);
extern void tkl_init(void);
extern void process_clients(void);
extern void unrealdb_test(void);
extern void ignore_this_signal();
extern void s_rehash();
extern void s_reloadcert();
extern void s_restart();
extern void s_die();
#ifndef _WIN32
// nix specific
extern char unreallogo[];
#else
// windows specific
extern SERVICE_STATUS_HANDLE IRCDStatusHandle;
extern SERVICE_STATUS IRCDStatus;
#endif
/* Forward declarations */
void server_reboot(const char *);
void restart(const char *);

5
src/proc_io_client.c

@ -32,7 +32,12 @@ int procio_client_connect(const char *file)
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0)
{
fprintf(stderr, "Cannot communicate to UnrealIRCd: %s\n"
"Your operating system does not support UNIX Sockets?\n",
strerror(ERRNO));
return -1;
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;

2
src/unrealircdctl.c

@ -73,6 +73,8 @@ void unrealircdctl_status(void)
int main(int argc, char *argv[])
{
WSADATA wsaData;
WSAStartup(MAKEWORD(1,1), &wsaData);
dbuf_init();
if (argc == 1)

1
src/windows/unrealinst.iss

@ -45,6 +45,7 @@ Name: "fixperm"; Description: "Make UnrealIRCd folder writable by current user";
; UnrealIRCd binaries
Source: "UnrealIRCd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce
Source: "UnrealIRCd.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "unrealircdctl.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce
Source: "unrealsvc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion signonce
; TLS certificate generation helpers

10
src/windows/unrealircdctl.exe.manifest

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="amd64"
name="UnrealIRCd.UnrealIRCd.6"
version="6.0.1.0"
type="win32"
/>
<description>UnrealIRCd - Control utility</description>
</assembly>
Loading…
Cancel
Save