`./configure CFLAGS=-w` causes configure script to wrongly guess style of 
`gethostbyname_r` on OS X (and probably other BSDs)
-----------------------------------------------------------------------------------------------------------------------------

                 Key: TS-1091
                 URL: https://issues.apache.org/jira/browse/TS-1091
             Project: Traffic Server
          Issue Type: Bug
          Components: Build
    Affects Versions: 3.0.2
         Environment: OS X 10.6.8
            Reporter: Marc Abramowitz
            Priority: Minor


Arguably, people should never run configure with CFLAGS=-w and this might seem 
stupid and something that should never happen, but it turns out that Homebrew 
(http://mxcl.github.com/homebrew/) does this by default -- I discovered this 
while writing a Homebrew formula for Traffic Server 
(https://github.com/mxcl/homebrew/pull/9513). After discovering that this was 
causing problems, I modified my formula to tell Homebrew not to do this and all 
is well, but I thought it would be interesting to make Traffic Server resistant 
to this as well.

I first tried to enable warnings by trying to find a gcc #pragma that could go 
in the conftest.c code, but I could not find any #pragma that seemed to do this.

I ended up making a small change to `build/common.m4` that strips -w out of 
CFLAGS using `sed`.

{code}
--- build/common.m4.2012-01-22-092051   2011-05-25 13:19:54.000000000 -0700
+++ build/common.m4     2012-01-22 22:48:14.000000000 -0800
@@ -177,6 +177,7 @@
  if test "$ac_cv_prog_gcc" = "yes"; then
    CFLAGS="$CFLAGS -Werror"
  fi
+ CFLAGS=$(echo $CFLAGS | sed -e 's/^-w$//' -e 's/^-w //' -e 's/ -w$//' -e 's/ 
-w / /')
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
   [#include "confdefs.h"
   ]
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to