15

I am new in autotools, and following this tutorial. but I could not solve this errors,

   $ automake
   configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
   ..
   Makefile.am: error: required file './depcomp' not found
   ..
   /usr/share/automake-1.12/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
  ..
  /usr/share/automake-1.12/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
  ..

my configure.ac file is

   # -*- Autoconf -*-
   # Process this file with autoconf to produce a configure script.

   AC_PREREQ([2.69])
   AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
   AM_INIT_AUTOMAKE(hello,1.0)
   AC_CONFIG_SRCDIR([config.h.in])
   AM_CONFIG_HEADERS(config.h)

   # Checks for programs.
   AC_PROG_CC

   # Checks for libraries.

   # Checks for header files.
   AC_CHECK_HEADERS([sys/time.h])

   # Checks for typedefs, structures, and compiler characteristics.

   # Checks for library functions.
   AC_CHECK_FUNCS([gettimeofday])

   AC_CONFIG_FILES([Makefile])
   AC_OUTPUT

I checked for solution on Internet, my configure.ac looks fine, don't know what is wrong with it.

halfer
  • 19,824
  • 17
  • 99
  • 186
arslan
  • 2,034
  • 7
  • 34
  • 61

4 Answers4

30

Where did you copy&paste your configure.ac from? Whatever that site is, you should remove it from your bookmarks!

You are mixing the new AC_INIT way to indicate the package version, with the old AM_INIT_AUTOMAKE way to do the same thing. Don't do both. (Old and new refer to a switch that occurred 10 years ago.) Starting with Automake 1.13 the old way to call AM_INIT_AUTOMAKE with two arguments is no-longuer supported.

In your case, removing the AM_INIT_AUTOMAKE arguments, and correctly setting the AC_INIT arguement to reflect the name and version of your project should be enough.

See the automake manual for an up-to-date example of very simple configure.ac to start with.

Instead of calling automake yourself, just use autoreconf -vfi so that it runs all the relevant tools in the right order, and installs the missing files.

adl
  • 15,627
  • 6
  • 51
  • 65
12

You have to fix it line by line.

First, your Makefile.am required depcomp. So, you have to copy it to your folder (for this step you can run automake --add-missing so as to add missing files automatically):

cp -a /usr/share/automake-X.XX/depcomp .

Second, you have to run aclocal prior to automake:

$ aclocal

Finally, you can run automake:

$ automake
$ autoconf
Julien Lopez
  • 1,794
  • 5
  • 18
  • 24
Narongsak Mala
  • 333
  • 2
  • 9
2

Try

autoreconf -i

autoreconf will bootstrap a project into a distributable state by adding missing files that are recommended or required.

1

In my case, updating libtool from 2.2.6 to 2.4.6. ps: I use the 1.15 version of automake. Run libtoolize before running aclocal and autoheader.

user3113626
  • 649
  • 8
  • 17