Defining data files to install

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Defining data files to install

Julian Marchant
Hi,

I'm a little confused about how to set up Autoconf to install data files
for the program to use later, and I wondered if someone can clear up my
confusion.

For reference, the pertinent program is Project: Starfighter:

http://starfighter.nongnu.org

Starfighter has a few different directories with required data files:
"data", "gfx", "music", and "sound". All files in these directories need
to be installed to a location that gets defined as DATADIR. From what I
understand so far, the directory I want to use is the one stored in the
pkgdatadir variable, and I include files to install there by assigning
them in a Makefile.am to pkgdata_DATA. But listing the files out from a
Makefile.am in the same directory doesn't copy the directory structure,
and if I indicate a directory from the top-level Makefile.am, "make
install" just ignores (or rather, "omits") it and then spits out an
error with no accompanying information.

What am I missing here? How can I install these data files not into the
top-level pkgdatadir, but in the respective appropriate sub-directories
of pkgdatadir (e.g. "$(pkgdatadir)/data" and "$(pkgdatadir)/music")? I
can't find any documentation on how to do this anywhere.

--
Julie Marchant
https://onpon4.github.io

Protect your emails with GnuPG:
https://emailselfdefense.fsf.org


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Defining data files to install

Eric Blake-3
On 01/26/2017 03:22 PM, Julie Marchant wrote:

> Hi,
>
> I'm a little confused about how to set up Autoconf to install data files
> for the program to use later, and I wondered if someone can clear up my
> confusion.
>
> For reference, the pertinent program is Project: Starfighter:
>
> http://starfighter.nongnu.org
>
> Starfighter has a few different directories with required data files:
> "data", "gfx", "music", and "sound". All files in these directories need
> to be installed to a location that gets defined as DATADIR. From what I
> understand so far, the directory I want to use is the one stored in the
> pkgdatadir variable, and I include files to install there by assigning
> them in a Makefile.am to pkgdata_DATA. But listing the files out from a
> Makefile.am in the same directory doesn't copy the directory structure,
> and if I indicate a directory from the top-level Makefile.am, "make
> install" just ignores (or rather, "omits") it and then spits out an
> error with no accompanying information.
Makefile.am is read by automake, so your question is more likely to be
answered in the automake manual than the autoconf manual.

>
> What am I missing here? How can I install these data files not into the
> top-level pkgdatadir, but in the respective appropriate sub-directories
> of pkgdatadir (e.g. "$(pkgdatadir)/data" and "$(pkgdatadir)/music")? I
> can't find any documentation on how to do this anywhere.

Automake lets you define new targets that are subdirectories.  In fact,
a quick search for $(pkgdatadir) found an example that might be
pertinent to your use case:

https://www.gnu.org/software/automake/manual/automake.html#Alternative

But I'm not as good at automake as I am at autoconf, so I'm cc'ing that
list in, in case someone else has more ideas.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf

signature.asc (617 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Defining data files to install

Julian Marchant
On 01/26/2017 04:33 PM, Eric Blake wrote:
> Automake lets you define new targets that are subdirectories.  In fact,
> a quick search for $(pkgdatadir) found an example that might be
> pertinent to your use case:
>
> https://www.gnu.org/software/automake/manual/automake.html#Alternative

Thanks, that turned out to be exactly what I needed.

--
Julie Marchant
https://onpon4.github.io

Protect your emails with GnuPG:
https://emailselfdefense.fsf.org


_______________________________________________
Autoconf mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/autoconf

signature.asc (836 bytes) Download Attachment
Loading...