Questions tagged [automake]

Automake is a tool provided by GNU for the purpose of automating the generation of portable, configurable Makefiles.

Automake is a tool for automatically generating Makefile.ins from files called Makefile.am. Each Makefile.am is basically a series of make variable definitions, with rules being thrown in occasionally. The generated Makefile.ins are compliant with the GNU Makefile standards.

The GNU Makefile Standards Document (see Makefile Conventions) is long, complicated, and subject to change. The goal of Automake is to remove the burden of Makefile maintenance from the back of the individual GNU maintainer (and put it on the back of the Automake maintainers).

The typical Automake input file is simply a series of variable definitions. Each such file is processed to create a Makefile.in. There should generally be one Makefile.am per directory of a project.

Automake does constrain a project in certain ways; for instance, it assumes that the project uses Autoconf (see Introduction), and enforces certain restrictions on the configure.ac contents.

For more details, take a look into automake manual

1092 questions
5
votes
4 answers

Errors linking libresolv when building PHP 5.2.10 from source on OS X

To begin with, I would normally opt to use a pre-compiled binary of PHP, but am required to build from source for a specific business need. (I'm not the type that compiles open-source apps just for kicks.) I'm building on OS X 10.6 and am running…
Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
5
votes
1 answer

Does autotools Makefile automatically consider included header files as dependencies?

I have an autotools-managed project (sscce tar.gz package here) with this structure: ./main.c ./foo.c ./foo/foo.h My configure.ac is: AC_INIT([foo], [1.0], [foo@bar.ba]) AM_INIT_AUTOMAKE([foreign -Wall…
brandizzi
  • 26,083
  • 8
  • 103
  • 158
5
votes
1 answer

Simple "hello world" configure.ac fails to run

I'm following the documentation with an up to date automake (v1.12) but building still fails. Here's my configure.ac: AC_PREREQ([2.69]) AC_INIT([helloworld], [0.1], [bugs@hw.com]) AC_INIT_AUTOMAKE([1.12 foreign…
wting
  • 900
  • 2
  • 13
  • 27
4
votes
4 answers

How do you compile without linking in Automake?

I am new to Automake and I am attempting to compile without linking. My goal is to generate a simple Makefile as shown below using Automake. CFLAG = -Wall build: Thread.o Thread.o: Thread.cc Thread.h g++ $(CFLAG) -c Thread.cc clean: rm…
MDH
4
votes
4 answers

Refactoring build system to use Autotools

Over the past couple of days I have been reading into using autotools to build my project instead of the Makefiles I have pieced together over the past couple of months. Unfortunately I have not found an example that gave me enough insight towards…
John Bellone
  • 1,351
  • 1
  • 16
  • 29
4
votes
4 answers

How to set default CPPFLAGS on autotools project

I need to set "-Wall -Werror" as CPPFLAGS for all the source files in my project. Is there a way to do that in autotools? I have tried the following in configure.ac: AC_SUBST([AM_CPPFLAGS], [-Wall -Wextra]) It doesn't seem to work. EDIT: I found an…
chotchki
  • 4,258
  • 5
  • 34
  • 55
4
votes
0 answers

Are there any automake m4 macros for flymake mode?

EmacsWiki (in http://www.emacswiki.org/emacs/FlyMake) has a recommendation to create a flymake.mk file and include it in every Makefile if you are using Automake, but this doesn't seem very... Automake-y and I assume that having a standard m4 macro…
BD at Rivenhill
  • 12,395
  • 10
  • 46
  • 49
4
votes
1 answer

Autoconf/Automake conditionals and dist rules

I recently started using autoconf and automake for a project I'm working on. The project's documentation is written in LaTeX. Since I don't want to have LaTeX as a dependency I want to check the presence of the pdflatex binary with autoconf and then…
ph0t0nix
  • 535
  • 14
  • 25
4
votes
1 answer

selectively enabling a test program if Python is available - automake

I've got a program that's written in C, built using automake/autoconf, and has two test suites. One is a unit test suite also written in C; the other is end-to-end and is (currently) written in Python. I want "make check" to run the unit tests…
zwol
  • 135,547
  • 38
  • 252
  • 361
4
votes
3 answers

How do I link a shared library with --as-needed with automake?

How do I link a shared library with --as-needed using Automake? When I tried adding the flag to LDFLAGS, I saw libtool called as so: /bin/bash ../../libtool --mode=link ... -Wl,--as-needed ... dependencies Which results in a call to GCC like…
Dietrich Epp
  • 205,541
  • 37
  • 345
  • 415
4
votes
1 answer

How to get automake, libtool, and rpmbuild to work together

I'm trying to create an RPM of my package, which is built using automake and libtool, and I've encountered a problem: rpmbuild aborts upon discovering that the installed programs of the package contain the pathname of the installation directory for…
Steve Emmerson
  • 7,702
  • 5
  • 33
  • 59
4
votes
1 answer

'make distcheck' target and the info/dir file

I've added a new Info manual to my project, and added the requisite Makefile.am incantations: info_TEXINFOS = manual.texi Now when I run make distcheck, I get an error when verifying that make uninstall successfully uninstalls all files, because…
Peter T.B. Brett
  • 1,250
  • 11
  • 20
4
votes
1 answer

Custom command to generate object(.o) from binary file using autoconf

We have a project (c++) and it needs to include a binary file into shared library. This is done on windows by referencing the binary file from a resource file. On Linux it can be achieved by using objcopy as shown here The question is how can this…
Satpal
  • 309
  • 2
  • 8
4
votes
1 answer

Locating $pkgdatadir defined by autotools from a script

My application uses autotools to install data files that are needed at runtime in $pkgdatadir. Part of the application is written in C, and the path to the data directory is set by the following statement in Makefile.am: AM_CPPFLAGS =…
Leo
  • 2,052
  • 5
  • 17
  • 24
4
votes
1 answer

autoreconf fails with "possibly undefined macro: AM_PATH_GLIB_2_0"

While modifying this source code I got this error from autoreconf: $ autoreconf configure.ac:240: warning: macro 'AM_PATH_GLIB_2_0' not found in library configure.ac:246: warning: macro 'AM_PATH_GTK_2_0' not found in library configure.ac:240: error:…
Dean Schulze
  • 9,633
  • 24
  • 100
  • 165