Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

autoconf and automake: hello world: strange message
Hello,

I have just started to use the GNU autotools (autoconf, automake, and libtoo
l).
I want to point out the following example, where, because of lack of a # at 
the
beginning of the Makefile.am, I get a warning message. Oddly enough, placing
the # at the beginning of Makefile.am fixes it. Could someone please explain
this idiosyncrasy to me?

Thanks!

Neil

(example follows)

$ ls$ rpm -q autoconf automake # Fedora Core 2 Linux
autoconf-2.59-3
automake-1.8.3-1

configure.ac  hello.c  Makefile.am
$ cat configure.ac
dnl Process this file with autoconf to produce a configure script.
AC_INIT([Hello], [0.1], [nzanella@users.sf.net], [hello])
AC_CONFIG_SRCDIR([hello.c])
AM_INIT_AUTOMAKE

AC_OUTPUT
$ cat Makefile.am

bin_PROGRAMS = hello
bin_SOURCES = hello.c
$ cat hello.c
#include <stdio.h>

int main(void) {
puts("Hello, World!");
}
$ autoconf
configure.ac:4: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
$

Report this thread to moderator Post Follow-up to this message
Old Post
Neil Zanella
10-30-04 01:56 AM


Re: autoconf and automake: hello world: strange message
nzanella@cs.mun.ca (Neil Zanella) writes:

> Hello,
>
> I have just started to use the GNU autotools (autoconf, automake,
> and libtool).  I want to point out the following example, where,
> because of lack of a # at the beginning of the Makefile.am, I get a
> warning message. Oddly enough, placing the # at the beginning of
> Makefile.am fixes it. Could someone please explain this idiosyncrasy
> to me?

You need to run aclocal before autoconf.

--
Måns Rullgård
mru@inprovide.com

Report this thread to moderator Post Follow-up to this message
Old Post
Måns Rullgård
10-30-04 01:56 AM


Re: autoconf and automake: hello world: strange message
Neil Zanella wrote:

> I have just started to use the GNU autotools (autoconf, automake, and libt
ool).
> I want to point out the following example, where, because of lack of a # a
t the
> beginning of the Makefile.am, I get a warning message. Oddly enough, placi
ng
> the # at the beginning of Makefile.am fixes it. Could someone please expla
in
> this idiosyncrasy to me?

A more complete configure.ac:

dnl Process this file with autoconf to produce a configure script.
AC_INIT([Hello], [0.1], [nzanella@users.sf.net], [hello])
AC_CONFIG_SRCDIR([hello.c])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT


A fixed Makefile.am:

bin_PROGRAMS = hello
hello_SOURCES = hello.c


Full procedure to create a package:

shell$ touch NEWS README AUTHORS ChangeLog
shell$ make maintainer-clean >/dev/null 2>/dev/null
shell$ aclocal
shell$ autoheader     # only when using a config.a, not in this case.
shell$ automake -a
shell$ autoconf
shell$ ./configure
shell$ make distcheck


Heiko

Report this thread to moderator Post Follow-up to this message
Old Post
Heiko
10-30-04 01:56 AM


Re: autoconf and automake: hello world: strange message
Heiko <heiko.noordhof_A_xs4all.nl> wrote in message

> Full procedure to create a package:
>
> shell$ touch NEWS README AUTHORS ChangeLog
> shell$ make maintainer-clean >/dev/null 2>/dev/null
> shell$ aclocal
> shell$ autoheader     # only when using a config.a, not in this case.
> shell$ automake -a
> shell$ autoconf
> shell$ ./configure
> shell$ make distcheck

Thanks Heiko,

I wonder whether it makes a difference though, whether I run the
commands as you specified above, or whether I run autconf just
after aclocal instead of just after automake. Does it make any
difference? I've read some sources which seem to describe the
same procedure you just described but with autoconf run before
autoheader.

Also, I see you run "make maintainer-clean". What is the purpose
of this call and doesn't it require the AC_MAINTAINER_MODE macro
or does that macro serve some other special purpose?

Thanks,

Neil

Report this thread to moderator Post Follow-up to this message
Old Post
Neil Zanella
10-30-04 08:56 AM


Re: autoconf and automake: hello world: strange message
Neil Zanella wrote:

> Heiko <heiko.noordhof_A_xs4all.nl> wrote in message
> 

> I wonder whether it makes a difference though, whether I run the
> commands as you specified above, or whether I run autconf just
> after aclocal instead of just after automake. Does it make any
> difference? I've read some sources which seem to describe the
> same procedure you just described but with autoconf run before
> autoheader.

Honestly, I don't know really.  But I assume it doesn't make much
difference, as long as it works. For some things the order is important,
for other things it doesn't make much difference.  I've put this in a
small script about two years ago, and it works for me.

> Also, I see you run "make maintainer-clean". What is the purpose
> of this call and doesn't it require the AC_MAINTAINER_MODE macro
> or does that macro serve some other special purpose?

I've put that a the start of my tiny "reconf.sh" script to make sure
everything that's generated by the autotools. So it actually is an
answer to the question you asked in the other thread: 'autotools newbie:
junk files not deleted by "make distclean"'...

I don't know (yet) what AC_MAINTAINER_MODE is or does.  About two years
I was sort of digging into the autotools, and read up a bit about the
newer version recently.  But I'm by no means an expert on this, but I
hoped to get you a little further by telling what I do know.

Heiko

Report this thread to moderator Post Follow-up to this message
Old Post
Heiko
10-30-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.