changeset 5932:bb7723f0b4b9

[gaim-migrate @ 6372] Changed dll build rules in the mingw makefiles. Plugins will no longer crash when built with the '-g' compile flag and plugin crashes will now produce the correct debug info. committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sat, 21 Jun 2003 01:03:23 +0000
parents 8b5dd7117f56
children 44eb6d75a5c6
files plugins/Makefile.mingw plugins/perl/Makefile.mingw plugins/ticker/Makefile.mingw plugins/win32/transparency/Makefile.mingw plugins/win32/winprefs/Makefile.mingw src/Makefile.mingw src/protocols/gg/Makefile.mingw src/protocols/irc/Makefile.mingw src/protocols/jabber/Makefile.mingw src/protocols/msn/Makefile.mingw src/protocols/napster/Makefile.mingw src/protocols/oscar/Makefile.mingw src/protocols/toc/Makefile.mingw src/protocols/trepia/Makefile.mingw src/protocols/yahoo/Makefile.mingw src/win32/IdleTracker/Makefile.mingw src/win32/global.mak
diffstat 17 files changed, 171 insertions(+), 363 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/plugins/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -62,7 +62,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgobject-2.0 -lgmodule-2.0 -lintl -lws2_32 -liberty -lgaim
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgobject-2.0 \
+			-lgmodule-2.0 \
+			-lintl \
+			-lws2_32 \
+			-lgaim
 
 ##
 ## RULES
@@ -92,12 +99,8 @@
 #
 
 .c.dll:
-	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o tmp$@.o -c $<
-	dlltool -D $@ -z $@.def tmp$@.o
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@.base tmp$@.o $(LIB_PATHS) $(LIBS)
-	dlltool -D $@ -b $@.base -e $@.exp -d $@.def
-	$(CC) -mdll -o $@ tmp$@.o -Wl,$@.exp $(LIB_PATHS) $(LIBS)
-	rm -rf $@.base $@.def $@.exp junk.tmp
+	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $<
+	$(CC) -shared $@.o $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $@
 
 plugins: iconaway.dll spellchk.dll autorecon.dll
 
--- a/plugins/perl/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/plugins/perl/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -23,19 +23,17 @@
 
 CC = gcc.exe
 
-VERSION := $(shell cat $(GAIM_TOP)/VERSION)
-
 # Compiler Options
 
-CFLAGS = -O2 -Werror -mno-cygwin -fnative-struct
+CFLAGS =
 
-DEFINES =	-DVERSION=\"$(VERSION)\"
-
+DEFINES =
 
 ##
 ## INCLUDE  MAKEFILES
 ##
 
+include $(GAIM_TOP)/src/win32/global.mak
 
 ##
 ## INCLUDE PATHS
@@ -119,22 +117,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base $(TARGET).def
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 
 ##
@@ -144,4 +128,3 @@
 clean:
 	rm -rf *.o
 	rm -rf $(TARGET).dll
-	rm -rf $(TARGET).def
--- a/plugins/ticker/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/plugins/ticker/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -71,8 +71,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 ##
 ## RULES
@@ -106,23 +112,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -131,4 +122,3 @@
 clean:
 	rm -rf *.o
 	rm -rf $(TARGET).dll
-	rm -rf $(TARGET).def
--- a/plugins/win32/transparency/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/plugins/win32/transparency/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -19,22 +19,17 @@
 
 TARGET = win2ktrans
 
-CC = gcc.exe
-
-VERSION := $(shell cat $(GAIM_TOP)/VERSION)
-
 # Compiler Options
 
-CFLAGS = -O2 -Wall -Werror -mno-cygwin -fnative-struct
+CFLAGS =
 
-DEFINES =	-DVERSION=\"$(VERSION)\" \
-		-DGTK_ENABLE_BROKEN
-
+DEFINES =
 
 ##
 ## INCLUDE  MAKEFILES
 ##
 
+include $(GAIM_TOP)/src/win32/global.mak
 
 ##
 ## INCLUDE PATHS
@@ -113,23 +108,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -138,4 +118,3 @@
 clean:
 	rm -rf *.o
 	rm -rf $(TARGET).dll
-	rm -rf $(TARGET).def
--- a/plugins/win32/winprefs/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/plugins/win32/winprefs/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -19,22 +19,17 @@
 
 TARGET = winprefs
 
-CC = gcc.exe
-
-VERSION := $(shell cat $(GAIM_TOP)/VERSION)
-
 # Compiler Options
 
-CFLAGS = -O2 -Wall -Werror -mno-cygwin -fnative-struct
+CFLAGS =
 
-DEFINES =	-DVERSION=\"$(VERSION)\" \
-		-DGTK_ENABLE_BROKEN
-
+DEFINES =
 
 ##
 ## INCLUDE  MAKEFILES
 ##
 
+include $(GAIM_TOP)/src/win32/global.mak
 
 ##
 ## INCLUDE PATHS
@@ -113,23 +108,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	gcc -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -138,4 +118,3 @@
 clean:
 	rm -rf *.o
 	rm -rf $(TARGET).dll
-	rm -rf $(TARGET).def
--- a/src/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -26,7 +26,7 @@
 
 # Compiler and Linker Options
 
-CFLAGS = -g
+CFLAGS =
 
 DEFINES =
 
@@ -153,7 +153,8 @@
 			-lidletrack
 			
 
-EXE_LIBS = -lgaim -lglib-2.0
+EXE_LIBS =		-lgaim \
+			-lglib-2.0
 
 ##
 ## RULES
@@ -185,30 +186,14 @@
 # BUILD DLL
 #
 
-$(TARGET).def: $(DLL_OBJECTS)
-	dlltool -D $(TARGET).dll -z $(TARGET).def --export-all-symbols \
-		--exclude-symbols WinMain@16 $^
-
-$(TARGET).base: $(DLL_OBJECTS)
-	$(CC) -mdll $(LDFLAGS) -o junk.tmp -Wl,--base-file,$@ $(DLL_OBJECTS) $(LIB_PATHS) $(DLL_LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).base $(TARGET).def
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-
-$(TARGET).dll: $(DLL_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll $(TARGET).exp
-	$(CC) -mdll $(LDFLAGS) -o $(TARGET).dll $(DLL_OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(DLL_LIBS)
-	rm -rf $(TARGET).exp $(TARGET).def $(TARGET).base
-
-$(TARGET).lib: $(TARGET).def
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
+$(TARGET).lib $(TARGET).dll: $(DLL_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll
+	$(CC) -shared $(DLL_OBJECTS) $(LIB_PATHS) $(DLL_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 #
 # BUILD EXE
 #
 
-$(TARGET).exe: $(TARGET).lib $(EXE_OBJECTS)
+$(TARGET).exe: $(TARGET).dll $(EXE_OBJECTS)
 	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(TARGET).exe
 
 ##
--- a/src/protocols/gg/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/gg/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -79,9 +79,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lintl -lgaim -lws2_32
-
-# -liberty
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lintl \
+			-lgaim \
+			-lws2_32
 
 
 ##
@@ -116,24 +121,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -143,4 +132,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/irc/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/irc/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -68,7 +68,7 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		irc.c
+C_SRC =			irc.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -78,9 +78,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 
 ##
@@ -115,24 +120,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -142,4 +131,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/jabber/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/jabber/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -69,29 +69,29 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		jabber.c \
-		expat.c \
-		genhash.c \
-		hashtable.c \
-		jconn.c \
-		jid.c \
-		jpacket.c \
-		jutil.c \
-		karma.c \
-		log.c \
-		pool.c \
-		pproxy.c \
-		rate.c \
-		sha.c \
-		socket.c \
-		str.c \
-		xhash.c \
-		xmlnode.c \
-		xmlparse.c \
-		xmlrole.c \
-		xmltok.c \
-		xstream.c \
-		win32/posix.uname.c
+C_SRC =			jabber.c \
+			expat.c \
+			genhash.c \
+			hashtable.c \
+			jconn.c \
+			jid.c \
+			jpacket.c \
+			jutil.c \
+			karma.c \
+			log.c \
+			pool.c \
+			pproxy.c \
+			rate.c \
+			sha.c \
+			socket.c \
+			str.c \
+			xhash.c \
+			xmlnode.c \
+			xmlparse.c \
+			xmlrole.c \
+			xmltok.c \
+			xstream.c \
+			win32/posix.uname.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -101,10 +101,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
-
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 ##
 ## RULES
@@ -138,24 +142,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -166,4 +154,3 @@
 	rm -rf ./win32/*.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/msn/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/msn/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -91,10 +91,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
-
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 ##
 ## RULES
@@ -128,23 +132,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 
 ##
@@ -155,4 +144,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/napster/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/napster/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -68,7 +68,7 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		napster.c
+C_SRC =			napster.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -78,9 +78,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 
 ##
@@ -115,24 +120,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -142,4 +131,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/oscar/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/oscar/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -108,7 +108,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lintl -lws2_32 -liberty -lgaim
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lintl \
+			-lws2_32 \
+			-lgaim
 
 
 ##
@@ -143,22 +150,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def --export-all-symbols $(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -168,4 +161,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/toc/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/toc/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -68,7 +68,7 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		toc.c
+C_SRC =			toc.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -78,10 +78,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
-
+LIBS = 			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 ##
 ## RULES
@@ -115,23 +119,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 
 ##
@@ -142,4 +131,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/trepia/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/trepia/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -68,8 +68,8 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		trepia.c \
-		profile.c
+C_SRC =			trepia.c \
+			profile.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -79,9 +79,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 
 ##
@@ -116,24 +121,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
-
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
@@ -143,4 +132,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/protocols/yahoo/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/protocols/yahoo/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -68,8 +68,8 @@
 ##  SOURCES, OBJECTS
 ##
 
-C_SRC =		yahoo.c \
-		crypt.c
+C_SRC =			yahoo.c \
+			crypt.c
 
 
 OBJECTS = $(C_SRC:%.c=%.o)
@@ -79,9 +79,14 @@
 ## LIBRARIES
 ##
 
-LIBS = -lgtk-win32-2.0 -lglib-2.0 -lgdk-win32-2.0 -lgmodule-2.0 -lgobject-2.0 -lws2_32 -lintl -lgaim
-
-# -liberty
+LIBS =			-lgtk-win32-2.0 \
+			-lglib-2.0 \
+			-lgdk-win32-2.0 \
+			-lgmodule-2.0 \
+			-lgobject-2.0 \
+			-lws2_32 \
+			-lintl \
+			-lgaim
 
 
 ##
@@ -116,23 +121,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def \
-		$(OBJECTS)
-
-$(TARGET).base: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp $(GAIM_TOP)/src/gaim.lib
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 
 ##
@@ -143,4 +133,3 @@
 	rm -rf *.o
 	rm -rf $(TARGET).dll
 	rm -rf $(TARGET).lib
-	rm -rf $(TARGET).def
--- a/src/win32/IdleTracker/Makefile.mingw	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/win32/IdleTracker/Makefile.mingw	Sat Jun 21 01:03:23 2003 +0000
@@ -76,22 +76,8 @@
 ## BUILD DLL
 ##
 
-$(TARGET).def: $(OBJECTS)
-	dlltool --dllname $(TARGET).dll -z $(TARGET).def $(OBJECTS)
-
-$(TARGET).base: $(OBJECTS)
-	$(CC) -mdll -o junk.tmp -Wl,--base-file,$@ $(OBJECTS) $(LIB_PATHS) $(LIBS)
-	rm -rf junk.tmp
-
-$(TARGET).exp: $(TARGET).def $(TARGET).base
-	dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \
-		--output-exp $(TARGET).exp --def $(TARGET).def
-	rm -rf $(TARGET).base
-
-$(TARGET).dll: $(OBJECTS) $(TARGET).exp
-	$(CC) -mdll -o $(TARGET).dll $(OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(LIBS)
-	dlltool -D $(TARGET).dll -d $(TARGET).def -l $(TARGET).lib
-	rm -rf $(TARGET).exp
+$(TARGET).dll: $(OBJECTS)
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
--- a/src/win32/global.mak	Sat Jun 21 01:01:12 2003 +0000
+++ b/src/win32/global.mak	Sat Jun 21 01:03:23 2003 +0000
@@ -7,9 +7,16 @@
 
 CC = gcc.exe
 
-# Don't use -g flag when building Plugin DLLs
+# Use -g flag when building debug version of Gaim (including plugins)
 CFLAGS += -O2 -Wall -mno-cygwin -fnative-struct
 
+# If not specified, dlls are built with the default base address of 0x10000000.
+# When loaded into a process address space a dll will be rebased if its base
+# address colides with the base address of an existing dll.  To avoid rebasing 
+# we do the following.  Rebasing can slow down the load time of dlls and it
+# also renders debug info useless.
+DLL_LD_FLAGS += -Wl,--enable-auto-image-base
+
 VERSION := $(shell cat $(GAIM_TOP)/VERSION)
 
 DEFINES += 	-DVERSION=\"$(VERSION)\" \