r5845 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Thu Feb 18 15:03:14 CET 2010


Author: werner
Date: 2010-02-18 15:03:14 +0100 (Thu, 18 Feb 2010)
New Revision: 5845

Modified:
   trunk/eda/fped/Makefile
   trunk/eda/fped/gui.c
Log:
Show fped's SVN revision in the title bar.

- Makefile: pass SVN version and commit status to CPP
- gui.c (gui_main): show SVN revision in the title bar, if available



Modified: trunk/eda/fped/Makefile
===================================================================
--- trunk/eda/fped/Makefile	2010-02-18 13:39:20 UTC (rev 5844)
+++ trunk/eda/fped/Makefile	2010-02-18 14:03:14 UTC (rev 5845)
@@ -37,13 +37,18 @@
 
 CFLAGS_WARN = -Wall -Wshadow -Wmissing-prototypes \
 	      -Wmissing-declarations -Wno-format-zero-length
-CFLAGS = -g -std=gnu99 $(CFLAGS_GTK) -DCPP='"cpp"' $(CFLAGS_WARN)
+CFLAGS = -g -std=gnu99 $(CFLAGS_GTK) -DCPP='"cpp"' \
+         -DSVN_VERSION='"$(SVN_VERSION)$(SVN_STATUS)"' $(CFLAGS_WARN)
 SLOPPY = -Wno-unused -Wno-implicit-function-declaration \
 	 -Wno-missing-prototypes -Wno-missing-declarations
 LDLIBS = -lm -lfl $(LIBS_GTK)
 YACC = bison -y
 YYFLAGS = -v
 
+SVN_VERSION=$(shell svn info | sed '/Last Changed Rev: /s///p;d')
+SVN_STATUS=$(shell [ -z "`svn status -q`" ] || echo +)
+
+
 # ----- Verbosity control -----------------------------------------------------
 
 CPP := $(CPP)   # make sure changing CC won't affect CPP

Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c	2010-02-18 13:39:20 UTC (rev 5844)
+++ trunk/eda/fped/gui.c	2010-02-18 14:03:14 UTC (rev 5845)
@@ -314,7 +314,11 @@
 	root = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 	gtk_window_set_position(GTK_WINDOW(root), GTK_WIN_POS_CENTER);
 	gtk_window_set_default_size(GTK_WINDOW(root), 620, 460);
-	gtk_window_set_title(GTK_WINDOW(root), "fped");
+	if (*SVN_VERSION)
+		gtk_window_set_title(GTK_WINDOW(root),
+		    "fped (rev " SVN_VERSION ")");
+	else
+		gtk_window_set_title(GTK_WINDOW(root), "fped");
 
 	/* get root->window */
 	gtk_widget_show_all(root);




More information about the commitlog mailing list