Subject: Re: probably should check for flex instead of SunOS
To: Jeremy C. Reed <reed@reedmedia.net>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-pkg
Date: 06/03/2003 07:08:36
  .if !exists(/usr/bin/flex)
  BUILD_DEPENDS+=     flex-*:../../devel/flex
  .endif

This seems suboptimal, because 
1) there is no way to test that the lex is adequate,
2) this fragment will show up multiple places.
When (1) is addressed by 'if platform is foo, then builtin lex is
bogus, so use flex', 2 gets to be more of a problem.

I realize this isn't a mainline buildlink situation (rather, a host
tool needed for compile instead, but I suppose that falls under
'controlling the build environment of the package'), but it would be
cool to have some way to have a line that says 'needs lex'.

Perhaps 

.include ../../mk/lex.mk

and something a la texinfo.mk?  It seems gross to put all these in mk,
but on the other hand the dependency is not on flex, but a working
lex.

lang/gcc/buildlink2.mk seems to be used for setting up to build with
gcc, not linking against gcc libraries, so perhaps there should be a
devel/flex/buildlink2.mk.

From reading Packages.txt and some buildlink2 readme files, my guess
is that using buildlink2.mk is the best choice.

        Greg Troxel <gdt@ir.bbn.com>