Building Cyrus with GCC 4.0+ (Debian Etch), autoconf issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm in the process of rebuilding all our packages to target Debian Etch
rather than Debian Sarge so we can switch our infrastructure forwards
once I'm happy it's all stable.

Our Cyrus build is one of the most tricky ones, so I thought I should
compare config.h and the output of running configure under each system.

Imagine my surprise when I discovered that GCC 4.1.2 on Debian Etch didn't
support either PIC or __attribute__!

Some searcing found:

http://lkml.org/lkml/2005/6/12/61
http://lists.apple.com/archives/unix-porting/2005/Jul/msg00040.html

and many other descriptions, basically:

"This is because function prototype declarations in nested scopes are
 no longer accepted. The fix is to remove redundant declarations, or
 to move non-redundant ones to the top level."

The affected files that I can see (in my cyrus 2.3.8) are:

cmulocal/c-fpic.m4
cmulocal/c-attribute.m4

The attached patch (also available online in my patches set!) fixes this
detection issue for Etch.

Bron.
diff -ur cyrus-imapd-2.3.8.orig/cmulocal/c-attribute.m4 cyrus-imapd-2.3.8/cmulocal/c-attribute.m4
--- cyrus-imapd-2.3.8.orig/cmulocal/c-attribute.m4	2003-10-08 16:35:24.000000000 -0400
+++ cyrus-imapd-2.3.8/cmulocal/c-attribute.m4	2007-04-24 22:09:39.000000000 -0400
@@ -11,8 +11,6 @@
 AC_CACHE_VAL(ac_cv___attribute__, [
 AC_TRY_COMPILE([
 #include <stdlib.h>
-],
-[
 static void foo(void) __attribute__ ((noreturn));
 
 static void
@@ -21,6 +19,8 @@
   exit(1);
 }
 ],
+[
+],
 ac_cv___attribute__=yes,
 ac_cv___attribute__=no)])
 if test "$ac_cv___attribute__" = "yes"; then
diff -ur cyrus-imapd-2.3.8.orig/cmulocal/c-fpic.m4 cyrus-imapd-2.3.8/cmulocal/c-fpic.m4
--- cyrus-imapd-2.3.8.orig/cmulocal/c-fpic.m4	2003-10-08 16:35:24.000000000 -0400
+++ cyrus-imapd-2.3.8/cmulocal/c-fpic.m4	2007-04-24 22:09:55.000000000 -0400
@@ -13,14 +13,14 @@
 CFLAGS="${CFLAGS} -fPIC"
 AC_TRY_COMPILE([
 #include <stdlib.h>
-],
-[
 static void
 foo(void)
 {
   exit(1);
 }
 ],
+[
+],
 ac_cv_fpic=yes,
 ac_cv_fpic=no)
 CFLAGS=$save_CFLAGS
----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux