AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

Use relative file paths in gprconfig #61

Closed ajxs closed 5 years ago

ajxs commented 5 years ago

This is a minor issue I've encountered using gprbuild on Fedora Linux. I'm doing some embedded development and I'm using a linker script as part of my project. I'm invoking the linker script in compilation by including the following lines in my gprconfig file:

   package Linker is
      --   Excuse the placeholder name.
      for Default_Switches ("Ada") use ("-T/home/ajxs/_project_/linker.ld");
   end Linker;

I can't seem to find a way to reference the linker script relative to the project directory. This works just fine for now, but it doesn't seem like an ideal scenario, since it would need to be updated if I move the project directory. It seems like the working directory of gprbuild during compilation is the directory the gprbuild binary is located in, so this looks like the only way to get it to find the script file.

Is there a way around this? I admit the possibility that I may be going about this the wrong way. If so, I'd definitely appreciate being shown the error. Thank you.

t-14 commented 5 years ago

for Switches (others) use ("-T" & Project_Dir & "linker.ld");

(Switches(others) is preferable to Default_Switches("ada") since it allows for non-Ada mains)

ajxs commented 5 years ago

Thank you so much for your response.