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

gprinstall does not provide ability to specify folder for ALI files #13

Closed onox closed 7 years ago

onox commented 8 years ago

A manually written library project .gpr file provides the ability to specify the folder for .ali files via Library_ALI_Dir. This prevents tons of ALI files from different projects to get installed all in a common library folder (if projects install files manually via a Makefile).

gprinstall does not seem to provide a way to specify a folder for the ALI files, thus all these files get installed in the folder indicated by Library_Dir (when inspecting the generated .gpr file).

For example, I would like gprinstall to be able to generate a .gpr file containing:

for Library_Dir  use "../../lib";
for Library_ALI_Dir use "../../lib/my-project";
t-14 commented 8 years ago

Hi. We are trying to understand your use case, can you perhaps elaborate? You say ...

This prevents tons of ALI files from different projects to get installed all in a common library folder

... but when you install different projects using gprinstall, their respective ALIs are placed in the directories <prefix>/lib/<project name>, so you shouldn't ever end up having ALIs from different projects sharing the same dir?

onox commented 8 years ago

That doesn't seem to be the case here. The lib folder contains:

  1. a gnat folder containing the generated .gpr file (as expected)
  2. the shared library and symlinks (as expected)
  3. the .ali files (unexpected)

I used gprinstall from GPL 2015 as follows in a Makefile:

gprinstall --relocate-build-tree -p --install-name='my-project' \
    --sources-subdir=${includedir} \
    --project-subdir=${gprdir} \
    --lib-subdir=${libdir} \
    --prefix=${PREFIX} \
    -P my_project.gpr

gprinstall --help doesn't show a --ali-subdir.

t-14 commented 8 years ago

Oh, I see, you are forcing your own sources and lib subdir. Normally the default behavior (i.e. if you only give prefix) is to install in <prefix>/lib/<project>, but you are overriding it. Any reason not to use default gprinstall choices, or at least supply --lib-subdir=${libdir}/my_project etc in your command line?

gprinstall --help doesn't show a --ali-subdir

Just to be clear - what you are really looking for is a command line interface to stage ALI files in their own location, aren't you?

onox commented 8 years ago

but you are overriding it. Any reason not to use default gprinstall choices, or at least supply --lib-subdir=${libdir}/my_project etc in your command line?

The only reason is to simply allow customizing the locations via variables in the Makefile. Using --lib-subdir=${libdir}/my_project indeed installs the ALI files in that folder. I see gprinstall still creates a symlink in ${libdir}. What is the logic that causes it to install in that folder instead of ${libdir}/my_project?

Just to be clear - what you are really looking for is a command line interface to stage ALI files in their own location, aren't you?

Yes, what I am looking for is to be able to specify --ali-subdir=${alidir} with alidir defined somewhere in the Makefile.

t-14 commented 8 years ago

What is the logic that causes it to install in that folder instead of ${libdir}/my_project?

It's only done for .so's, the idea is to let you set LD_LIBRARY_PATH=${libdir} and nail them all, instead of having to point to every subdirectory separately.

Yes, what I am looking for is to be able to specify --ali-subdir=${alidir} with alidir defined somewhere in the Makefile.

Understood, we'll look into that.

t-14 commented 7 years ago

This has been implemented.

onox commented 7 years ago

Thank you! :+1: