Re: Caching pkgdatadir in configure

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

 



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.

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux