Remove the '_' prefix from symbol names in Windows OpenWatcom builds

This commit is contained in:
Cameron Cawley
2022-05-19 20:11:10 +03:00
committed by Ozkan Sezer
parent aa51a9791a
commit 3d52d04977
3 changed files with 853 additions and 4 deletions
+7 -4
View File
@@ -11,6 +11,7 @@ DESCRIPTION = Simple DirectMedia Layer 2
LIBHOME = .
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
EXPFILE = $(LIBHOME)/$(LIBNAME).exp
LNKFILE = $(LIBNAME).lnk
INCPATH = -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h/nt/directx" -I"$(%WATCOM)/h"
@@ -31,8 +32,9 @@ CFLAGS_STATIC=$(CFLAGS)
# building dll:
CFLAGS_DLL =$(CFLAGS)
CFLAGS_DLL+= -bd
# building SDL itself (for DECLSPEC):
CFLAGS_DLL+= -DDLL_EXPORT
# we override the DECLSPEC define in begin_code.h, because we are using
# an exports file to remove the _cdecl '_' prefix from the symbol names
CFLAGS_DLL+= -DDECLSPEC=
CFLAGS_DLL+= -DSDL_BUILD_MAJOR_VERSION=$(MAJOR_VERSION)
CFLAGS_DLL+= -DSDL_BUILD_MINOR_VERSION=$(MINOR_VERSION)
@@ -116,7 +118,7 @@ $(DLLFILE): build_dll $(OBJS) $(MOBJS) $(RCOBJS) $(LNKFILE)
$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
wlib -q -b -n -c -pa -s -t -zld -ii -io $* @$(EXPFILE)
.c.obj:
wcc386 $(CFLAGS_DLL) -fo=$^@ $<
@@ -197,8 +199,9 @@ $(LNKFILE): Makefile.w32
@%append $@ NAME $(DLLFILE)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ EXPORT=src/dynapi/SDL2.exports
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
@%append $@ OPTION IMPF=$(EXPFILE)
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
@%append $@ OPTION ELIMINATE
File diff suppressed because it is too large Load Diff
+4
View File
@@ -33,6 +33,7 @@ use File::Basename;
chdir(dirname(__FILE__) . '/../..');
my $sdl_dynapi_procs_h = "src/dynapi/SDL_dynapi_procs.h";
my $sdl_dynapi_overrides_h = "src/dynapi/SDL_dynapi_overrides.h";
my $sdl2_exports = "src/dynapi/SDL2.exports";
my %existing = ();
if (-f $sdl_dynapi_procs_h) {
@@ -47,6 +48,7 @@ if (-f $sdl_dynapi_procs_h) {
open(SDL_DYNAPI_PROCS_H, '>>', $sdl_dynapi_procs_h) or die("Can't open $sdl_dynapi_procs_h: $!\n");
open(SDL_DYNAPI_OVERRIDES_H, '>>', $sdl_dynapi_overrides_h) or die("Can't open $sdl_dynapi_overrides_h: $!\n");
open(SDL2_EXPORTS, '>>', $sdl2_exports) or die("Can't open $sdl2_exports: $!\n");
opendir(HEADERS, 'include') or die("Can't open include dir: $!\n");
while (my $d = readdir(HEADERS)) {
@@ -133,6 +135,7 @@ while (my $d = readdir(HEADERS)) {
print("NEW: $decl\n");
print SDL_DYNAPI_PROCS_H "SDL_DYNAPI_PROC($rc,$fn,$paramstr,$argstr,$retstr)\n";
print SDL_DYNAPI_OVERRIDES_H "#define $fn ${fn}_REAL\n";
print SDL2_EXPORTS "++'_${fn}'.'SDL2.dll'.'${fn}'\n";
} else {
print("Failed to parse decl [$decl]!\n");
}
@@ -143,5 +146,6 @@ closedir(HEADERS);
close(SDL_DYNAPI_PROCS_H);
close(SDL_DYNAPI_OVERRIDES_H);
close(SDL2_EXPORTS);
# vi: set ts=4 sw=4 expandtab: