Subject: proposal: USE_FORTRAN
To: None <>
From: None <>
List: tech-pkg
Date: 11/17/1999 11:39:39
  - The in tree fortran compiler (/usr/bin/f77) is buggy (see PR's 8574
    and 8663 for details).

  - Several of our packages use fortran and contain logic local to the
    package Makefile which adds the dependency on f2c for systems
    (pre-1.4) which don't ship f77.


  I'd like to create a variable 'USE_FORTRAN' in which would be
  set in the package Makefile for those packages which use fortran.  That
  way the logic pertaining to the fortran compiler, possible dependency on
  f2c, and selection of the fortran compiler are done in 1 central

  The modification to would be the addition of:
.if defined(USE_FORTRAN)
.if !exists(/usr/bin/f77) || defined(USE_F2C)
DEPENDS+=	f2c-19989812:${PKGSRCDIR}/lang/f2c
FC=		f2c-f77
FC=		f77
F77=		${FC}

  This way on pre-1.4 systems (which don't have f77) the f2c dependency is
  automatically picked up.  Also, users can force the use of f2c as the
  fortran compiler by setting USE_F2C in mk.conf.  

  I will need to update, mk.conf.examples, Packages.txt and
  packages(7) to reflect this (and the packages which need fortran).

  The remaining question I have is if we should make f2c be the default
  for now since f77 is buggy.  Long term, the goal should be to not ship a
  buggy compiler.  I could perhaps implement f2c being the default by
  something like:

  .if defined(USE_F2C)
  .if ${USE_F2C}=="NO"
  .undef USE_F2C

  Then users could put USE_F2C=NO in mk.conf to override the f2c default.

I will collect comments and suggestions before implementing this and doing
the final testing on my system.