Which dialect is the fortran code? f90? then you should add

FORTRAN_STANDARD=90

before pkg_setup()