Re: [gnome-love] At last... I made it...



On Mon, 2004-06-14 at 10:22, Melinda wrote:

Here's what I want to do with 'make install'. 'make install' will put
wallpapoz and daemon_wallpapoz ( both of them are binary ) into
$prefix/bin. It will put wallpapoz.glade into $prefix/bin too because my

Eek.  No, *only* application binaries go in bin.  Data file resources
like glade files absolutely do not belong there at all, in any way. 
Should instead be somewhere like $prefix/share/wallpapoz/.  You can then
use a library like binreloc (http://www.autopackage.org) to locate the
correct folder and load the glade file at runtime.

But how could I do that?
When I type 'make install', it just only copy the binary into
$prefix/bin. What file do I have to manipulate? I have no clue....

The Makefile.am files take a list of files and the locations they should
be installed to.  For example, to put the .glade file in the correct
location, you'd have something like:

glade_DATA = wallpapaz.glade
gladedir = ${datadir}/@PACKAGE_TARNAME@/

@PACKAGE_TARNAME@ is expanded to the application name defined in
configure.in, which should in your case by wallpapoz.  ${datadir} should
be expanded to ${prefix}/share.  So in the above, automake will make it
so make install will put the wallpapoz.glade file in
/usr/share/wallpapoz/wallpapoz.glade, assuming you install to the /usr
prefix.

If for some reason you cannot use Binreloc and need to hard-code the
path (*please* don't do this if not necessary; hard-coded paths are the
devil and make it impossible to relocate your binaries), you'll need to
tell the app where to find the glade file.  To do this, add something
like -DDATADIR="${datadir}/@PACKAGE_TARNAME@" to your CFLAGS variable. 
Then you'll have the DATADIR macro in your code that points to the
proper directory, so you can find the glade file using DATADIR
"/wallpapoz.glade" in your code.
-- 
Sean Middleditch <elanthis awesomeplay com>
AwesomePlay Productions, Inc.




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