I have two autotools projects that work fine on their own:
p1 does not build any libs nor use C++, and is meant to be compiled by the user. So I don't libtoolize nor LT_INIT here.
p2 creates a tiny C++ library that is used only in development, here I have LT_INIT and call libtoolize.
But when I put the p2 directory inside p1, running automake inside the p2 directory will notice that it's in a subdirectory of an autotools project, and I get the error
configure.ac:31: required file `../ltmain.sh' not found
I tried adding
AC_CONFIG_AUX_DIR([.])
to the configure.ac of p2, but then the ac_aux_dir variable in configure gets empty, and I get the error
configure: error: cannot run /bin/sh /config.sub
(the line in configure tries to run $ax_aux_dir/config.sub
)
Is there a clean way to have an unrelated autotools project inside an autotools project, or should I just give up?