changeset 14447:e88aae4f4c40

[gaim-migrate @ 17161] Make the Perl GTK+ stuff work in wingaim. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 04 Sep 2006 23:00:13 +0000
parents 1bee09450652
children 8783ae8f649a
files gtk/Makefile.mingw gtk/plugins/Makefile.mingw gtk/plugins/perl/Makefile.mingw gtk/plugins/perl/common/Gtk.xs gtk/plugins/perl/common/GtkBlist.xs gtk/plugins/perl/common/GtkConv.xs gtk/plugins/perl/common/Makefile.mingw libgaim/plugins/perl/Makefile.mingw libgaim/plugins/perl/common/Makefile.mingw libgaim/plugins/perl/scripts/request.pl libgaim/win32/global.mak libgaim/win32/rules.mak libgaim/win32/targets.mak
diffstat 13 files changed, 167 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/Makefile.mingw	Mon Sep 04 21:58:49 2006 +0000
+++ b/gtk/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -113,11 +113,11 @@
 		-lws2_32 \
 		-lwinmm \
 		-lz \
-		-liberty \
-		-lidletrack
+		-liberty
 
 GTKGAIM_LIBS =	\
 		$(LIBGAIM_LIBS) \
+		-lidletrack \
 		-lgtk-win32-2.0 \
 		-latk-1.0 \
 		-lpango-1.0 \
@@ -145,7 +145,7 @@
 $(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H)
 
 $(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(GTKGAIM_OBJECTS)
-	$(CC) -shared $(LIBGAIM_OBJECTS) $(GTKGAIM_OBJECTS) $(LIB_PATHS) $(GTKGAIM_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(GTKGAIM_TARGET).dll.a -o $(GTKGAIM_TARGET).dll
+	$(CC) -shared $(GTKGAIM_OBJECTS) $(LIB_PATHS) $(GTKGAIM_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(GTKGAIM_TARGET).dll.a -o $(GTKGAIM_TARGET).dll
 
 $(EXE_TARGET).exe: $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS)
 	$(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET).exe
--- a/gtk/plugins/Makefile.mingw	Mon Sep 04 21:58:49 2006 +0000
+++ b/gtk/plugins/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -7,10 +7,11 @@
 GAIM_TOP := ../..
 include $(GAIM_TOP)/libgaim/win32/global.mak
 
-DOCKLET_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/docklet
-TICKER_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/ticker
-TRANSPARENCY_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/transparency
-WINPREFS_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/winprefs
+DOCKLET_PLUGIN := ./docklet
+GTKPERL_PLUGIN := ./perl
+TICKER_PLUGIN := ./ticker
+TRANSPARENCY_PLUGIN := ./win32/transparency
+WINPREFS_PLUGIN := ./win32/winprefs
 
 .SUFFIXES:
 .SUFFIXES: .c .dll
@@ -58,16 +59,18 @@
 
 all: plugins
 	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
+	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE)
 
 install: $(GAIM_INSTALL_PLUGINS_DIR)
 	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
+	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
 	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
 	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
 	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install
-	cp $(GAIM_GTK_PLUGINS_TOP)/*.dll $(GAIM_INSTALL_PLUGINS_DIR)
+	cp *.dll $(GAIM_INSTALL_PLUGINS_DIR)
 
 .c.dll:
 	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $<
@@ -88,9 +91,10 @@
 ## CLEAN RULES
 ##
 clean:
-	rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.o
-	rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.dll
+	rm -f *.o
+	rm -f *.dll
 	$(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
+	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
 	$(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
 	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
 	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk/plugins/perl/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -0,0 +1,25 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for perl plugin loader plugin.
+#
+
+GAIM_TOP := ../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
+
+##
+## TARGET DEFINITIONS
+##
+.PHONY: all clean
+
+all:
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE)
+
+install: all $(GAIM_INSTALL_PLUGINS_DIR)
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) install
+
+##
+## CLEAN RULES
+##
+clean:
+	$(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) clean
--- a/gtk/plugins/perl/common/Gtk.xs	Mon Sep 04 21:58:49 2006 +0000
+++ b/gtk/plugins/perl/common/Gtk.xs	Mon Sep 04 23:00:13 2006 +0000
@@ -38,7 +38,9 @@
 GAIM_PERL_BOOT_PROTO(Gtk__Privacy);
 GAIM_PERL_BOOT_PROTO(Gtk__Roomlist);
 GAIM_PERL_BOOT_PROTO(Gtk__Status);
+#ifndef _WIN32
 GAIM_PERL_BOOT_PROTO(Gtk__Session);
+#endif
 GAIM_PERL_BOOT_PROTO(Gtk__Sound);
 GAIM_PERL_BOOT_PROTO(Gtk__StatusBox);
 GAIM_PERL_BOOT_PROTO(Gtk__Themes);
@@ -68,7 +70,9 @@
 GAIM_PERL_BOOT(Gtk__Privacy);
 GAIM_PERL_BOOT(Gtk__Roomlist);
 GAIM_PERL_BOOT(Gtk__Status);
+#ifndef _WIN32
 GAIM_PERL_BOOT(Gtk__Session);
+#endif
 GAIM_PERL_BOOT(Gtk__Sound);
 GAIM_PERL_BOOT(Gtk__StatusBox);
 GAIM_PERL_BOOT(Gtk__Themes);
--- a/gtk/plugins/perl/common/GtkBlist.xs	Mon Sep 04 21:58:49 2006 +0000
+++ b/gtk/plugins/perl/common/GtkBlist.xs	Mon Sep 04 23:00:13 2006 +0000
@@ -51,9 +51,12 @@
 gaim_gtk_blist_refresh(list)
 	Gaim::BuddyList list
 
+#if 0
 void
 gaim_gtk_blist_update_toolbar()
 
+#endif
+
 void
 gaim_gtk_blist_update_columns()
 
--- a/gtk/plugins/perl/common/GtkConv.xs	Mon Sep 04 21:58:49 2006 +0000
+++ b/gtk/plugins/perl/common/GtkConv.xs	Mon Sep 04 23:00:13 2006 +0000
@@ -50,9 +50,12 @@
 gaim_gtkconv_switch_active_conversation(conv)
 	Gaim::Conversation conv
 
+#if 0
 void
 gaim_gtkconv_update_tabs()
 
+#endif
+
 void
 gaim_gtkconv_update_buttons_by_protocol(conv)
 	Gaim::Conversation conv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk/plugins/perl/common/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -0,0 +1,108 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for Gaim perl module.
+#
+
+GAIM_TOP := ../../../..
+include $(GAIM_TOP)/libgaim/win32/global.mak
+
+TARGET = Gtk
+EXTUTILS := C:/perl/lib/ExtUtils
+
+CFLAGS += -Wno-comment
+
+##
+## INCLUDE PATHS
+##
+INCLUDE_PATHS =		-I. \
+			-I$(GAIM_TOP) \
+			-I$(GAIM_LIB_TOP) \
+			-I$(GAIM_GTK_TOP) \
+			-I$(GTK_TOP)/include \
+			-I$(GTK_TOP)/include/atk-1.0 \
+			-I$(GTK_TOP)/include/glib-2.0 \
+			-I$(GTK_TOP)/include/gtk-2.0 \
+			-I$(GTK_TOP)/include/pango-1.0 \
+			-I$(GTK_TOP)/lib/glib-2.0/include \
+			-I$(GTK_TOP)/lib/gtk-2.0/include \
+			-I$(PERL_LIB_TOP)/CORE
+
+LIB_PATHS = 		-L$(PERL_LIB_TOP) \
+			-L$(GAIM_LIB_TOP) \
+			-L$(GAIM_GTK_TOP) \
+			-L$(GAIM_LIB_PERL_TOP) \
+			-L$(GTK_TOP)/lib
+
+##
+##  SOURCES, OBJECTS
+##
+XS_FILES = \
+	Gtk.xs \
+	GtkAccount.xs \
+	GtkBlist.xs \
+	GtkConn.xs \
+	GtkConv.xs \
+	GtkConvWin.xs \
+	GtkDebug.xs \
+	GtkDialogs.xs \
+	GtkFt.xs \
+	GtkIMHtml.xs \
+	GtkIMHtmlToolbar.xs \
+	GtkLog.xs \
+	GtkMenuTray.xs \
+	GtkPlugin.xs \
+	GtkPluginPref.xs \
+	GtkPounce.xs \
+	GtkPrefs.xs \
+	GtkPrivacy.xs \
+	GtkRoomlist.xs \
+	GtkSavedStatuses.xs \
+	GtkSound.xs \
+	GtkStatusBox.xs \
+	GtkThemes.xs \
+	GtkUtils.xs
+
+
+C_FILES = $(XS_FILES:%.xs=%.c)
+OBJECTS = $(C_FILES:%.c=%.o)
+
+##
+## LIBRARIES
+##
+LIBS =			-lperl58 \
+			-lperl \
+			-lgaim \
+			-lgtkgaim \
+			-lglib-2.0
+
+include $(GAIM_COMMON_RULES)
+
+##
+## TARGETS
+##
+.PHONY: all clean
+
+all: $(TARGET).dll
+
+$(GAIM_INSTALL_PERLMOD_DIR)/Gaim.pm:
+	$(MAKE) -C $(GAIM_LIB_PERL_TOP)/common -f $(GAIM_WIN32_MAKEFILE) install
+
+install: all $(GAIM_INSTALL_PERLMOD_DIR)/Gaim.pm
+	rm -f $(GAIM_INSTALL_PERLMOD_DIR)/Gaim/$(TARGET).dll $(GAIM_INSTALL_PERLMOD_DIR)/Gaim/$(TARGET).pm
+	mkdir -p $(GAIM_INSTALL_PERLMOD_DIR)/Gaim
+	cp $(TARGET).pm $(GAIM_INSTALL_PERLMOD_DIR)/Gaim/
+	cp $(TARGET).dll $(GAIM_INSTALL_PERLMOD_DIR)/Gaim/
+
+$(C_FILES): $(GAIM_CONFIG_H)
+
+$(TARGET).dll: $(GAIM_GTKGAIM_DLL).a $(GAIM_LIBGAIM_PERL_DLL).a $(OBJECTS)
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll
+
+##
+## CLEAN
+##
+clean:
+	rm -f *.o $(TARGET).dll
+
+include $(GAIM_COMMON_TARGETS)
--- a/libgaim/plugins/perl/Makefile.mingw	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/plugins/perl/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -68,8 +68,8 @@
 ##
 ## BUILD DLL
 ##
-$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
-	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS)  -Wl,--export-all-symbols -o $(TARGET).dll
+$(TARGET).dll $(TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(OBJECTS)
+	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS)  -Wl,--export-all-symbols -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
 
 ##
 ## CLEAN RULES
--- a/libgaim/plugins/perl/common/Makefile.mingw	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/plugins/perl/common/Makefile.mingw	Mon Sep 04 23:00:13 2006 +0000
@@ -98,12 +98,12 @@
 
 $(C_FILES): $(GAIM_CONFIG_H)
 
-$(AUTOSPLIT): Gaim.pm
+$(AUTOSPLIT):
 	mkdir -p ./lib/auto
 	cp Gaim.pm ./lib
 	$(PERL) -MAutoSplit -e 'autosplit("lib/Gaim.pm")'
 
-$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(FALLBACKS) $(OBJECTS)
+$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_LIBGAIM_PERL_DLL).a $(FALLBACKS) $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll
 
 ##
--- a/libgaim/plugins/perl/scripts/request.pl	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/plugins/perl/scripts/request.pl	Mon Sep 04 23:00:13 2006 +0000
@@ -17,17 +17,6 @@
 	plugin_action_sub => "plugin_action_names"
 );
 
-
-	# These names must already exist
-	my $GROUP		= "UIUC Buddies";
-	my $USERNAME 		= "johnhkelm2";
-
-	# We will create these on load then destroy them on unload
-	my $TEST_GROUP		= "perlTestGroup";
-	my $TEST_NAME	 	= "perlTestName";
-	my $TEST_ALIAS	 	= "perlTestAlias";
-	my $PROTOCOL_ID 	= "prpl-oscar";
-
 %plugin_actions = (
 	"Plugin Action Test Label" => \&plugin_action_test,
 );
--- a/libgaim/win32/global.mak	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/win32/global.mak	Mon Sep 04 23:00:13 2006 +0000
@@ -31,6 +31,7 @@
 # Important (enough) locations in our source code
 GAIM_LIB_TOP := $(GAIM_TOP)/libgaim
 GAIM_LIB_PLUGINS_TOP := $(GAIM_LIB_TOP)/plugins
+GAIM_LIB_PERL_TOP := $(GAIM_LIB_PLUGINS_TOP)/perl
 GAIM_GTK_TOP := $(GAIM_TOP)/gtk
 GAIM_GTK_IDLETRACK_TOP := $(GAIM_GTK_TOP)/win32/IdleTracker
 GAIM_GTK_PIXMAPS_TOP := $(GAIM_GTK_TOP)/pixmaps
@@ -43,6 +44,7 @@
 GAIM_CONFIG_H := $(GAIM_TOP)/config.h
 GAIM_IDLETRACK_DLL := $(GAIM_GTK_IDLETRACK_TOP)/idletrack.dll
 GAIM_LIBGAIM_DLL := $(GAIM_LIB_TOP)/libgaim.dll
+GAIM_LIBGAIM_PERL_DLL := $(GAIM_LIB_PERL_TOP)/perl.dll
 GAIM_GTKGAIM_DLL := $(GAIM_GTK_TOP)/gtkgaim.dll
 GAIM_EXE := $(GAIM_GTK_TOP)/gaim.exe
 GAIM_PORTABLE_EXE := $(GAIM_GTK_TOP)/gaim-portable.exe
--- a/libgaim/win32/rules.mak	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/win32/rules.mak	Mon Sep 04 23:00:13 2006 +0000
@@ -4,7 +4,7 @@
 	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $<
 
 %.c: %.xs
-	$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap typemap $< > $@
+	$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap $(GAIM_LIB_PERL_TOP)/common/typemap $< > $@
 
 %.o: %.rc
 	$(WINDRES) -i $< -o $@
--- a/libgaim/win32/targets.mak	Mon Sep 04 21:58:49 2006 +0000
+++ b/libgaim/win32/targets.mak	Mon Sep 04 23:00:13 2006 +0000
@@ -11,6 +11,9 @@
 $(GAIM_LIBGAIM_DLL) $(GAIM_LIBGAIM_DLL).a:
 	$(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) libgaim.dll
 
+$(GAIM_LIBGAIM_PERL_DLL) $(GAIM_LIBGAIM_PERL_DLL).a:
+	$(MAKE) -C $(GAIM_LIB_PERL_TOP) -f $(GAIM_WIN32_MAKEFILE) perl.dll
+
 $(GAIM_GTKGAIM_DLL) $(GAIM_GTKGAIM_DLL).a:
 	$(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) gtkgaim.dll