0

Would anybody know if there's any way of computing the name of an included file in autoconf ?

I have a project capable of building one of several variants currently based on an identity defined in configure.ac - my aim is to be able to identify the variant from the CLI when autoconf/configure is run and include an m4 file if/as appropriate. AFAICT, only string literals are allowed as the filename in either the include or sinclude macro calls ... and it's now starting to drive me to distraction =:-O

Any help most gratefully received

DP

  • I think I have a better understanding of what you are trying to do now. So how is this "identity" defined in `configure.ac`? Is it in the shell scripting layer (e.g. a shell variable, `AC_ARG_WITH`, `AC_ARG_ENABLE`, et al.) or the m4sugar layer (e.g. `m4_define`, `m4_include`, `m4_sinclude` et al.)? If it's defined in the shell scripting layer, it's already too late to do anything in m4 -- `configure` has already been written. – ldav1s Nov 06 '13 at 16:43
  • Thanx for that @ldav1s, you have confirmed my newly gained understanding of what's going on under the hood. FWIW, the option is passed in as a configure option which means that I have to come up with an alternative solution to the problem. (I'd love to say that you've answered the question, but as a noob, don't know how to. – David Pointon Nov 07 '13 at 13:58

1 Answers1

0

The identity is setup at configure runtime, not when configure is created. Any m4 level (e.g. m4sugar) manipulation of configure will happen before then, so this doesn't look possible.

ldav1s
  • 15,885
  • 2
  • 53
  • 56