autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caching pkgdatadir in configure


From: Mike Frysinger
Subject: Re: Caching pkgdatadir in configure
Date: Wed, 14 Oct 2009 07:54:33 -0400
User-agent: KMail/1.12.1 (Linux/2.6.31; KDE/4.3.1; x86_64; ; )

On Wednesday 14 October 2009 07:37:33 Alberto Luaces wrote:
> I wrote a program that uses data files at runtime. I store them in
> $pkgdatadir, and it works fine.
> 
> Sometimes I want to execute the program without installing it. To do
> this, I change the value of the $pkgdatadir variable at make time:
> 
> make pkgdatadir=...
> 
> I wonder if I could modify and cache $pkgdatadir variable when running
> configure, to avoid having to specify the value of pkgdatadir every time
> I am recompiling.
> 
> I tried to use AC_SUBST(pkgdatadir), but this makes that the $pkgdatadir
> value is void if I don't define it when configuring because it overrides
> the Automake definition $datadir/$packagename.
> 
> Is it possible to do what I want?
> 
> 1. If pkgdatadir is not specified at configure time, follow the FHS or
> GNU guidelines.
> 2. If pkgdatadir is specified, store its value in the configure cache.

a lot of people muck around with path vars in configure when they shouldnt.  
their code tends to be pretty fragile as they have to check multiple vars and 
expand them manually.

what i do is append the CPPFLAGS in the configure.ac like so:
CPPFLAGS=$CPPFLAGS' -DMY_DATA_PATH="\"$(pkgdatadir)\""'
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]