[GRASS-dev] FORTIFY_SOURCE=2 brakes congigure

Markus Neteler neteler at osgeo.org
Sun Apr 21 12:43:25 PDT 2013


On Sun, Apr 21, 2013 at 8:23 PM, Maciej Sieczka <msieczka at sieczka.org> wrote:
> Hi,
>
> Arch has recently added CPPFLAGS="-D_FORTIFY_SOURCE=2" [1] to its package
> and build management toolset config [2].
>
> This brakes ./configure for any GRASS version as follows:
>
> $ CPPFLAGS="-D_FORTIFY_SOURCE=2" ./configure | tail
> configure: error: *** Unable to locate curses includes.

... apparently you try with GRASS 6 here?
Because:

[neteler at oboe grass70]$ grep curses *
configure:#AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h
unistd.h values.h)
configure.in:#AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h
unistd.h values.h)

in GRASS 7 it is commented.

Testing it with GRASS 7 I also get the complaint about missing zlib.h.
But check config.log:

configure:4988: gcc -o conftest -g -O2  -D_FORTIFY_SOURCE=2
-Wl,--export-dynamic conftest.c  1>&5
configure:5071: checking for location of zlib includes
configure:5097: checking for zlib.h
configure:5105: /lib/cpp  -I/usr/include -D_FORTIFY_SOURCE=2
conftest.c >/dev/null 2>conftest.out
In file included from /usr/include/sys/types.h:25:0,
                 from /usr/include/zconf.h:424,
                 from /usr/include/zlib.h:34,
                 from configure:5101:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]
configure: failed program was:
#line 5100 "configure"
#include "confdefs.h"
#include <zlib.h>

Hence (guessing):
CFLAGS="-O" CPPFLAGS="-O -D_FORTIFY_SOURCE=2" ./configure
...
Now it passes.

If other errors occur, config.log will tell.

Markus


More information about the grass-dev mailing list