[Xastir-Dev] 1.2.0 patches for datadir, pkglib, xastir.spec.in
Alan Crosswell
alan at columbia.edu
Tue Jun 17 21:50:51 EDT 2003
Uggh, it's a *feature* of configure. Quoting from the info page,
"Installation Directory Variables":
Most of these variables have values that rely on `prefix' or
`exec_prefix'. It is deliberate that the directory output variables
keep them unexpanded: typically `@datadir@' will be replaced by
`${prefix}/share', not `/usr/local/share'.
This behavior is mandated by the GNU coding standards, so that when
the user runs:
`make'
she can still specify a different prefix from the one specified to
`configure', in which case, if needed, the package shall hard code
dependencies corresponding to the make-specified prefix.
`make install'
she can specify a different installation location, in which case
the package _must_ still depend on the location which was compiled
in (i.e., never recompile when `make install' is run). This is an
extremely important feature, as many people may decide to install
all the files of a package grouped together, and then install
links from the final locations to there.
In order to support these features, it is essential that `datadir'
remains being defined as `${prefix}/share' to depend upon the current
value of `prefix'.
A corollary is that you should not use these variables except in
Makefiles. For instance, instead of trying to evaluate `datadir' in
`configure' and hard-coding it in Makefiles using e.g.,
`AC_DEFINE_UNQUOTED(DATADIR, "$datadir")', you should add
`-DDATADIR="$(datadir)"' to your `CPPFLAGS'.
--------
So, because we use config.h instead of -D stuff set in CPPFLAGS in the
Makefile, datadir's default value can't be used whereas any overriding
value (as set by the rpm %configure macro) works. Sorry I didn't test
this more thoroughly! I'll fix it, probably in a kludgy way:-(
I suppose y'all are wedded to config.h instead of all the -D's in the
Makefile?
/a
Curt Mills wrote:
> On Tue, 17 Jun 2003, Curt Mills, WE7U wrote:
>
>
>>So far I've needed to do this:
>>
>>
>> Close Xastir sessions
>> mv /usr/local/xastir /usr/local/share
>> Edit ~/.xastir/config/xastir.cnf: Change "/usr/local/xastir" to
>> "/usr/local/share/xastir".
>>
>>
>>Now it's complaining because it can't find the xastir.rgb file:
>>
>>
>>Error! can not find color file: ${prefix}/share/xastir/config/xastir.rgb
>>Error in Color file! Exiting...
>
>
> Looks like it gets that from config.h:
>
>
> #define XASTIR_DATA_BASE "${prefix}/share/xastir"
>
>
> configure.ac has this:
>
>
> # Set XASTIR_DATA_BASE in config.h.
> if test "x${datadir}" = "x"; then
> AC_DEFINE_UNQUOTED(XASTIR_DATA_BASE, "${ac_default_prefix}/share/xastir", [Stored data])
> else
> AC_DEFINE_UNQUOTED(XASTIR_DATA_BASE, "${datadir}/xastir", [Stored data])
> fi
>
>
> So somehow the variables are not getting substituted on the way to
> config.h?
>
>
More information about the Xastir-dev
mailing list