Created
December 19, 2010 19:15
-
-
Save jonforums/747602 to your computer and use it in GitHub Desktop.
Build patch for ANSICON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ANSI.c b/ANSI.c | |
index bb64c99..ddc5abc 100644 | |
--- a/ANSI.c | |
+++ b/ANSI.c | |
@@ -1281,7 +1281,8 @@ void OriginalAttr( void ) | |
// and terminated. | |
//----------------------------------------------------------------------------- | |
-__declspec(dllexport) // to stop MinGW exporting everything | |
+// use __declspec(dllexport) or -Wl,--exclude-all-symbols to stop MinGW | |
+// from automatically exporting everything | |
BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved ) | |
{ | |
BOOL bResult = TRUE; | |
diff --git a/makefile b/makefile | |
index fdd6721..c31ab7c 100644 | |
--- a/makefile | |
+++ b/makefile | |
@@ -8,23 +8,31 @@ | |
# 19 November, 2010: | |
# explicitly use 64-bit flags, in case the compiler isn't. | |
+RM = rm -f | |
+CP = cp | |
+ | |
CC = gcc | |
-CFLAGS = -O2 -Wall | |
+CFLAGS = $(optflags) $(warnflags) $(dbgflags) | |
+optflags = -O3 -march=native -mtune=native | |
+warnflags = -Wall | |
+dbgflags = -g | |
+ | |
+WINDRES = windres --preprocessor="$(CC) -E -xc" -DRC_INVOKED | |
X86OBJS = x86/proctype.o x86/injdll32.o x86/debugstr.o | |
X64OBJS = x64/proctype.o x64/injdll64.o x64/injdll32.o x64/debugstr.o | |
x86/%.o: %.c ansicon.h | |
- $(CC) -m32 -c $(CFLAGS) $(CPPFLAGS) $< -o $@ | |
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ | |
x86/%v.o: %.rc | |
- windres -U _WIN64 -F pe-i386 $< $@ | |
+ $(WINDRES) -U _WIN64 -F pe-i386 $< $@ | |
x64/%.o: %.c ansicon.h | |
$(CC) -m64 -c $(CFLAGS) $(CPPFLAGS) $< -o $@ | |
x64/%v.o: %.rc | |
- windres -F pe-x86-64 $< $@ | |
+ $(WINDRES) -F pe-x86-64 $< $@ | |
all: ansicon32 ansicon64 | |
@@ -36,22 +44,22 @@ x86: | |
mkdir x86 | |
x86/ansicon.exe: x86/ansicon.o $(X86OBJS) x86/ansiconv.o | |
- $(CC) -m32 $+ -s -o $@ -lpsapi -lole32 | |
+ $(CC) -m32 $+ -o $@ -lpsapi -lole32 | |
x86/ANSI32.dll: x86/ANSI.o $(X86OBJS) x86/ansiv.o | |
- $(CC) -m32 $+ -s -o $@ -mdll -Wl,-shared | |
+ $(CC) -m32 -shared -Wl,--exclude-all-symbols $+ -o $@ | |
x64: | |
mkdir x64 | |
x64/ansicon.exe: x64/ansicon.o $(X64OBJS) x64/ansiconv.o | |
- $(CC) -m64 $+ -s -o $@ -lpsapi -lole32 | |
+ $(CC) -m64 $+ -o $@ -lpsapi -lole32 | |
x64/ANSI64.dll: x64/ANSI.o $(X64OBJS) x64/ansiv.o | |
- $(CC) -m64 $+ -s -o $@ -mdll -Wl,-shared | |
+ $(CC) -m64 -shared -Wl,--exclude-all-symbols $+ -o $@ | |
x64/ANSI32.dll: x86/ANSI32.dll | |
- cp -p x86/ANSI32.dll x64/ANSI32.dll | |
+ $(CP) -p x86/ANSI32.dll x64/ANSI32.dll | |
x64/ANSI-LLW.exe: ANSI-LLW.c | |
$(CC) -m32 $(CFLAGS) $< -s -o $@ | |
@@ -62,5 +70,5 @@ x64/ansiconv.o: ansicon.rc | |
x64/ansiv.o: ansi.rc | |
clean: | |
- -rm x86/*.o | |
- -rm x64/*.o | |
+ $(RM) x86/*.o | |
+ $(RM) x64/*.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment