I'd not recommend autoproject.
It still uses the old autoconf format, and if you really want to use autoconf-connfigure scripts for a real project, you'll need to know about autoconf/automake anyways. So I think it's better to learn about autoconf/automake from scratch.
Read
this thread to get started with the new version of autoconf/automake, and try to figure out how it works. The "recipe" I posted there assumes autoconf v2.57 or higher and automake version 1.7 or higher. Make sure you've got those installed.
When you followed that "recipe" with success, you can do the following to make the package to have a "src" directory:
- Make a "src" directory:
- Move the files "hello.c" and "Makefile.am" to the "src" directory:
Code:
shell$ mv hello.c Makefile.am src
- Make a new "Makefile.am" in the top-level directory that just has one line to tell automake to process the "src" directory:
- Edit "configure.ac" to read:
Code:
AC_INIT([Hello], [0.1], [you@example.com], [hello])
AC_CONFIG_SRCDIR([src/hello.c])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
- Rerun the autotools:
Code:
shell$ make maintainer-clean
shell$ aclocal ; automake -a ; autoconf
To have automake process more .c source files, just edit "src/Makefile.am" and mention the other source files in the "hello_SOURCES ..." line. Like this:
Code:
bin_PROGRAMS = hello
hello_SOURCES = hello.c othersource.c yetanother.c