Index: icewm-1.3.7/configure
===================================================================
--- icewm-1.3.7.orig/configure	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/configure	2013-06-28 18:46:58.940864492 +0200
@@ -5958,7 +5958,7 @@
 
 
 
-  NLS_SOURCES=`grep -l '\<_\>' "src/"*.cc | sed 's%^%\$(top_srcdir)/%g'`
+  NLS_SOURCES=`grep -l '\<_\>' "${srcdir}/src/"*.cc | sed 's%^%\$(top_srcdir)/%g'`
   NLS_SOURCES=`echo ${NLS_SOURCES}`
   NLS_POFILES=`cd "${srcdir}/po"; echo *.po`
   NLS_POXFILES=`echo ${NLS_POFILES} | sed 's%\.po%.pox%g'`
@@ -7038,8 +7038,9 @@
 
       if test "${PKG_CONFIG}" != ""; then
 	GNOME_VER=2
-	GNOME2_CFLAGS=`pkg-config --cflags gnome-desktop-2.0 libgnomeui-2.0`
-	GNOME2_LIBS=`pkg-config --libs gnome-desktop-2.0 libgnomeui-2.0`
+  GNOME2_CFLAGS="`pkg-config --cflags gnome-desktop-2.0 gnome-vfs-2.0 libgnomeui-2.0 fontconfig`"
+	GNOME2_LIBS="`pkg-config --libs gnome-desktop-2.0 gnome-vfs-2.0 libgnomeui-2.0 fontconfig` -lm"
+
 
 
 $as_echo "#define CONFIG_GNOME_MENUS 1" >>confdefs.h
@@ -7073,9 +7074,9 @@
 $as_echo "#define GNOME1_HINTS 1" >>confdefs.h
 
 
-PACKAGE=`sed -ne 's/PACKAGE=//p' VERSION`
+PACKAGE=`sed -ne 's/PACKAGE=//p' ${srcdir}/VERSION`
 
-VERSION=`sed -ne 's/VERSION=//p' VERSION`
+VERSION=`sed -ne 's/VERSION=//p' ${srcdir}/VERSION`
 
 HOSTOS=`uname -sr || echo unknown`
 
@@ -7277,7 +7278,7 @@
 
 
 TARGETS_INSTALL=`for target in ${TARGETS}; do echo $ECHO_N "install-${target} $ECHO_C"; done`
-BINFILES=`for binary in ${APPLICATIONS}; do echo $ECHO_N "\\\$(top_srcdir)/src/${binary}\\\$(EXEEXT) $ECHO_C"; done`
+BINFILES=`for binary in ${APPLICATIONS}; do echo $ECHO_N "src/${binary}\\\$(EXEEXT) $ECHO_C"; done`
 
 
 
Index: icewm-1.3.7/configure.in
===================================================================
--- icewm-1.3.7.orig/configure.in	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/configure.in	2013-06-28 18:46:58.940864492 +0200
@@ -346,9 +346,9 @@
   AC_SUBST(MSGMERGE)
   AC_SUBST(MSGFMT)
 
-  NLS_SOURCES=`grep -l '\<_\>' "src/"*.cc | sed 's%^%\$(top_srcdir)/%g'`
+  NLS_SOURCES=`grep -l '\<_\>' "${srcdir}/src/"*.cc | sed 's%^%\$(top_srcdir)/%g'`
   NLS_SOURCES=`echo ${NLS_SOURCES}`
-  NLS_POFILES=`cd "${srcdir}/po"; echo *.po`
+  NLS_POFILES=`echo "${srcdir}/po/"*.po`
   NLS_POXFILES=`echo ${NLS_POFILES} | sed 's%\.po%.pox%g'`
   NLS_MOFILES=`echo ${NLS_POFILES} | sed 's%\.po%.mo%g'`
 
@@ -836,8 +836,8 @@
     
       if test "${PKG_CONFIG}" != ""; then
 	GNOME_VER=2
-	GNOME2_CFLAGS=`pkg-config --cflags gnome-desktop-2.0 libgnomeui-2.0`
-	GNOME2_LIBS=`pkg-config --libs gnome-desktop-2.0 libgnomeui-2.0`
+  GNOME2_CFLAGS=`pkg-config --cflags gnome-desktop-2.0 gnome-vfs-2.0 libgnomeui-2.0 fontconfig`
+	GNOME2_LIBS=`pkg-config --libs gnome-desktop-2.0 gnome-vfs-2.0 libgnomeui-2.0 fontconfig` -lm
 
 	AC_DEFINE(CONFIG_GNOME_MENUS, 1, [Define to make IceWM more GNOME-friendly])
 
@@ -865,8 +865,8 @@
 dnl ====================================================== Write out results ===
 dnl ---------------------------------------- First adjust some substitutions ---
 
-AC_SUBST(PACKAGE,`sed -ne 's/PACKAGE=//p' VERSION`)
-AC_SUBST(VERSION,`sed -ne 's/VERSION=//p' VERSION`)
+AC_SUBST(PACKAGE,`sed -ne 's/PACKAGE=//p' "${srcdir}/VERSION"`)
+AC_SUBST(VERSION,`sed -ne 's/VERSION=//p' "${srcdir}/VERSION"`)
 AC_SUBST(HOSTOS,`uname -sr || echo unknown`)
 AC_SUBST(HOSTCPU,`uname -m || echo unknown`)
 
@@ -932,7 +932,7 @@
 
 dnl -------------------------------------------------------- Install targets ---
 TARGETS_INSTALL=`for target in ${TARGETS}; do echo $ECHO_N "install-${target} $ECHO_C"; done`
-BINFILES=`for binary in ${APPLICATIONS}; do echo $ECHO_N "\\\$(top_srcdir)/src/${binary}\\\$(EXEEXT) $ECHO_C"; done`
+BINFILES=`for binary in ${APPLICATIONS}; do echo $ECHO_N "src/${binary}\\\$(EXEEXT) $ECHO_C"; done`
 
 AC_SUBST(TARGETS)
 AC_SUBST(TARGETS_INSTALL)
Index: icewm-1.3.7/po/Makefile.in
===================================================================
--- icewm-1.3.7.orig/po/Makefile.in	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/po/Makefile.in	2013-06-28 18:46:58.940864492 +0200
@@ -20,6 +20,7 @@
 XGETTEXT =	@XGETTEXT@
 MSGMERGE =	@MSGMERGE@
 MSGFMT =	@MSGFMT@
+VPATH = .:po:@srcdir@
 
 .SUFFIXES:
 .SUFFIXES: .po .mo
Index: icewm-1.3.7/src/WinMgr.h
===================================================================
--- icewm-1.3.7.orig/src/WinMgr.h	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/src/WinMgr.h	2013-06-28 18:46:58.940864492 +0200
@@ -128,7 +128,7 @@
  * this where WIN_WORKSPACE_COUNT comes into play.
  */
 
-#define WinWorkspaceInvalid    (-1L)
+#define WinWorkspaceInvalid    ((unsigned long)-1)
 
 /* workspaces */
 #define XA_WIN_WORKSPACES "_WIN_WORKSPACES"
Index: icewm-1.3.7/src/yfont.cc
===================================================================
--- icewm-1.3.7.orig/src/yfont.cc	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/src/yfont.cc	2013-06-28 18:46:58.940864492 +0200
@@ -12,7 +12,7 @@
 
 extern ref<YFont> getXftFont(ustring name, bool antialias);
 extern ref<YFont> getXftFontXlfd(ustring name, bool antialias);
-extern ref<YFont> getCoreFont(ustring name);
+extern ref<YFont> getCoreFont(const char*);
 
 #ifdef CONFIG_XFREETYPE
 ref<YFont> YFont::getFont(ustring name, ustring xftFont, bool antialias) {
@@ -46,7 +46,9 @@
 #endif
 
 #ifdef CONFIG_COREFONTS
-    return getCoreFont(name);
+    char tmp[4096]; // XXX: such things should go into getCoreFont directly
+    name.copy(tmp, sizeof(tmp));
+    return getCoreFont(tmp);
 #else
     return null;
 #endif
Index: icewm-1.3.7/src/yapp.cc
===================================================================
--- icewm-1.3.7.orig/src/yapp.cc	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/src/yapp.cc	2013-06-28 18:46:58.944864245 +0200
@@ -269,7 +269,7 @@
         }
 #endif
 
-        {
+        if(measure_latency) {
             struct timeval difftime;
             struct timeval curtime;
             gettimeofday(&curtime, 0);
Index: icewm-1.3.7/src/Makefile.in
===================================================================
--- icewm-1.3.7.orig/src/Makefile.in	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/src/Makefile.in	2013-06-28 18:46:58.944864245 +0200
@@ -11,7 +11,7 @@
 
 CXX =           @CXX@
 HOSTCXX =       @HOSTCXX@
-LD =            @CXX_LINK@
+LD =            gcc
 HOSTLD =        @HOSTCXX_LINK@
 EXEEXT =        @EXEEXT@
 
@@ -32,12 +32,12 @@
                 -DICEWMBGEXE='"icewmbg$(EXEEXT)"' \
                 -DICESMEXE='"icewm-session$(EXEEXT)"' \
                 -DICEHELPEXE='"icehelp$(EXEEXT)"' \
-                -DICEHELPIDX='"$(DOCDIR)/icewm-$(VERSION)/icewm.html"'
+                -DICEHELPIDX='"$(DOCDIR)/icewm-common/icewm.html"'
 
 CXXFLAGS =      @CXXFLAGS@ $(DEBUG) $(DEFS) `pkg-config gdk-pixbuf-xlib-2.0 --cflags` \
-	        @CORE_CFLAGS@ @IMAGE_CFLAGS@ @AUDIO_CFLAGS@ # `fc-config --cflags`
+	        @CORE_CFLAGS@ @IMAGE_CFLAGS@ @AUDIO_CFLAGS@ -I. # `fc-config --cflags`
 LFLAGS =	@LDFLAGS@ 
-LIBS =          @LIBS@ `pkg-config gdk-pixbuf-xlib-2.0 --libs` 
+LIBS =          @LIBS@ `pkg-config gdk-pixbuf-xlib-2.0 --libs` -lfontconfig -lm -lsupc++
 
 CORE_LIBS =     @CORE_LIBS@ # `fc-config --libs`
 IMAGE_LIBS =    @IMAGE_LIBS@
@@ -192,6 +192,8 @@
 TESTCASES = @TESTCASES@
 OBJECTS = @BASEOBJS@ @TESTOBJS@
 BINARIES = @BASEBINS@ @TESTBINS@
+BASEOBJS = @BASEOBJS@
+VPATH = .:@srcdir@
 
 ################################################################################
 
@@ -209,7 +211,8 @@
 	@echo "  CXX     " $@
 	@$(CXX) $(CXXFLAGS) $(GCCDEP) -c $<
 
-$(BINARIES):
+$(BINARIES): $(BASEOBJS)
+#	@$(MAKE) --no-print-directory build-dep DEPLIST="$($(@:$(EXEEXT)=)_OBJS)"
 	@echo "  LD      " $@
 	@$(LD) -o $@ $($(@:$(EXEEXT)=)_OBJS) $(LFLAGS) $($(@:$(EXEEXT)=)_LFLAGS) $(LIBS) $($(@:$(EXEEXT)=)_LIBS)
 
@@ -245,6 +248,8 @@
 
 genpref$(EXEEXT): $(genpref_OBJS)
 
+build-dep: $(DEPLIST)
+
 ################################################################################
 
 check:	all tests
Index: icewm-1.3.7/Makefile.in
===================================================================
--- icewm-1.3.7.orig/Makefile.in	2013-06-28 18:46:58.952863752 +0200
+++ icewm-1.3.7/Makefile.in	2013-06-28 18:46:58.944864245 +0200
@@ -4,6 +4,8 @@
 # Please run 'configure' first (generate it with autogen.sh)
 ################################################################################
 
+SHELL=/bin/bash
+
 srcdir     = @srcdir@
 top_srcdir = @top_srcdir@
 
@@ -33,7 +35,7 @@
 
 ################################################################################
 
-BINFILES    = @BINFILES@ icewm-set-gnomewm
+BINFILES    = @BINFILES@ "$(srcdir)/icewm-set-gnomewm"
 LIBFILES    = lib/preferences lib/winoptions lib/keys \
               lib/menu lib/toolbar # lib/programs
 DOCFILES    = README BUGS CHANGES COPYING AUTHORS INSTALL VERSION icewm.lsm
@@ -46,21 +48,22 @@
 install:	@TARGETS_INSTALL@
 
 base icesound icehelp:
-	@cd src; $(MAKE) $@
+	@cd src && $(MAKE) $@
 
 docs:
-	@cd doc; $(MAKE) all
+	@cd doc && $(MAKE) all
 
 nls:
-	@cd po; $(MAKE) all
+	@cd po && $(MAKE) all
 
 srcclean:
-	@cd src; $(MAKE) clean
+	@cd src && $(MAKE) clean
 
 clean:  srcclean
-	@cd doc; $(MAKE) clean
+	@cd doc && $(MAKE) clean
 
-distclean: clean
+distclean:
+	@-$(MAKE) clean
 	rm -f *~ config.cache config.log config.status install.inc \
 	sysdep.inc src/config.h \
 	lib/preferences \
@@ -68,10 +71,10 @@
 
 maintainer-clean: distclean
 	rm -f icewm.spec icewm.lsm Makefile configure src/config.h.in
-	@cd doc; $(MAKE) maintainer-clean
+	@cd doc && $(MAKE) maintainer-clean
 
 check:
-	@cd src ; $(MAKE) check >/dev/null
+	@cd src && $(MAKE) check >/dev/null
 
 dist:	distclean docs configure
 
@@ -80,21 +83,23 @@
 	@echo ------------------------------------------
 	@echo "Installing binaries in $(DESTDIR)$(BINDIR)"
 	@$(INSTALLDIR) "$(DESTDIR)$(BINDIR)"
+#generated files, relative to the build directory
 	@for bin in $(BINFILES); do \
              $(INSTALLBIN) "$${bin}" "$(DESTDIR)$(BINDIR)"; \
          done
 	
 	@echo "Installing presets and icons in $(DESTDIR)$(LIBDIR)"
 	@$(INSTALLDIR) "$(DESTDIR)$(LIBDIR)"
+# data files from the source directory
 	#-@$(INSTALLDIR) "$(DESTDIR)$(CFGDIR)"
 	@for lib in $(LIBFILES); do \
-             $(INSTALLLIB) "$${lib}" "$(DESTDIR)$(LIBDIR)"; \
+             $(INSTALLLIB) "$(top_srcdir)/$${lib}" "$(DESTDIR)$(LIBDIR)"; \
          done
 
 	@for xpmdir in $(XPMDIRS); do \
-	     if test -d "lib/$${xpmdir}"; then \
+	     if test -d "$(top_srcdir)/lib/$${xpmdir}"; then \
 		$(INSTALLDIR) "$(DESTDIR)$(LIBDIR)/$${xpmdir}"; \
-		for pixmap in "lib/$${xpmdir}/"*.xpm; do \
+		for pixmap in "$(top_srcdir)/lib/$${xpmdir}/"*.xpm; do \
 		    $(INSTALLLIB) "$${pixmap}" "$(DESTDIR)$(LIBDIR)/$${xpmdir}"; \
 		done; \
 	    fi; \
@@ -126,7 +131,7 @@
 
 install-nls: nls
 	@echo ------------------------------------------
-	@cd po; $(MAKE) install
+	@cd po && $(MAKE) install
 	@echo ------------------------------------------
 
 install-man:
