Code Comments
Programming Forum and web based access to our favorite programming groups.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.
$
Post Follow-up to this messagenzanella@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
Post Follow-up to this messageNeil 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
Post Follow-up to this messageHeiko <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
Post Follow-up to this messageNeil 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.