Bug 4888

Summary: [pending] can't build pkg-config-0.20 on Solaris
Product: pkg-config Reporter: Dimitri Papadopoulos <dimitri.papadopoulos-orfanos>
Component: srcAssignee: Tollef Fog Heen <tfheen>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: high CC: dmacks
Version: unspecified   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Attachments: Remove -Wall option that fails on Solaris forte compiler.

Description Dimitri Papadopoulos 2005-10-26 01:28:25 UTC
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
Comment 1 Tollef Fog Heen 2005-12-29 01:03:24 UTC
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.

Comment 2 Damien Carbery 2006-01-17 22:25:25 UTC
Created attachment 4379 [details] [review]
Remove -Wall option that fails on Solaris forte compiler.
Comment 3 Damien Carbery 2006-01-17 22:28:54 UTC
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.
Comment 4 Daniel Macks 2006-05-19 04:45:29 UTC
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.
Comment 5 Daniel Macks 2006-05-19 12:58:39 UTC
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
Comment 6 Tollef Fog Heen 2009-12-06 13:50:24 UTC
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.