I created an example project called foo, its configure.ac is:
AC_PREREQ([2.69])
AC_INIT([foo], [1.0.0], [[email protected]])
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.
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).