Re: Where can I fetch my pix? :'(



> [Snip]
>  in the sources, it would work... but what if the user
> decides to specify a different prefix? The pix would be
> installed elsewhere...
>  So, how can I do?? A solution can be to install the pix in
> the same dir of the binary file, but... somehow I guess this
> isn't _too_ correct... <:) Is there a macro that returns me
> the "pointer" to a file installed in a filesystem? Or...
> boh! I really don't know! :(

Assuming your program is programmed in 'C' you can pass build time
constants to
your compiler :

In your configure.in put something like :

	image_path="${prefix}/share/"
	AC_SUBST(image_path)

Then in your Makefile.am in the section INCLUDES, put something like
this :
INCLUDES =	\
	-DIMAGE_PATH=\""$(imagepath)"\"

If you do this you can then use the constant IMAGE_PATH in your source
code,
like (just as an example) : 
	fopen (IMAGE_PATH / "filename.extension", "r");


Hope this helps.


Almer S. Tigelaar




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