0

I created an example project called foo, its configure.ac is:

AC_PREREQ([2.69])
AC_INIT([foo], [1.0.0], [a@a.a])
AC_CONFIG_SRCDIR([foo.cpp])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign])
LT_INIT
AC_PROG_CXX
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

and its Makefile.am is:

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = foo.cpp
noinst_libfoo_la_DATA = test

When I run autoreconf -i, I get:

Makefile.am:3: error: 'noinst_libfoo_la_DATA' is used but 'noinst_libfoo_ladir' is undefined.

What is noinst_libfoo_ladir? I can’t seem to find documentation on this.

qdii
  • 12,505
  • 10
  • 59
  • 116

1 Answers1

3

Your problem is this line, as indicated in the error:

noinst_libfoo_la_DATA = test

automake deals with these variable suffixes when deciding how to build. Note that suffixes ending in _DATA is not one of them. However, it does recognize _DATA as being installed in a location (e.g. data_DATA is installed in datadir). The location that noinst_libfoo_la_DATA would be installed to would therefore be in the variable noinst_libfoo_ladir, the definition of which does not exist in Makefile.am, hence the error.

So ladir is nothing. It's just suffixing noinst_libfoo_la with dir, trying to find an undefined variable. The same process applied to data_DATA would be data (strip off _DATA suffix) + dir = datadir. In order to not get an error, you would need to define something like:

noinst_libfoo_ladir = $(datadir)/libfoo

in Makefile.am. I'd call it something else since a noinst_ prefix has a special meaning for other things in autotools (don't install).

ldav1s
  • 15,885
  • 2
  • 53
  • 56
  • _DATA variables are mentioned in the manual. Though that leaves a lot of information unsaid that makes the error make sense. http://www.gnu.org/software/automake/manual/html_node/Data.html#index-_005fDATA – Etan Reisner Jan 22 '14 at 13:57
  • Yep, the second error is just a stupid error of mine, I will fix it in the question so that people don’t get sidetracked – qdii Jan 24 '14 at 10:20