Bugzilla – Bug 215
Missing c99 compile flag on Solaris
Last modified: 2009-11-30 03:42:13
You need to log in before you can comment on or make changes to this bug.
Building ganglia on Solaris 10 requires an additional compile flag. Specifcally, "-std=gnu99" needs to be added to CFLAGS. The full build error: [beckerjes@kronos:~/ganglia/ganglia-3.1.1]$ gmake gmake all-recursive gmake[1]: Entering directory `/home/beckerjes/ganglia/ganglia-3.1.1' Making all in lib gmake[2]: Entering directory `/home/beckerjes/ganglia/ganglia-3.1.1/lib' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I. -I../include/ -D_LARGEFILE64_SOURCE -I/usr/local/ganglia/include -I/usr/local/apr/include -fno-strict-aliasing -Wall -D__EXTENSIONS__ -D_POSIX_C_SOURCE=200112L -DHAVE_STRERROR -MT getopt1.o -MD -MP -MF ".deps/getopt1.Tpo" -c -o getopt1.o getopt1.c; \ then mv -f ".deps/getopt1.Tpo" ".deps/getopt1.Po"; else rm -f ".deps/getopt1.Tpo"; exit 1; fi In file included from /usr/include/iso/ctype_iso.h:30, from /usr/include/ctype.h:18, from getopt.h:34, from getopt1.c:25: /usr/include/sys/feature_tests.h:336:2: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99" gmake[2]: *** [getopt1.o] Error 1 gmake[2]: Leaving directory `/home/beckerjes/ganglia/ganglia-3.1.1/lib' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/home/beckerjes/ganglia/ganglia-3.1.1' gmake: *** [all] Error 2 The ./configure command is uninteresting: LDFLAGS=-L/usr/local/rrdtool-1.2.19/lib CFLAGS=-I/usr/local/rrdtool-1.2.19/include ./configure --enable-status --with-libapr=/usr/local/apr --with-gmetad --prefix=/usr/local/ganglia
the C99 flag is meant to be added by configure when evaluating the AC_PROG_CC_STDC, but version 2.59 of autoconf that is used to bootstrap the release package didn't, generating this problem. re-bootstrapping the package with a newer version of the autotools (as provided by Solaris 10) could be used to solve the problem. as indicated before, adding : CFLAGS="-std=c99" is a usable workaround as well until the bootstrapping could be done for releases with something less obsolete than CentOS 4
to avoid a bug in Solaris headers while building libmetrics it would be better to use instead : CFLAGS="-std=gnu99"
ommitted revision 2125 for trunk