Building a library using autotools from cmake

I think that you’d be better off using the ExternalProject feature of cmake. I guess you have your project and have libantrl in a sub directory? project +- libantlr +- mysrc —- etc —- If that’s the case, you can do something like this in the top level CMakeLists.txt: cmake_minimum_required(VERSION 2.8) project(test) include(ExternalProject) ExternalProject_Add(libantlr SOURCE_DIR … Read more

installed libtool but libtoolize not found

You typically need to use glibtool and glibtoolize, since libtool already exists on OS X as a binary tool for creating Mach-O dynamic libraries. So, that’s how MacPorts installs it, using a program name transform, though the port itself is still named ‘libtool’. Some autogen.sh scripts (or their equivalent) will honor the LIBTOOL / LIBTOOLIZE … Read more

Getting started with autotools

Alexandre Duret-Lutz‘s tutorial is my resource of choice. There are also: Autotools: a practitioner’s guide to Autoconf, Automake and Libtool Autotools Mythbuster To me, the autobook is not up to date anymore and more difficult to read. However it still contains interesting chapters like Writing Portable Bourne Shell. Also, consider learning about non-recursive automake which … Read more

What’s the point of aclocal?

See Alexandre Duret Lutz’s Autotools tutorial, a must read. It contains diagrams explaining how the different files of an autotools project interact with each other and by which tool they are used: configure, config.h, config.status, aclocal.m4 etc EDIT: John Calcote also explains the purpose of aclocal and aclocal.m4 in the first chapter of his book … Read more

Which files generated by Autotools should I keep in version control repository?

You should not keep any files under version control that are not hand-edited. That means any generated file should be ignored by the version control system. I basically put only the following under version control: configure.ac Makefile.am the documentation files such as AUTHORS, NEWS etc. Makefile.am in subdirectories To address the point of having a … Read more

Why use build tools like Autotools when we can just write our own makefiles?

You are talking about two separate but intertwined things here: Autotools GNU coding standards Within Autotools, you have several projects: Autoconf Automake Libtool Let’s look at each one individually. Autoconf Autoconf easily scans an existing tree to find its dependencies and create a configure script that will run under almost any kind of shell. The … Read more