Mailinglist Archive: opensuse-programming (42 mails)

< Previous Next >
Why I find autotools confusing.
  • From: "Steven T. Hatton" <hattons@xxxxxxxxxxxxxxxxxx>
  • Date: Fri, 28 May 2004 09:12:02 -0400
  • Message-id: <200405280912.11907.hattons@xxxxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A while back I told people that I find using autotools to be confusing. I've
been looking at the documentation of the latest versions and have concluded
that the reason I don't understand the documentation is because the documents
are inconsistent, at least when used as references. Compare the following
two excerpts:

This is from autoconf.info:

To encourage consistency, here is a suggested order for calling the
Autoconf macros. Generally speaking, the things near the end of this
list are those that could depend on things earlier in it. For example,
library functions could be affected by types and libraries.

Autoconf requirements
`AC_INIT(PACKAGE, VERSION, BUG-REPORT-ADDRESS)'
information on the package
checks for programs
checks for libraries
checks for header files
checks for types
checks for structures
checks for compiler characteristics
checks for library functions
checks for system services
`AC_CONFIG_FILES([FILE...])'
`AC_OUTPUT'


This is from automake.info:

The first step is to update your `configure.ac' to include the
commands that `automake' needs. The way to do this is to add an
`AM_INIT_AUTOMAKE' call just after `AC_INIT':

AC_INIT(zardoz, 1.0)
AM_INIT_AUTOMAKE


This is from a working autoconf.ac

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(src/main.cpp)
AM_INIT_AUTOMAKE(rematrix, 1.0, hattons@xxxxxxxxxxxxxxxxxx)
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])


# Checks for programs.
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for library functions.
AC_OUTPUT([Makefile src/Makefile])


The examples found in http://sources.redhat.com/autobook/ did not work (were
out of date?) when I tried to use the book to get started. I'm now to the
point where I can produce a basic gnu gnits build setup for simple programs,
but it's been trial and error (as well as some very helpful guidance from
people on this list).

Other than simply venting my frustrations, my purpose in posting this is to
ask others how they would approach learning how to use these tools. Perhaps
the answer is still the Goat Book. It seems a shame to see the book has not
been maintained.

- --
Regards,
Steven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAtzqqwX61+IL0QsMRAhxYAJ4uX7zoByNhGcDZqD555H4JbedUhgCfVU5V
ZzED9r4iHrUSkM/4mJA2pFA=
=1pvP
-----END PGP SIGNATURE-----

< Previous Next >
This Thread
  • No further messages