Extremely simple autotools project help needed
Hi
I have the following directory structure:
project
|--------src
|----editor
|-----editor.h
editor.c
|----host
All I want is to create a configure.in and Makefile.am in the /project directory that will enable autotools functionality in the compilation of "editor.c" in the subdirectory tow levels down from the root project directory.
Here is my configure.in:
AC_INIT(editor.c)
AM_INIT_AUTOMAKE(editor,1.0)
AC_PROG_CC
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(stdlib.h)
AC_OUTPUT(Makefile)
and my Makefile.am:
bin_PROGRAMS = editor
editor_SUBDIRS = . src/editor
editor_SOURCES = editor.c editor.h
editor_LDFLAGS = allegro-config --libs
editor_CLFAGS = allegro-config --cflags
(note that I explicitly specify subdirectories as including src/editor - I have also tried ./src/editor)
but the eventual configure script cannot find the editor.c file.
./configure returns
[/home/rylan/project] ./configure
configure: error: cannot find sources (editor.c) in . or ..
Which is correct, of course - how do I then get configure to find editor.c NOT in the current directory, but in a subdirectory of where configure is executing...?
Any good links for using the autotools? I've got the autotools book by Gary Vaughan but I'm finding it extremely hard going to adapt to what I need.
Thanks!
|