Simple "hello world" configure.ac fails to run
Asked Answered
C

1

5

I'm following the documentation with an up to date automake (v1.12) but building still fails.

Here's my configure.ac:

AC_PREREQ([2.69])
AC_INIT([helloworld], [0.1], [[email protected]])
AC_INIT_AUTOMAKE([1.12 foreign no-define])
AC_CONFIG_SRCDIR([src/hello.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])

# Checks for programs.
AC_PROG_CC([gcc cc])

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_OUTPUT(src/Makefile)

Execution:

$ autoreconf
configure.ac:3: error: possibly undefined macro: AC_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

$ automake
configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal)
configure.ac:5: error: required file 'config.h.in' 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:   The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.12/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.12/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.12/am/depend2.am:   The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.12/am/depend2.am:     AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.12/am/depend2.am:     AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.12/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again
Cowie answered 2/7, 2012 at 1:45 Comment(0)
E
10

Line 3 should read

AM_INIT_AUTOMAKE([1.12 foreign no-define])

note that it starts with AM_ not AC_.

In general all the automake macros start with AM_.

Easting answered 2/7, 2012 at 2:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.