1

I want to add a #define FOO code in an header file with autotools when I used a specific flag.

The project I have creates a static library using header to use inline functions for example. If I use the -D option, It will be used at the creation time but I'll have to add it at each compilation using this library which is what I want to avoid.

How can I perform this?

Romain Picot
  • 255
  • 1
  • 13

1 Answers1

0

I think your best bet is to generate the required header file from the pre-existing file. The following shell command would do the trick:

(echo "#define FOO" ; cat myheader_pregen.hpp) > myheader.hpp

You can incorporate the above as a script into autotools with this

Community
  • 1
  • 1
Smeeheey
  • 9,906
  • 23
  • 39