changeset 14467:fd45915c6988

[gaim-migrate @ 17183] The gaim executable and the gtkgaim and libgaim dlls now contain version information. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 07 Sep 2006 17:53:25 +0000
parents 5a09940b88f7
children 847e846eb07e
files gtk/Makefile.am gtk/Makefile.mingw gtk/win32/gaimrc.rc gtk/win32/gaimrc.rc.in gtk/win32/gtkgaimrc.rc.in libgaim/Makefile.am libgaim/Makefile.mingw libgaim/win32/libgaimrc.rc.in libgaim/win32/rules.mak
diffstat 9 files changed, 154 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/Makefile.am	Wed Sep 06 10:06:58 2006 +0000
+++ b/gtk/Makefile.am	Thu Sep 07 17:53:25 2006 +0000
@@ -8,7 +8,8 @@
 		win32/IdleTracker/Makefile.mingw \
 		win32/IdleTracker/idletrack.c \
 		win32/IdleTracker/idletrack.h \
-		win32/gaimrc.rc \
+		win32/gaimrc.rc.in \
+		win32/gtkgaimrc.rc.in \
 		win32/gtkwin32dep.c \
 		win32/gtkwin32dep.h \
 		win32/resource.h \
--- a/gtk/Makefile.mingw	Wed Sep 06 10:06:58 2006 +0000
+++ b/gtk/Makefile.mingw	Thu Sep 07 17:53:25 2006 +0000
@@ -12,12 +12,9 @@
 ##
 ## VARIABLE DEFINITIONS
 ##
-EXE_TARGET = gaim
-GTKGAIM_TARGET = gtkgaim
-
-ifeq ($(MAKECMDGOALS), $(EXE_TARGET)-portable.exe)
-DEFINES := $(DEFINES) -DPORTABLE
-endif
+EXE_TARGET := gaim
+GTKGAIM_TARGET := gtkgaim
+EXE_NAME := $(EXE_TARGET).exe
 
 WINAPP := -mwindows
 # The Debug version of gaim is a console app, always having a console
@@ -95,10 +92,12 @@
 			win32/untar.c \
 			win32/wspell.c
 
-RC_SRC = win32/gaimrc.rc
+GTKGAIM_RC_SRC = win32/gtkgaimrc.rc
+GTKGAIM_OBJECTS = $(GTKGAIM_C_SRC:%.c=%.o) $(GTKGAIM_RC_SRC:%.rc=%.o)
+
+EXE_RC_SRC = win32/gaimrc.rc
 EXE_C_SRC = win32/win_gaim.c
-GTKGAIM_OBJECTS = $(GTKGAIM_C_SRC:%.c=%.o)
-EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o)
+EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(EXE_RC_SRC:%.rc=%.o)
 
 ##
 ## LIBRARIES
@@ -129,7 +128,12 @@
 ##
 ## TARGET DEFINITIONS
 ##
-.PHONY: all clean
+.PHONY: all clean clean_exe
+
+./win32/gaimrc.rc: ./win32/gaimrc.rc.in $(GAIM_TOP)/VERSION
+	sed -e 's/@GAIM_VERSION@/$(GAIM_VERSION)/g' \
+	    -e 's/@ORIGINAL_FILENAME@/$(EXE_NAME)/' \
+	    $@.in > $@
 
 all: $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll
 	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE)
@@ -142,17 +146,23 @@
 	cp $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
-$(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H)
+./win32/gtkgaimrc.rc: ./win32/gtkgaimrc.rc.in $(GAIM_TOP)/VERSION
+	sed -e 's/@GAIM_VERSION@/$(GAIM_VERSION)/g' \
+	    $@.in > $@
+
+$(EXE_OBJECTS) $(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H)
 
 $(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(GTKGAIM_OBJECTS)
 	$(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
+	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET).exe
 
+$(EXE_TARGET)-portable.exe: DEFINES += -DPORTABLE
+$(EXE_TARGET)-portable.exe: EXE_NAME := $(EXE_TARGET)-portable.exe
 $(EXE_TARGET)-portable.exe: clean_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)-portable.exe
-	rm win_gaim.o
+	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET)-portable.exe
+	$(MAKE) -f $(GAIM_WIN32_MAKEFILE) clean_exe
 
 ##
 ## CLEAN RULES
@@ -160,13 +170,11 @@
 clean:
 	$(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
 	$(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
-	rm -f $(GTKGAIM_OBJECTS) $(EXE_OBJECTS)
-	rm -f $(GTKGAIM_TARGET).dll
-	rm -f $(GTKGAIM_TARGET).dll.a
-	rm -f $(EXE_TARGET).exe
-	rm -f $(EXE_TARGET)-portable.exe
+	rm -f $(GTKGAIM_OBJECTS) $(GTKGAIM_RC_SRC) $(EXE_OBJECTS) $(EXE_RC_SRC)
+	rm -f $(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a
+	rm -f $(EXE_TARGET).exe $(EXE_TARGET)-portable.exe
 
 clean_exe:
-	rm -f win_gaim.o
+	rm -f $(EXE_OBJECTS) $(EXE_RC_SRC)
 
 include $(GAIM_COMMON_TARGETS)
--- a/gtk/win32/gaimrc.rc	Wed Sep 06 10:06:58 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#include "resource.h"
-
-#define PIXMAPDIR "pixmaps/"
-
-GAIM_ICON			ICON PIXMAPDIR "gaim.ico"
-GAIM_TRAY_ICON			ICON PIXMAPDIR "gaim_16.ico"
-GAIM_OFFLINE_TRAY_ICON		ICON PIXMAPDIR "gaim_offline_16.ico"
-GAIM_AWAY_TRAY_ICON		ICON PIXMAPDIR "gaim_away_16.ico"
-GAIM_PEND_TRAY_ICON		ICON PIXMAPDIR "gaim_msgunread_16.ico"
-GAIM_AWAYPEND_TRAY_ICON 	ICON PIXMAPDIR "gaim_msgpend_16.ico"
-GAIM_BLANK_TRAY_ICON		ICON PIXMAPDIR "gaim_blank_4bit_16.ico"
-GAIM_TRAY_ICON_4BIT		ICON PIXMAPDIR "gaim_4bit_16.ico"
-GAIM_OFFLINE_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_offline_4bit_16.ico"
-GAIM_AWAY_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_away_4bit_16.ico"
-GAIM_PEND_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_msgunread_4bit_16.ico"
-GAIM_AWAYPEND_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_msgpend_4bit_16.ico"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk/win32/gaimrc.rc.in	Thu Sep 07 17:53:25 2006 +0000
@@ -0,0 +1,47 @@
+#include <winver.h>
+#include "resource.h"
+#include "version.h"
+
+#define PIXMAPDIR "pixmaps/"
+
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  PRODUCTVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  FILEFLAGSMASK 0
+  FILEFLAGS 0
+  FILEOS VOS__WINDOWS32
+  FILETYPE VFT_APP
+  FILESUBTYPE VFT2_UNKNOWN
+  BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+      BLOCK "040904B0"
+      BEGIN
+        VALUE "CompanyName", "The Gaim developer community"
+        VALUE "FileDescription", "Gaim Executable"
+        VALUE "FileVersion", "@GAIM_VERSION@"
+        VALUE "InternalName", "gaim"
+        VALUE "LegalCopyright", "Copyright (C) 1998-2006 The Gaim developer community (See the COPYRIGHT file in the source distribution)."
+        VALUE "OriginalFilename", "@ORIGINAL_FILENAME@"
+        VALUE "ProductName", "Gaim"
+        VALUE "ProductVersion", "@GAIM_VERSION@"
+      END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+      VALUE "Translation", 0x409, 1200
+    END
+  END
+
+GAIM_ICON			ICON PIXMAPDIR "gaim.ico"
+GAIM_TRAY_ICON			ICON PIXMAPDIR "gaim_16.ico"
+GAIM_OFFLINE_TRAY_ICON		ICON PIXMAPDIR "gaim_offline_16.ico"
+GAIM_AWAY_TRAY_ICON		ICON PIXMAPDIR "gaim_away_16.ico"
+GAIM_PEND_TRAY_ICON		ICON PIXMAPDIR "gaim_msgunread_16.ico"
+GAIM_AWAYPEND_TRAY_ICON 	ICON PIXMAPDIR "gaim_msgpend_16.ico"
+GAIM_BLANK_TRAY_ICON		ICON PIXMAPDIR "gaim_blank_4bit_16.ico"
+GAIM_TRAY_ICON_4BIT		ICON PIXMAPDIR "gaim_4bit_16.ico"
+GAIM_OFFLINE_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_offline_4bit_16.ico"
+GAIM_AWAY_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_away_4bit_16.ico"
+GAIM_PEND_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_msgunread_4bit_16.ico"
+GAIM_AWAYPEND_TRAY_ICON_4BIT	ICON PIXMAPDIR "gaim_msgpend_4bit_16.ico"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk/win32/gtkgaimrc.rc.in	Thu Sep 07 17:53:25 2006 +0000
@@ -0,0 +1,32 @@
+#include <winver.h>
+#include "version.h"
+
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  PRODUCTVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  FILEFLAGSMASK 0
+  FILEFLAGS 0
+  FILEOS VOS__WINDOWS32
+  FILETYPE VFT_DLL
+  FILESUBTYPE VFT2_UNKNOWN
+  BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+      BLOCK "040904B0"
+      BEGIN
+        VALUE "CompanyName", "The Gaim developer community"
+        VALUE "FileDescription", "GTK+ Gaim Library"
+        VALUE "FileVersion", "@GAIM_VERSION@"
+        VALUE "InternalName", "gtkgaim"
+        VALUE "LegalCopyright", "Copyright (C) 1998-2006 The Gaim developer community (See the COPYRIGHT file in the source distribution)."
+        VALUE "OriginalFilename", "gtkgaim.dll"
+        VALUE "ProductName", "Gaim"
+        VALUE "ProductVersion", "@GAIM_VERSION@"
+      END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+      VALUE "Translation", 0x409, 1200
+    END
+  END
+
--- a/libgaim/Makefile.am	Wed Sep 06 10:06:58 2006 +0000
+++ b/libgaim/Makefile.am	Thu Sep 07 17:53:25 2006 +0000
@@ -10,6 +10,9 @@
 		win32/libc_interface.c \
 		win32/libc_interface.h \
 		win32/libc_internal.h \
+		win32/libgaimrc.rc.in \
+		win32/rules.mak \
+		win32/targets.mak \
 		win32/wgaimerror.h \
 		win32/win32dep.c \
 		win32/win32dep.h
--- a/libgaim/Makefile.mingw	Wed Sep 06 10:06:58 2006 +0000
+++ b/libgaim/Makefile.mingw	Thu Sep 07 17:53:25 2006 +0000
@@ -76,7 +76,9 @@
 			win32/libc_interface.c \
 			win32/win32dep.c
 
-OBJECTS = $(C_SRC:%.c=%.o)
+RC_SRC = win32/libgaimrc.rc
+
+OBJECTS = $(C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o)
 
 ##
 ## LIBRARIES
@@ -108,6 +110,10 @@
 	cp $(TARGET).dll $(GAIM_INSTALL_DIR)
 	cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR)
 
+./win32/libgaimrc.rc: ./win32/libgaimrc.rc.in $(GAIM_TOP)/VERSION
+	sed -e 's/@GAIM_VERSION@/$(GAIM_VERSION)/g' \
+	    $@.in > $@
+
 $(OBJECTS): $(GAIM_CONFIG_H)
 
 $(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
@@ -117,9 +123,8 @@
 ## CLEAN RULES
 ##
 clean:
-	rm -rf $(OBJECTS)
-	rm -rf $(TARGET).dll
-	rm -rf $(TARGET).dll.a
+	rm -f $(OBJECTS) $(RC_SRC)
+	rm -f $(TARGET).dll $(TARGET).dll.a
 	$(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
 	$(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgaim/win32/libgaimrc.rc.in	Thu Sep 07 17:53:25 2006 +0000
@@ -0,0 +1,32 @@
+#include <winver.h>
+#include "version.h"
+
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  PRODUCTVERSION GAIM_MAJOR_VERSION,GAIM_MINOR_VERSION,GAIM_MICRO_VERSION,0
+  FILEFLAGSMASK 0
+  FILEFLAGS 0
+  FILEOS VOS__WINDOWS32
+  FILETYPE VFT_DLL
+  FILESUBTYPE VFT2_UNKNOWN
+  BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+      BLOCK "040904B0"
+      BEGIN
+        VALUE "CompanyName", "The Gaim developer community"
+        VALUE "FileDescription", "Libgaim Library"
+        VALUE "FileVersion", "@GAIM_VERSION@"
+        VALUE "InternalName", "libgaim"
+        VALUE "LegalCopyright", "Copyright (C) 1998-2006 The Gaim developer community (See the COPYRIGHT file in the source distribution)."
+        VALUE "OriginalFilename", "libgaim.dll"
+        VALUE "ProductName", "Gaim"
+        VALUE "ProductVersion", "@GAIM_VERSION@"
+      END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+      VALUE "Translation", 0x409, 1200
+    END
+  END
+
--- a/libgaim/win32/rules.mak	Wed Sep 06 10:06:58 2006 +0000
+++ b/libgaim/win32/rules.mak	Thu Sep 07 17:53:25 2006 +0000
@@ -7,4 +7,4 @@
 	$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap $(GAIM_LIB_PERL_TOP)/common/typemap $< > $@
 
 %.o: %.rc
-	$(WINDRES) -i $< -o $@
+	$(WINDRES) -I$(GAIM_LIB_TOP) -i $< -o $@