automake
[Top][All Lists]
Advanced

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

Re: Setting output dir for support files


From: John Calcote
Subject: Re: Setting output dir for support files
Date: Fri, 01 May 2009 10:34:35 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

Hi Robert,

On 4/30/2009 11:07 PM, Robert J. Hansen wrote:
I've used Autotools in a few small projects before, but nothing which
required auxiliary files to support the binaries.  Typically, I've seen
these auxiliary files stored in /usr/share/package-version/, and would
like to do the same thing for my own package via Autotools.

I'm able to get /usr/share (or, more accurately I guess, $PREFIX/share)
just by using ${datadir} in my Makefile.am.  However, I can't shake the
feeling that (a) this is the wrong way to do it, and (b) if I hardwire
paths that way I'll be stuck maintaining my error for quite some time to
come.

So, my questions:

1.  What's the correct way to do this?  I'm assuming there's some
     configure.ac and Makefile.am changes which need to be made, but
     I'm not sure which.
Use dist_pkgdata_DATA instead of dist_data_DATA. However, by default pkgdatadir is datadir/$(PACKAGE). If you want the version on the directory also, you'll have to redefine pkgdatadir to include $(VERSION), as shown below...

2.  How can I make dist_data_DATA install to this directory?  (If I
     should be using a different target, please say so!)

Makefile.am:

pkgdatadir = $(PACKAGE)-$(VERSION)
dist_pkgdata_DATA = ...

3.  How can I, programmatically within my C code, find the dirs in
     which my auxiliary files have been placed?
Makefile.am:
...
myprogram_CPPFLAGS = -DPKGDATADIR="\"$(pkgdatadir)\""

-----
source_file.c:
...
#ifndef PKGDATADIR
# error PKGDATADIR not defined
#endif

const char mydatatadir[] = PKGDATADIR;
...

I apologize for the elementary question, but Google has been pretty much
no help, and studying how other projects have done it has been less than
informative.  :(
That's been my experience, as well. I think there aren't enough folks who blog about the Autotools. This is probably because the class of people who blog simply doesn't overlap much with the class of people who use the Autotools. ;-)

Regards,
John


reply via email to

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