Subject: Re: Xaw3d - wrong compiler flags on Solaris w gcc
To: Jonathan Perkin <jonathan@perkin.org.uk>
From: Malte Dehling <mdehling@math.ruhr-uni-bochum.de>
List: tech-pkg
Date: 02/24/2005 14:52:59
--IiVenqGWf+H9Y6IX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 24, 2005 at 07:47:34AM +0000, Jonathan Perkin wrote:
> * On 2005-02-24 at 04:15 GMT, Malte Dehling wrote:
>=20
> > I might come up with a fix/patch for these problems, but I dont
> > really know where to start, so I will read some docs/pkgsrc
> > stuff/etc first. Shouldnt be too hard I think.
>=20
> That'd be great.  We're happy to help if you have any issues with
> creating patches for these packages.  The pkgsrc guide has some good
> documentation on how to create patches.

I think I have tracked down the problem by now...

# cd pkgsrc/x11/Xaw3d; bmake build
[...]
=3D=3D=3D> Configuring for Xaw3d-1.5
imake -DUseInstalled -I/usr/pkg/lib/X11/config -I/usr/openwin/lib/X11/config
[...]

So I read the files in /usr/pkg/lib/X11/config and
/usr/openwin/lib/X11/config , especially /usr/openwin/lib/X11/config/site.d=
ef .

I added the following to /usr/pkg/lib/X11/config/host.def :
---
#ifdef BeforeVendorCF

#ifndef HasGcc
#define HasGcc YES
#endif

#ifndef HasCplusplus
#define HasCplusplus YES
#endif=20
=20
#endif /* BeforeVendorCF */
---

Now the Sun CC specific compiler flags have disappeared but I still get the
"-K PIC" option which should be "-fPIC".
In /usr/openwin/lib/X11/config/sv4Lib.rules I found this:
---
#ifndef PositionIndependentCFlags
#if HasGcc2
#define PositionIndependentCFlags -fpic
#else
#define PositionIndependentCFlags -K PIC
#endif
#endif
#ifndef PositionIndependentCplusplusFlags
#if HasGcc2ForCplusplus
#define PositionIndependentCplusplusFlags -fpic
#else
#define PositionIndependentCplusplusFlags -K PIC
#endif
#endif
---
so i put
---
#ifndef PositionIndependentCFlags
#define PositionIndependentCFlags -fpic
#endif
#ifndef PositionIndependentCplusplusFlags
#define PositionIndependentCplusplusFlags -fpic
#endif
---
in host.def (inside the #ifdef BeforeVendorCF block).
This solved the problem. Still I dont really know with what package the
problem is...

Xaw3d still installs its headers into pkg/include/X11/X11/Xaw3d, which I
think is caused by this (in x11/Xaw3d/Makefile):
---
=2Eif !empty(X11BASE:M*openwin) #|| ${OPSYS} =3D=3D "IRIX"
PLIST_SUBST+=3D   INCDIR=3Dinclude/X11/X11
=2Eelse
PLIST_SUBST+=3D   INCDIR=3Dinclude/X11
=2Eendif
---
I dont think that in any case any includes should go into
include/X11/X11...


(btw: I tried to use 'pkg_info -Fe <file>' to find out to which package the
host.def file belongs. This didnt work on Solaris... the same thing gives
the expected result on my SparcStation w NetBSD)


> Many thanks for working on this.

Actually I would like to thank everyone who is working on pkgsrc (and netbs=
d)
for providing such an excellent system. Id be glad to be able to contribute=
 to
this in some way.

--=20
Malte Dehling

Mail:		mdehling [at] math.ruhr-uni-bochum.de
Website:	http://mdehling.ath.cx/mdehling/
PGP:		2586 A3BF B438 E68E 2B85  C4EA C5A7 AD96 C865 03D2

--IiVenqGWf+H9Y6IX
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iD8DBQFCHdw3xaetlshlA9IRAithAKCpTOYkE0YtLft4NRxIa9EOA5AgtwCfe9R/
juMhWh9kxF6gqv2P6C+A8sI=
=z9vc
-----END PGP SIGNATURE-----

--IiVenqGWf+H9Y6IX--