Danny Lo
Danny Lo

Reputation: 1583

autoreconf ignores AC_CONFIG_MACRO_DIR

I have a minimal configure.ac file:

AC_INIT([phmf], [0.1])
AM_INIT_AUTOMAKE
AC_OUTPUT([Makefile])

Using the most current autoconf version 2.69 on it (which is 2012 btw) I am receiving the following warning:

$ autoreconf -iv
autoreconf: running: aclocal -I m4
aclocal-1.15: warning: couldn't open directory 'm4': No such file or directory

This led me to an assumption that the directory 'm4' is being looked for, because it's the default behavior of autoreconf. So I tried to overwrite the default value by adding the following macro:

AC_CONFIG_MACRO_DIR([.])

But this was useless - I still get the same warning. Is it a bug or do I have to do something else to prevent including the directory 'm4' for aclocal?

edit: I dont have any m4 scripts in my project indeed. And I also agree that I don't really want to set macro directory to the root directory of my project. Therefore the more appropriate configuration would be:

AC_CONFIG_MACRO_DIR()

because I don't want to include anything, i.e. the called command should be just

aclocal

without any parameters.

Upvotes: 1

Views: 3994

Answers (2)

Diego Elio Pettenò
Diego Elio Pettenò

Reputation: 3240

That's a warning, you shouldn't need to do anything about it, unless you planned on using -Werror for automake (and that's probably a bad idea.)

The problem is that you can't override the default of m4 with . due to the design of aclocal (and it would be an automake problem anyway, not autoconf.)

Upvotes: 1

Edwin Buck
Edwin Buck

Reputation: 70909

If your aclocal flags include -I m4 then your AC_CONFIG_MACRO_DIR mostly likely should read

 AC_CONFIG_MACRO_DIR([m4])

by setting it to the current directory, I'd expect you're making things worse instead of better.

Do you have a {root}/m4 directory? (where {root} is the root of your repository)? If not, then that might be the issue.

Try making a "m4" directory. It should go in the "root" of your project (the same directory as the configure.ac (or configure.in) file).

Upvotes: 1

Related Questions