Subject: Re: cc, gcc, cpp, g++, c++ symlinks
To: Jeremy C. Reed <reed@reedmedia.net>
From: None <jmmv@menta.net>
List: tech-pkg
Date: 10/16/2003 16:41:48
IIRC, Gentoo Linux provides a cc wrapper that is able to call any compiler,
based on how you configure it.  There is a "cc-config" (or something similar)
program that can be used after installing multiple compilers to select the
default one.  Such an approach might be better, IMO, as you don't have to
handle "shared" files across multiple packages.

Cheers

On Wed, Oct 15, 2003 at 04:23:04PM -0700, Jeremy C. Reed wrote:
> It would be useful if there was some pkgsrc option to create symlinks for
> cc, gcc, cpp, g++, c++, et cetera.
> 
> # CC_SYMLINK=
> # Create links for compiler tools in ${PREFIX}/bin for the packages
> # listed when installed.
> # Possible: gcc gcc3 gcc3-c gcc3-c++ tendra and other compilers
> # Default: not defined
> 
> Then each package have something like:
> 
> .if defined(CC_SYMLINK) && !empty(CC_SYMLINK:Mgcc3-c++)
> PLIST_SRC+=		${PKGDIR}/PLIST.symlinks
> INSTALL_FILE=           ${PKGDIR}/INSTALL.symlinks
> .endif
> 
> 
> And an INSTALL script, like:
> 
> ...
> 
> POST-INSTALL)
> 	 ${LN} -sf ${GCC_PREFIX}/bin/c++ ${PREFIX}/bin/c++
> 	 ${LN} -sf ${GCC_PREFIX}/bin/g++ ${PREFIX}/bin/g++
> 
> (making sure that GCC_PREFIX is defined too.)
> 
> 
> What do you all think?
> 
> This would be useful for me to make sure I automatically have symlinks for
> the compiler tools in my PATH (rather than adding /usr/.../gcc3/bin to my
> execution path).
> 
>    Jeremy C. Reed
>    http://bsd.reedmedia.net/
> 
> 

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/