I need to get the shell equivalent of


to work in an autotools .am file, but can't get it working. I currently have this declaration in my Makefile.am file:


but when the build runs it is not behaving as though that variable is set as an environment variable. Can anyone advise on what the correct syntax is?


To declare environment variables is better to user the configure.ac file. There you can write:


However, I am not sure what are you trying to achieve with that. Do you need an environmental variable to run your program or to compile it? In the former case, other methods are preferable.

  • This variable only needed for the build, trying your suggestion now. – SeanLabs Jun 23 '17 at 16:58
  • If you need it for building the project, configure.ac is the right place :) – Vicente Adolfo Bolea Sánchez Jun 26 '17 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.