7

Trying to use automake/autoconf (versions 1.10 and 2.61, respectively). Everything is working OK, except automake is not generating Makefile.in.

There are some warnings generated, but I don't think they're significant. However, the last line makes me think it's generating something it shouldn't and stopping there. There is a md5.cc and md5.c file in the project.

xanadu:fsd wwilliam$ automake --add-missing
configure.ac:46: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
/var/tmp/autoconf/autoconf-15~193/SRC/autoconf/lib/autoconf/specific.m4:421: AC_USE_SYSTEM_EXTENSIONS is expanded from...
/var/tmp/autoconf/autoconf-15~193/SRC/autoconf/lib/autoconf/functions.m4:1677: AC_FUNC_STRNLEN is expanded from...
configure.ac:46: the top level
configure.ac:46: warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
configure.ac:46: warning: AC_COMPILE_IFELSE was called before AC_GNU_SOURCE
/var/tmp/autoconf/autoconf-15~193/SRC/autoconf/lib/autoconf/specific.m4:340: AC_GNU_SOURCE is expanded from...
configure.ac:46: warning: AC_RUN_IFELSE was called before AC_GNU_SOURCE
configure.ac:46: warning: AC_COMPILE_IFELSE was called before AC_AIX
/var/tmp/autoconf/autoconf-15~193/SRC/autoconf/lib/autoconf/specific.m4:455: AC_AIX is expanded from...
configure.ac:46: warning: AC_RUN_IFELSE was called before AC_AIX
configure.ac:46: warning: AC_COMPILE_IFELSE was called before AC_MINIX
/var/tmp/autoconf/autoconf-15~193/SRC/autoconf/lib/autoconf/specific.m4:474: AC_MINIX is expanded from...
configure.ac:46: warning: AC_RUN_IFELSE was called before AC_MINIX
Makefile.am: object `md5.$(OBJEXT)' created by `md5.cc' and `md5.c'

Relevant contents of configure.ac:

AC_INIT(testapp, 1.1, user@blah.com)
AM_INIT_AUTOMAKE(testapp,1.1)
AC_OUTPUT(Makefile)

Contents of Makefile.am:

AUTOMAKE_OPTIONS = foreign

CFLAGS=-O2
bin_PROGRAMS = testapp
testapp_SOURCES = interface.cc interface.hh keymgr.cc keymgr.hh main.cc manage.cc manage.hh md5.c md5.cc md5.h mm.cc mm.hh mysqldb.cc mysqldb.h testapp.cc testapp.h

I've been googling the issue but haven't found anything helpful.

Commands run were:

autoscan
mv configure.scan configure.ac
(edit configure.ac)
autoconf
(edit Makefile.am)
aclocal
automake --add-missing

Anyone seen anything like this before or know perhaps how I could turn on some additional debugging to troubleshoot the problem?

wadesworld
  • 13,535
  • 14
  • 60
  • 93
  • 3
    OT: You are using an outdated way of calling `AM_INIT_AUTOMAKE`. The modern usage is: `AM_INIT_AUTOMAKE([1.11])`. If you're using options (and not setting the options in `Makefile.am`, call it like this: `AM_INIT_AUTOMAKE([1.11 foreign -Wall -Werror])`. – Jack Kelly Mar 22 '11 at 11:55

3 Answers3

7
Makefile.am: object `md5.$(OBJEXT)' created by `md5.cc' and `md5.c'

is an error message that causes Automake to abort. These two files would have to be compiled to md5.o, so that is a problem.

Can you rename one of these two files?

adl
  • 15,627
  • 6
  • 51
  • 65
  • 1
    Alternative: if they belong to different programs, setting target-specific `CFLAGS` will cause `automake` to generate rules for `foo-md5.$(OBJEXT)` and `bar-m5.$(OBJEXT)`. – Jack Kelly Mar 22 '11 at 11:54
  • I think this is indeed the answer. Looking more closely at the program, I don't think the md5.cc file was actually required and could have been removed from the directory. However, I ended up punting and using CMake as my build system instead. Thanks for the help. – wadesworld Mar 22 '11 at 18:36
1

It complains on line 46, which you do not provide to your question.
Anyhow, to fix this issue you have to add AC_USE_SYSTEM_EXTENSIONS in your configure.ac.

example:

AC_INIT(testapp, 1.1, user@blah.com)
AM_INIT_AUTOMAKE(testapp,1.1)
AC_OUTPUT(Makefile)
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_C
...
zakkak
  • 1,861
  • 1
  • 19
  • 26
1

I have one program that I configure with automake. That program has a script to do the setup, which consists of:

aclocal -I config &&
libtoolize --automake &&
autoheader &&
automake --foreign --add-missing &&
autoconf

The difference, as I see it, is that in this the autoconf step is last, not in the middle.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • 3
    The order between `autoconf` and `automake` does not matter, but you should really be calling `libtoolize` before `aclocal`. You can replace all that script with `autoreconf -vfi` in order to get the correct order. Just make sure you use `AM_INIT_AUTOMAKE([foreign])` in `configure.ac`, and `ACLOCAL_AMFLAGS = -I config` in `Makefile.am`. – adl Mar 22 '11 at 10:13