changeset 16594:56c61eb40850

Fix version.h generation on mingw build.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 28 Apr 2007 22:18:47 +0000
parents 1ba0560cbff9
children c992cdb19fa9
files .mtn-ignore libpurple/Makefile.mingw libpurple/win32/global.mak libpurple/win32/targets.mak
diffstat 4 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/.mtn-ignore	Sat Apr 28 21:41:52 2007 +0000
+++ b/.mtn-ignore	Sat Apr 28 22:18:47 2007 +0000
@@ -50,6 +50,7 @@
 libpurple/purple-client-bindings.h
 libpurple/purple-client-example
 libpurple/tests/check_libpurple
+libpurple/version.h
 libpurple/win32/libpurplerc.rc$
 libtool
 local.mak
--- a/libpurple/Makefile.mingw	Sat Apr 28 21:41:52 2007 +0000
+++ b/libpurple/Makefile.mingw	Sat Apr 28 22:18:47 2007 +0000
@@ -117,7 +117,7 @@
 	sed -e 's/@PURPLE_VERSION@/$(PURPLE_VERSION)/g' \
 	    $@.in > $@
 
-$(OBJECTS): $(PURPLE_CONFIG_H)
+$(OBJECTS): $(PURPLE_CONFIG_H) $(PURPLE_VERSION_H)
 
 $(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
--- a/libpurple/win32/global.mak	Sat Apr 28 21:41:52 2007 +0000
+++ b/libpurple/win32/global.mak	Sat Apr 28 22:18:47 2007 +0000
@@ -48,6 +48,7 @@
 PIDGIN_CONFIG_H := $(PIDGIN_TREE_TOP)/config.h
 PURPLE_CONFIG_H := $(PIDGIN_TREE_TOP)/config.h
 PIDGIN_IDLETRACK_DLL := $(PIDGIN_IDLETRACK_TOP)/idletrack.dll
+PURPLE_VERSION_H := $(PURPLE_TOP)/version.h
 PURPLE_DLL := $(PURPLE_TOP)/libpurple.dll
 PURPLE_PERL_DLL := $(PURPLE_PERL_TOP)/perl.dll
 PIDGIN_DLL := $(PIDGIN_TOP)/pidgin.dll
--- a/libpurple/win32/targets.mak	Sat Apr 28 21:41:52 2007 +0000
+++ b/libpurple/win32/targets.mak	Sat Apr 28 22:18:47 2007 +0000
@@ -8,7 +8,17 @@
 $(PIDGIN_CONFIG_H): $(PIDGIN_TREE_TOP)/config.h.mingw
 	cp $(PIDGIN_TREE_TOP)/config.h.mingw $(PIDGIN_CONFIG_H)
 
-$(PURPLE_DLL) $(PURPLE_DLL).a:
+$(PURPLE_VERSION_H): $(PURPLE_VERSION_H).in
+	cp $(PURPLE_VERSION_H).in $(PURPLE_VERSION_H)
+	awk 'BEGIN {FS="[\\(\\)\\[\\]]"} \
+	  /^m4_define..purple_major_version/ {system("sed -i -e s/@PURPLE_MAJOR_VERSION@/"$$5"/ $(PURPLE_VERSION_H)");} \
+	  /^m4_define..purple_minor_version/ {system("sed -i -e s/@PURPLE_MINOR_VERSION@/"$$5"/ $(PURPLE_VERSION_H)");} \
+	  /^m4_define..purple_micro_version/ {system("sed -i -e s/@PURPLE_MICRO_VERSION@/"$$5"/ $(PURPLE_VERSION_H)"); exit}' $(PIDGIN_TREE_TOP)/configure.ac
+
+	sed -e s/@PURPLE_MAJOR_VERSION@/2/ -e s/@PURPLE_MINOR_VERSION@/0/ -e s/@PURPLE_MICRO_VERSION@/0/ $(PURPLE_TOP)/version.h.in > $(PURPLE_VERSION_H)
+
+
+$(PURPLE_DLL) $(PURPLE_DLL).a: $(PURPLE_VERSION_H)
 	$(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) libpurple.dll
 
 $(PURPLE_PERL_DLL) $(PURPLE_PERL_DLL).a: