A key of "needs_compiler" raises the question, "for what language?"  "Compiler" 
does not necessarily mean "C compiler".  PDL likes to have a Fortran compiler, 
Inline::Java needs a Java compiler, and so on.

So the value would be a list of languages.

  # Any ol C compiler will do
  compiler => 'C'

  # We specifically need a C99 compiler
  compiler => 'C99'

  # Both a C and Fortran 77 compilers are needed (for example, PDL)
  compiler => ['C', 'Fortran77']

As for whether or not the compiler is optional, declare it same as any other 
dependency.  Then no special syntax is needed and it will expand as 
Module::Build's dependency handling expands.

  # Most XS modules only need a C compiler to build
  build_requires => {
      compiler => 'C'
  }

  # But some things, like Inline::C, need it to run
  requires => {
      compiler => 'C'
  }

"compiler" becomes a special key in the dependency field.  This makes me a 
little nervous as it could clash with a module called "compiler".  Perhaps it 
should have a non-package character in the name such as "-compiler".


Reply via email to