I got this error while building pkg-config-0.20 on Solaris using Sun's compiler: cc -DHAVE_CONFIG_H -I. -I. -I. -DPKG_CONFIG_PC_PATH="\"/usr/local/lib/pkgconfig\"" -I./glib-1.2.8 -g -Wall -O2 -O -c `test -f 'pkg.c' || echo './'`pkg.c cc: illegal option -Wall gmake[2]: *** [pkg.o] Error 1 gmake[2]: Leaving directory `pkg-config-0.20' A quick fix would be to remove -Wall *and* -O2 from Makefile.am, but I'm not sure how to put them back the proper way. A quick search on Google came up with pages such as: http://sources.redhat.com/ml/newlib/2000/msg00062.html
2005-12-28 Tollef Fog Heen <tfheen@err.no> * configure.in, Makefile.am: Only use -Wall and other gcc-only flags when we don't have a set of CFLAGS already set and we're using gcc. Freedesktop #4888.
Created attachment 4379 [details] [review] Remove -Wall option that fails on Solaris forte compiler.
Comment on attachment 4379 [details] [review] Remove -Wall option that fails on Solaris forte compiler. Simply removing -Wall and -O2 options is a simple but not the right solution. Checking for gcc is better. I don't have the time atm to work on that part.
If the desire is "use the -g, -Wall, and/or -O2 flags iff the compilers supports them", then what's clearly needed is for configure to test if they are supported (or if we're lazy, if compiler=gcc) and then add them to the *FLAGS variables if so. Makefile shouldn't be forcing compiler flags. That redhat patch is a reasonable approach for it.
The JH_ADD_CFLAG macro that pygtk uses is a pretty good direct test for flag support. See http://cvs.gnome.org/viewcvs/gnome-python/gnome-python-extras/acinclude.m4
This has been fixed for quite a while, so closing this bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.