Autotools with data files

I want to distribute my source code and related data files using Autotools:

~/foo$ ls -R
.:
conf  configure.ac  dat  Makefile.am  src

./conf:
foo-pref.conf

./dat:
data.dat

./src:
main.c  Makefile.am

This is what I still have. No subdirectories. / conf and. / dat I can get Autotools to work to configure it for a single executable. But I want data.dat to be set to $ (prefix) / share and foo-pref.conf to be installed in the corresponding / etc directory. What can I do for this?

+3
source share
1 answer

dist_data_DATA = dat/data.dat dist_sysconf_DATA = conf/foo-pref.conf . dist_ , , make dist. ( ) , : data ${datadir}, sysconf ${sysconfdir},... Makefile, . , data primary , , , , SCRIPTS.

, configure ${sysconfdir} ${prefix}/etc /etc. , configure, . ./configure --sysconfdir=/etc.

+6

Source: https://habr.com/ru/post/1775996/


All Articles