From ad44350ecf956894238841b387125ab9824e3850 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Thu, 10 Oct 2013 15:21:47 +0200 Subject: Made Bindir relative to Libexecdir. When directory variables in project files are relative pathnames, then Comfignat.Bindir is now relative to Comfignat.Libexecdir, while the other pathnames are relative to Comfignat.Bindir. This should help programs in Libexecdir figure out the pathnames of files they need. The manual now also notes that runstatedir and lockdir are always absolute. --- comfignat.gpr.gp | 7 ++++--- comfignat.mk | 4 ++-- manual.en.html | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/comfignat.gpr.gp b/comfignat.gpr.gp index 4c9d8eb..ac2e7d4 100644 --- a/comfignat.gpr.gp +++ b/comfignat.gpr.gp @@ -78,12 +78,13 @@ abstract project Comfignat is -- tell them where to find or write different kinds of files at run time. -- Most of the directory names are relative to Bindir if the software was -- configured as a relocatable package. Otherwise they are absolute - -- pathnames. + -- pathnames. Bindir is relative to Libexecdir when the package is + -- relocatable. -- -- Programs that can be run from a command prompt are in Bindir. This is - -- normally the same directory that the program itself is in, so this - -- variable is probably of little use at run time. + -- usually the same directory that the program itself is in, so this + -- variable is probably useful only to programs in Libexecdir. #if Bindir'Defined then Bindir := $Bindir; #else diff --git a/comfignat.mk b/comfignat.mk index cc11575..09ec0eb 100644 --- a/comfignat.mk +++ b/comfignat.mk @@ -373,7 +373,7 @@ maybe_relative_to = \ # maybe_relative_to converts an absolute pathname into a relative one if a # relocatable package is desired. # Parameters: -# 1: an absolute pathname to convert to relative +# 1: an absolute pathname to maybe convert to relative # 2: the absolute base pathname that 1 may be made relative to # First check that the value of relocatable_package is a single word and that # that word is either "true" or "false". Complain and stop if that isn't so. @@ -420,7 +420,7 @@ ifeq (${dirgpr},) # directory variables to comfignat.gpr, and convey the usage-relevant ones # to usage projects in the form that usage projects need. - all_directories += '-DBindir="${call embed_pathname,${bindir}}"' + all_directories += '-DBindir="${call maybe_relative_to,${bindir},${libexecdir}}"' all_directories += '-DLibexecdir="${call embed_pathname,${libexecdir}}"' all_directories += '-DIncludedir="${call embed_pathname,${includedir}}"' all_directories += '-DArchincludedir="${call embed_pathname,${archincludedir}}"' diff --git a/manual.en.html b/manual.en.html index d0aff66..14184bd 100755 --- a/manual.en.html +++ b/manual.en.html @@ -243,7 +243,9 @@ usage project files that are preprocessed with Gnatprep. If the Make variable relocatable_package is set to "true" on the command line, then the variables for embedding will be relative to bindir in build project files, and relative to gprdir in usage project -files.

+files, except that bindir will instead be relative to +libexecdir, and runstatedir and lockdir are +always absolute.