Wed, 08 Mar 2006 03:41:58 +0000
[gaim-migrate @ 15830]
This makes tcl.c a little uglier, but offers some significant benefits on win32. Firstly, we no longer call LoadLibrary() from within a DllMain function (which is fundamentally unsafe). Secondly, this prints a debugging message indicating that if gaim fails to load it is cygwin's fault. Thirdly, we now try to detect the loading of a cygwin tcl runtime and aborts loading the tcl plugin. The subsequent "hanging" is one of the most reported bugs, so this will hopefully reduce these bug reports.
| 7831 | 1 | # |
| 2 | # Makefile.mingw | |
| 3 | # | |
| 4 | # Description: Makefile for tcl plugin loader plugin. | |
| 5 | # | |
| 6 | ||
| 7 | # | |
| 8 | # PATHS | |
| 9 | # | |
| 10 | ||
| 11 | GTK_TOP := ../../../win32-dev/gtk_2_0 | |
| 12 | GAIM_TOP := ../.. | |
| 13 | TCL_LIB_DIR := ../../../win32-dev/tcl-8.4.5 | |
| 14 | TCL_INC_DIR := $(TCL_LIB_DIR)/include | |
| 15 | GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir | |
| 16 | DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins | |
| 17 | ||
| 18 | ## | |
| 19 | ## VARIABLE DEFINITIONS | |
| 20 | ## | |
| 21 | ||
| 22 | TARGET = tcl | |
| 23 | ||
| 24 | # Compiler Options | |
| 25 | ||
| 26 | CFLAGS = | |
| 27 | ||
| 28 | DEFINES = -DHAVE_TK -DUSE_TCL_STUBS -DUSE_TK_STUBS | |
| 29 | ||
| 30 | ## | |
| 31 | ## INCLUDE MAKEFILES | |
| 32 | ## | |
| 33 | ||
| 34 | include $(GAIM_TOP)/src/win32/global.mak | |
| 35 | ||
| 36 | ## | |
| 37 | ## INCLUDE PATHS | |
| 38 | ## | |
| 39 | ||
| 40 | INCLUDE_PATHS += -I. \ | |
| 41 | -I$(GAIM_TOP) \ | |
| 42 | -I$(GAIM_TOP)/src \ | |
| 43 | -I$(GAIM_TOP)/src/win32 \ | |
| 44 | -I$(GTK_TOP)/include \ | |
| 45 | -I$(GTK_TOP)/include/gtk-2.0 \ | |
| 46 | -I$(GTK_TOP)/include/glib-2.0 \ | |
| 47 | -I$(GTK_TOP)/include/pango-1.0 \ | |
| 48 | -I$(GTK_TOP)/include/atk-1.0 \ | |
| 49 | -I$(GTK_TOP)/lib/glib-2.0/include \ | |
| 50 | -I$(GTK_TOP)/lib/gtk-2.0/include \ | |
| 51 | -I$(TCL_INC_DIR) | |
| 52 | ||
| 53 | ||
| 54 | LIB_PATHS = -L$(GTK_TOP)/lib \ | |
| 55 | -L$(GAIM_TOP)/src \ | |
| 56 | -L$(TCL_LIB_DIR) | |
| 57 | ||
| 58 | ||
| 59 | ## | |
| 60 | ## SOURCES, OBJECTS | |
| 61 | ## | |
| 62 | ||
| 63 | C_SRC = tcl.c \ | |
| 64 | tcl_cmds.c \ | |
| 65 | tcl_glib.c \ | |
|
13456
4949b0656a2b
[gaim-migrate @ 15830]
Daniel Atallah <datallah@pidgin.im>
parents:
7831
diff
changeset
|
66 | tcl_signals.c |
| 7831 | 67 | |
| 68 | ||
| 69 | OBJECTS = $(C_SRC:%.c=%.o) | |
| 70 | ||
| 71 | ||
| 72 | ## | |
| 73 | ## LIBRARIES | |
| 74 | ## | |
| 75 | ||
| 76 | LIBS = -lgtk-win32-2.0 \ | |
| 77 | -lglib-2.0 \ | |
| 78 | -lgdk-win32-2.0 \ | |
| 79 | -lgmodule-2.0 \ | |
| 80 | -lgobject-2.0 \ | |
| 81 | -lws2_32 \ | |
| 82 | -lintl \ | |
| 83 | -lgaim \ | |
| 84 | -ltclstub84 \ | |
| 85 | -ltkstub84 | |
| 86 | ||
| 87 | ||
| 88 | ## | |
| 89 | ## RULES | |
| 90 | ## | |
| 91 | ||
| 92 | # How to make a C file | |
| 93 | ||
| 94 | %.o: %.c | |
| 95 | $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< | |
| 96 | ||
| 97 | ## | |
| 98 | ## TARGET DEFINITIONS | |
| 99 | ## | |
| 100 | ||
| 101 | .PHONY: all clean | |
| 102 | ||
| 103 | all: $(TARGET).dll | |
| 104 | ||
| 105 | install: $(TARGET).dll | |
| 106 | cp $(TARGET).dll $(DLL_INSTALL_DIR) | |
| 107 | ||
| 108 | ## | |
| 109 | ## BUILD Dependencies | |
| 110 | ## | |
| 111 | ||
| 112 | $(GAIM_TOP)/src/gaim.lib: | |
| 113 | $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib | |
| 114 | ||
| 115 | ## | |
| 116 | ## BUILD DLL | |
| 117 | ## | |
| 118 | ||
| 119 | $(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib | |
| 120 | $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll | |
| 121 | ||
| 122 | ||
| 123 | ## | |
| 124 | ## CLEAN RULES | |
| 125 | ## | |
| 126 | ||
| 127 | clean: | |
| 128 | rm -rf *.o | |
| 129 | rm -rf $(TARGET).dll |