LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-06-2005, 09:14 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
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!
 
Old 04-21-2006, 05:34 AM   #2
pietrom
LQ Newbie
 
Registered: Dec 2004
Location: Earth
Distribution: SuSE
Posts: 5

Rep: Reputation: 0
Hi Stefan,

I am facing a problem very similar to yours.
I have been able to make a project with this structure:

src1
subdir/src2

but I have not succeded with this one:

src1
subdir/src2
subdir/subdir2/src3

In the documentation I have not found a single example of this kind. There are examples that include libraries, but none about a simple project with source files distributed in a directory tree.
Can anybody give us a suggestion?
Thank you.

Last edited by pietrom; 04-21-2006 at 05:35 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New Project Idea needed Gracy Linux - Newbie 4 11-11-2005 04:42 AM
help needed with school project pyar Programming 9 02-03-2005 04:48 PM
help needed urgently for a project djadhav Linux - Networking 1 10-18-2004 12:44 PM
extremely urgent help needed - disk space h/w Linux - Newbie 3 10-08-2003 10:59 AM
New Debian project - Volunteers needed fancypiper Debian 3 09-25-2003 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration