Re: [Inkscape-devel] gcc 3.3 bug: configure -Wno-pointer-sign test uses wrong compiler
[3rd attempt to send this.]
Hello, I was curious if anyone had a chance to think about this bug or if anyone had a minute to try a quick experiment.
In configure.ac, there is a block used to check if gcc can use -Wno-pointer-sign in CFLAGS. Unfortunately, the "AC_LANG(g++)" means that g++ is used for this compile test when gcc should be used, CLFLAGS is ignored, and the test always passes. For gcc4 this doesn't matter, but this breaks gcc3 when building in src/libcroco.
If anyone with gcc 3 or 4 could try a reconfigure, that would be helpful to see if this fixes other environments with gcc <4 and also does not break gcc4. Adding "AC_LANG_PUSH(C)" and "AC_LANG_POP" around the AC_COMPILE_IFELSE in configure.ac seems to fix this problem (see patch below which is also in tracker #1702352). I've tried this patch on gcc3.3 OS 10.3.9.
After changing configure.ac, run ./autogen.sh then ./configure. For gcc<4, the final bit of configure output should not have -Wno-pointer-sign in CFLAGS.
Thanks in advance! , John
Index: configure.ac =================================================================== --- configure.ac (revision 14797) +++ configure.ac (working copy) @@ -33,16 +33,18 @@ dnl These next few lines are needed only while libcroco is in our source tree. AC_PROG_CC AM_PROG_CC_C_O +AC_MSG_NOTICE([Testing -Wno-pointer-sign]) if test "$GCC" = "yes"; then # Enable some warnings from gcc.
+ AC_LANG_PUSH(C) # -Wno-pointer-sign is probably new in gcc 4.0; certainly it isn't accepted # by gcc 2.95. ink_svd_CFLAGS="$CFLAGS" CFLAGS="-Wno-pointer-sign $CFLAGS" - AC_COMPILE_IFELSE([int dummy; -], , CFLAGS="$ink_svd_CFLAGS",) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), AC_MSG_NOTICE([ compiler supports -Wno-pointer-sign]), CFLAGS="$ink_svd_CFLAGS") CFLAGS="-Wall -Wformat-security -W -D_FORTIFY_SOURCE=2 $CFLAGS" + AC_LANG_POP fi
dnl Honor aclocal flags
Wed, 25 Apr 2007 08:22:12 -0700 "John Faith" <jfaith7@...400...> kirjoitti:
[3rd attempt to send this.]
I'd guess, that three copies of this message is enough for now. ;) (yes, they're coming through)
Oops, sorry about that. Mail trouble.
Thanks for the feedback. , John
On 4/25/07, Niko Kiirala <niko@...1267...> wrote:
Wed, 25 Apr 2007 08:22:12 -0700 "John Faith" <jfaith7@...400...> kirjoitti:
[3rd attempt to send this.]
I'd guess, that three copies of this message is enough for now. ;) (yes, they're coming through)
participants (2)
-
John Faith
-
Niko Kiirala