Subject: suggestion for compiler setup
To: None <tech-pkg@netbsd.org>
From: Georg Schwarz <geos@epost.de>
List: tech-pkg
Date: 02/08/2004 01:42:07
As you know, pkgsrc's compiler selection/configuration mechanism has recently
changed. The new scheme poses two problems on IRIX 5.3:

- IRIX 5.3 cc does not understand -version (moreover, my /bin/sh seems to
terminate since cc -version gives an error).
- IRIX 5.3 does not have /usr/bin/CC.

Previously I used to overcome these problems by explicitely setting in
/etc/mk.conf CXX and CC_VERSION. This no longer workd.
I would very much appreciate if the following patch could be incorporated into
pkgsrc:

*** mipspro.mk  Sun Feb  8 01:15:27 2004
--- mipspro.mk.orig     Sun Feb  8 01:14:26 2004
***************
*** 20,37 ****
  .  if !empty(_LANGUAGES.mipspro:Mc)
  _MIPSPRO_CC=          ${_MIPSPRO_DIR}/bin/cc
  _MIPSPRO_LINKS+=      _MIPSPRO_CC
! CC?=                  ${_MIPSPRO_CC}
! CPP?=                 ${_MIPSPRO_CC} -E
  .  endif
  .  if !empty(_LANGUAGES.mipspro:Mc++)
  _MIPSPRO_CXX=         ${_MIPSPRO_DIR}/bin/CC
  _MIPSPRO_LINKS+=      _MIPSPRO_CXX
! CXX?=                 ${_MIPSPRO_CXX}
  .  endif
  
  .  if exists(${MIPSPROBASE}/bin/cc)
  # MIPSpro Compilers: Version 7.3.1.2m
! CC_VERSION?=  `${MIPSPROBASE}/bin/cc -version 2>&1 | ${GREP} '^MIPSpro'`
  .  else
  CC_VERSION?=  MIPSpro
  .  endif
--- 20,37 ----
  .  if !empty(_LANGUAGES.mipspro:Mc)
  _MIPSPRO_CC=          ${_MIPSPRO_DIR}/bin/cc
  _MIPSPRO_LINKS+=      _MIPSPRO_CC
! CC=                   ${_MIPSPRO_CC}
! CPP=                  ${_MIPSPRO_CC} -E
  .  endif
  .  if !empty(_LANGUAGES.mipspro:Mc++)
  _MIPSPRO_CXX=         ${_MIPSPRO_DIR}/bin/CC
  _MIPSPRO_LINKS+=      _MIPSPRO_CXX
! CXX=                  ${_MIPSPRO_CXX}
  .  endif
  
  .  if exists(${MIPSPROBASE}/bin/cc)
  # MIPSpro Compilers: Version 7.3.1.2m
! CC_VERSION!=  ${MIPSPROBASE}/bin/cc -version 2>&1 | ${GREP} '^MIPSpro'
  .  else
  CC_VERSION?=  MIPSpro
  .  endif


That way, it is again possible to override CXX and CC_VERSION (as well as CC and
CPP), if desired. Normally, this should not be necessary nor advisible, but
there might be some situations where it helps. The above changes should not
break things but should add to the flexibility of pkgsrc. For sunpro.mk one
might apply equivalent changes. 

-- 
Georg Schwarz    http://home.pages.de/~schwarz/
 geos@epost.de     +49 177 8811442