diff -u ivtools-1.2.6/debian/changelog ivtools-1.2.6/debian/changelog
--- ivtools-1.2.6/debian/changelog
+++ ivtools-1.2.6/debian/changelog
@@ -1,3 +1,20 @@
+ivtools (1.2.6-1+nmu3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/rules:
+    - Reverting 1.2.6-1+nmu2 -j1 addition to keep package clean.
+    - Fix ARCH evaluation.
+    - Use generic $(MAKE) instead of make.
+    - Make sure imake is always called with -U$(ARCH) (Closes: #549407).
+  * 01_configure.diff: Handle disabling of early binary stripping.
+  * 015_Makefile_dontstrip.diff: Disable patch.
+  * 49_string.c_constchar.diff: New patch to deal with gcc 4.4 'invalid
+    conversion from 'const char*' to 'char*'' errors (Closes: #560203).
+  * 48_gcc40_int_pointer_errors.diff: Modified to use (unsigned intptr_t)
+    instead of (uintptr_t) to avoid out-of-context errors.
+
+ -- Agustin Martin Domingo <agmartin@debian.org>  Wed, 09 Dec 2009 18:13:03 +0100
+
 ivtools (1.2.6-1+nmu2) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u ivtools-1.2.6/debian/rules ivtools-1.2.6/debian/rules
--- ivtools-1.2.6/debian/rules
+++ ivtools-1.2.6/debian/rules
@@ -16,7 +16,7 @@
 # so for alpha we just don't have ace, who uses it
 # anyhow ?
 
-ARCH = $(dpkg --print-architecture)
+ARCH = $(shell dpkg --print-architecture)
 
 ifeq "$(ARCH)" "alpha"
 ACE =
@@ -24,6 +24,9 @@
 # ACE = --with-ace=/usr/include --with-ace-libs=/usr/lib
 endif
 
+# Make sure this symbol is disabled when imake is invoked. See #549407.
+MAKE += SPECIAL_IMAKEFLAGS="-U$(ARCH)"
+
 build: build-stamp
 build-stamp:
 	dh_testdir
@@ -41,9 +44,9 @@
 
 	#  Compile the packages
 
-	make Makefile ARCH=LINUX
-	make Makefiles ARCH=LINUX
-	make -j1 ARCH=LINUX
+	$(MAKE) Makefile ARCH=LINUX
+	$(MAKE) Makefiles ARCH=LINUX
+	$(MAKE) ARCH=LINUX
 
 	#   BUILD FINISHED
 	# -----------------------------------------------------------
@@ -59,8 +62,8 @@
 		    --mandir=$(CURDIR)/debian/tmp/usr/share/man
 
 	cd src/scripts && \
-	  make ARCH=LINUX clean && \
-	  make ARCH=LINUX CONFIGDIRSPEC='-T template -I/usr/lib/ivtools/config -DCURDIR=\$(CURDIR)'\
+	  $(MAKE) ARCH=LINUX clean && \
+	  $(MAKE) ARCH=LINUX CONFIGDIRSPEC='-T template -I/usr/lib/ivtools/config -DCURDIR=\$(CURDIR)'\
  MAKEMAKESPEC='ARCH=LINUX'
 	touch build-stamp
 
@@ -83,8 +86,8 @@
 	-rm config.cache
 
 	-rm -rf static shared
-	[ ! -f Makefile ] || make ARCH=LINUX clean
-	[ ! -f src/scripts/Makefile ] || (cd src/scripts;make clean)
+	[ ! -f Makefile ] || $(MAKE) ARCH=LINUX clean
+	[ ! -f src/scripts/Makefile ] || (cd src/scripts;$(MAKE) clean)
 
 #      remove backups
 	-rm -f `find . -name "*~"`
@@ -102,10 +105,10 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/tmp.
-	make install ARCH=LINUX DESTDIR=$(CURDIR)/debian/tmp
+	$(MAKE) install ARCH=LINUX DESTDIR=$(CURDIR)/debian/tmp
 
 	cp debian/template $(CURDIR)/debian/tmp/usr/lib/ivtools/config/
-	[ ! -f src/glyphs/Makefile ] || (cd src/glyphs && make clean)
+	[ ! -f src/glyphs/Makefile ] || (cd src/glyphs && $(MAKE) clean)
 	# don't include the scripts
 
 #       ivtools installs the libACE link, we remove it ... hack
diff -u ivtools-1.2.6/debian/patches/series ivtools-1.2.6/debian/patches/series
--- ivtools-1.2.6/debian/patches/series
+++ ivtools-1.2.6/debian/patches/series
@@ -1,5 +1,4 @@
 01_configure.diff
-015_Makefile_dontstrip.diff
 02_rules_def.diff
 025_params_def.diff
 026_geomobjs_c.diff
@@ -42,0 +42 @@
+49_string.c_constchar.diff
diff -u ivtools-1.2.6/debian/patches/01_configure.diff ivtools-1.2.6/debian/patches/01_configure.diff
--- ivtools-1.2.6/debian/patches/01_configure.diff
+++ ivtools-1.2.6/debian/patches/01_configure.diff
@@ -1,8 +1,15 @@
-Index: ivtools-1.2/configure
+This patch modfies the configure scripts for different purposes:
+
+* Modify how config/config.mk is built:
+  - Make 'make CPU' more silent.
+  - Do not strip binaries during the build process. Will be done later
+    from debian/rules.
+
+Index: ivtools-1.2.6/configure
 ===================================================================
---- ivtools-1.2.orig/configure	2009-09-04 12:19:47.000000000 -0400
-+++ ivtools-1.2/configure	2009-09-04 12:20:02.000000000 -0400
-@@ -5129,8 +5129,8 @@
+--- ivtools-1.2.6.orig/configure	2009-11-30 12:08:21.000000000 +0100
++++ ivtools-1.2.6/configure	2009-11-30 12:08:54.000000000 +0100
+@@ -5129,8 +5129,10 @@
  echo XCONFIGDIR = $x_libraries/X11/config >config/config.mk
  echo writing \"ABSTOP = `pwd`\"
  echo ABSTOP = `pwd` >>config/config.mk
@@ -10,14 +17,16 @@
 -echo CPU = `make CPU` >>config/config.mk
 +echo writing \"CPU = `make -s CPU`\"
 +echo CPU = `make -s CPU` >>config/config.mk
++echo Disable INSTPGMFLAGS. Do not strip binaries now, but from debian/rules
++echo INSTPGMFLAGS = >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
  echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
-Index: ivtools-1.2/configure.in
+Index: ivtools-1.2.6/configure.in
 ===================================================================
---- ivtools-1.2.orig/configure.in	2009-09-04 12:20:10.000000000 -0400
-+++ ivtools-1.2/configure.in	2009-09-04 12:20:26.000000000 -0400
-@@ -472,8 +472,8 @@
+--- ivtools-1.2.6.orig/configure.in	2009-11-30 12:08:21.000000000 +0100
++++ ivtools-1.2.6/configure.in	2009-11-30 12:09:08.000000000 +0100
+@@ -472,8 +472,10 @@
  echo XCONFIGDIR = $x_libraries/X11/config >config/config.mk
  echo writing \"ABSTOP = `pwd`\"
  echo ABSTOP = `pwd` >>config/config.mk
@@ -25,6 +34,8 @@
 -echo CPU = `make CPU` >>config/config.mk
 +echo writing \"CPU = `make -s CPU`\"
 +echo CPU = `make -s CPU` >>config/config.mk
++echo Disable INSTPGMFLAGS. Do not strip binaries now, but from debian/rules
++echo INSTPGMFLAGS = >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
  echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
  echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
diff -u ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
--- ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
+++ ivtools-1.2.6/debian/patches/015_Makefile_dontstrip.diff
@@ -1,3 +1,10 @@
+This patch is currently disabled. Not stripping binaries until 
+debian/rules is now handled through 01_configure.diff 
+
+Since imake+xmkmf rebuilds Makefiles everytime, this is much better,
+because otherwise Makefile is changed back by imake+xmkmf during build
+and this patch can no longer be reverted.
+
 Index: ivtools-1.2/Makefile
 ===================================================================
 --- ivtools-1.2.orig/Makefile	2009-09-05 22:06:50.000000000 -0400
diff -u ivtools-1.2.6/debian/patches/48_gcc40_int_pointer_errors.diff ivtools-1.2.6/debian/patches/48_gcc40_int_pointer_errors.diff
--- ivtools-1.2.6/debian/patches/48_gcc40_int_pointer_errors.diff
+++ ivtools-1.2.6/debian/patches/48_gcc40_int_pointer_errors.diff
@@ -1,3 +1,5 @@
+Pointer length is different in 32 and 64 bit arches.
+
 Index: ivtools-1.2.6/src/Attribute/attrvalue.c
 ===================================================================
 --- ivtools-1.2.6.orig/src/Attribute/attrvalue.c	2008-02-12 19:38:19.000000000 +0100
@@ -16,7 +18,7 @@
  	return (unsigned int) int_val();
      case AttributeValue::ObjectType:
 -        return (unsigned int)obj_val();
-+        return (uintptr_t) obj_val();
++        return (unsigned intptr_t) obj_val();
      default:
  	return 0;
      }
only in patch2:
unchanged:
--- ivtools-1.2.6.orig/debian/patches/49_string.c_constchar.diff
+++ ivtools-1.2.6/debian/patches/49_string.c_constchar.diff
@@ -0,0 +1,25 @@
+Fix gcc 4.4 'invalid conversion from 'const char*' to 'char*'' errors. 
+This is partially fixed in upstream 1.2.8
+
+Index: ivtools-1.2.6/src/OS/string.c
+===================================================================
+--- ivtools-1.2.6.orig/src/OS/string.c	2009-12-09 17:51:41.000000000 +0100
++++ ivtools-1.2.6/src/OS/string.c	2009-12-09 17:52:30.000000000 +0100
+@@ -301,7 +301,7 @@
+  */
+ 
+ String String::before(const char* str) const {
+-  char* ptr = strstr(string(), str);
++  const char* ptr = strstr(string(), str);
+   if (ptr) 
+     return substr(0, ptr-string());
+   else
+@@ -313,7 +313,7 @@
+  */
+ 
+ String String::from(const char* str) const {
+-  char* ptr = strstr(string(), str);
++  const char* ptr = strstr(string(), str);
+   if (ptr) {
+     int offset = (int)(ptr-string());
+     return substr(offset,length()-offset);
