Package: emacs23
Version: 23.2+1-7
Severity: normal
User: vor...@debian.org
Usertags: multiarch

Hi Rob,

Having begun to convert libraries over to multiarch in Ubuntu, we've found
emacs23 among the packages which fails to build.  This is because the
two-stage, autoconf+cpp generation of src/Makefile and lib-src/Makefile
results in strings like "-I/usr/lib/i386-linux-gnu/glib-2.0" being seen as
input to cpp... which has "i386" as a macro defined to "1".  So unless these
macros are undefined, the path that winds up in the Makefile is broken and
results in a build failure.

The attached patch partially addresses this by undefining any macros that
happen to exist for the <cpu> portion of the architecture triplet.  Only
architectures for which Ubuntu currently builds are handled here, however;
for Debian either a more comprehensive list or a generic fix is needed. 
It's possible that passing -fdirectives-only to cpp would solve this, but I
haven't tested.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru emacs23-23.2+1/debian/patches/no_cpp_multiarch_dir_mangling.diff emacs23-23.2+1/debian/patches/no_cpp_multiarch_dir_mangling.diff
--- emacs23-23.2+1/debian/patches/no_cpp_multiarch_dir_mangling.diff	1969-12-31 16:00:00.000000000 -0800
+++ emacs23-23.2+1/debian/patches/no_cpp_multiarch_dir_mangling.diff	2011-04-04 01:27:54.000000000 -0700
@@ -0,0 +1,36 @@
+Index: emacs23-23.2+1/lib-src/Makefile.in
+===================================================================
+--- emacs23-23.2+1.orig/lib-src/Makefile.in
++++ emacs23-23.2+1/lib-src/Makefile.in
+@@ -141,6 +141,13 @@
+ # ========================== start of cpp stuff =======================
+ /* From here on, comments must be done in C syntax.  */
+ 
++/* Make sure a built-in define doesn't break our multiarch include path! */
++#undef i386
++#undef x86_64
++#undef powerpc
++#undef powerpc64
++#undef arm
++
+ #define THIS_IS_MAKEFILE
+ #define NOT_C_CODE
+ #include "../src/config.h"
+Index: emacs23-23.2+1/src/Makefile.in
+===================================================================
+--- emacs23-23.2+1.orig/src/Makefile.in
++++ emacs23-23.2+1/src/Makefile.in
+@@ -70,6 +70,13 @@
+ # ========================== start of cpp stuff =======================
+ /* From here on, comments must be done in C syntax.  */
+ 
++/* Make sure a built-in define doesn't break our multiarch include path! */
++#undef i386
++#undef x86_64
++#undef powerpc
++#undef powerpc64
++#undef arm
++
+ C_SWITCH_SYSTEM=
+ 
+ /* just to be sure the sh is used */
diff -Nru emacs23-23.2+1/debian/patches/series emacs23-23.2+1/debian/patches/series
--- emacs23-23.2+1/debian/patches/series	2011-01-26 06:19:34.000000000 -0800
+++ emacs23-23.2+1/debian/patches/series	2011-04-04 01:25:32.000000000 -0700
@@ -19,3 +19,4 @@
 fix-fc-dual-font-width-calculation.diff
 do-not-initialize-terminal-twice.diff
 fix-epg-digest-algorithm-alist.diff
+no_cpp_multiarch_dir_mangling.diff

Reply via email to