A gentle introduction to Autotools The good, the bad and the ugly Kees-Jan Dijkzeul October 28 th, 2010.

Slides:



Advertisements
Similar presentations
Software change management
Advertisements

Configuration management
Advanced Java Course Exception Handling. Throwables Class Throwable has two subclasses: –Error So bad that you never even think about trying to catch.
SM3121 Software Technology Mark Green School of Creative Media.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Deployment and Configuration Management Solution
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
CCA Port, Component & Application Build Skeleton Templates “A new script toolkit for generating CCA build skeletons” Torsten Wilde and James Kohl Oak Ridge.
Trilinos 101: Getting Started with Trilinos November 7, :30-9:30 a.m. Mike Heroux Jim Willenbring.
Introduction Purpose This course describes the process of installing the KPIT GNU toolchain on your PC. Objective Learn how easy it is to get information.
CSnake C++ build automation based on CMake and Python Maarten Nieber, 2009.
Configuration Management (CM)
Developing C/C++ applications with the Eclipse CDT David Gallardo.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Version Control.
1 Programming Tools Slides by: Noppadon Kamolvilassatian Source: Code Complete by Steve McConnell, Chapter 20.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring Mike Phenow.
M4 Macro-processing Language Geoffrey Sewell. What will be shown? What’s a macro processor? History of M4 Uses Autotools Syntax Hopefully, you all learn.
EGEE is a project funded by the European Union under contract IST Tools survey status, first experiences with the prototype Diana Bosio EGEE.
Good Morning! f Tuesday, 28 January FPCLTF and CLHEP Walter E. Brown f Fermi National Accelerator Laboratory Z O O M.
Getting Started with Trilinos October 14, :30-10:30 a.m. Jim Willenbring.
Milan, 15 June 2001WP1 Meeting - F. Donno1 GRID Packaging and Code Management for WP1 F. Donno INFN - Pisa.
INTRODUCTION TO AUTOCONF AND AUTOMAKE. GNU BUILD SYSTEM 1)GNU AUTOCONF 2)GNU AUTOMAKE 3)GNU LIBTOOL 4)GNU GETTEXT.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Wed Mar Michael Imamura / The GNU Autotools Your very own./configure.
“Port Monitor”: progress & open questions Torsten Wilde and James Kohl Oak Ridge National Laboratory CCA Forum Quarterly Meeting Santa Fe, NM ~ October.
CLHEP Infrastructure Improvements CHEP 2004 Lynn Garren, FNAL and Andreas Pfeiffer, CERN.
Patrick Gartung LArSoft Usability Meeting 22 June 2016 Build system explorations: Spack.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
Fixing autotools-related build issues
Software development tools
1 Policy Based Systems Management with Puppet Sean Dague
Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools.
MaSH – Miniature Shell ● Brief introduction to shell. – What is a shell? ● A program that reads inputs from the keyboard and executes the commands. ● Basic.
Autoconf, Automake, and Libtool Tom Tromey. Copyright ● Copyright 2006 Tom Tromey ● Parts Copyright 2006 Alexandre Duret-Lutz ●
Best Way to Learn Selenium Course in Online. Looking to learn best testing tool? If your preference is selenium testing then your choice is perfect. The.
What is F/LOSS? By Scot Henderson.
Backing Up Your System With rsnapshot
Stress Free Deployments with Octopus Deploy
Development Environment
Software Package development and management
Installing Software Part 3
The 500 builds of 300 applications in the HeLmod repository will at least get you started on a full suite of scientific applications Aaron Kitzmiller,
Open Source Software Development Environment
Introduction to Eclipse
MDSplus Quality Improvement Project T. Fredian, J. Stillerman, G
BIT116: Scripting Lecture 06
Implementation of Embedded OS
CSE 374 Programming Concepts & Tools
Delphi or C++ Builder, with Subversion and Jenkins
Pipeline Execution Environment
Microprocessor and Assembly Language
Computer System Laboratory
A451 Theory – 7 Programming 7A, B - Algorithms.
An Early Look at MySQL™ on Novell NetWare®
How to Upgrade Your Geant4 Release
RECAP ( ) Jörg Domaschka
Due Next Monday Assignment 1 Start early
Overview Unit testing Building Version control.
Chapter 7 –Implementation Issues
An introduction to the Linux environment v
CSE 303 Concepts and Tools for Software Development
Chapter 1: Programming Basics, Python History and Program Components
Review of Previous Lesson
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

A gentle introduction to Autotools The good, the bad and the ugly Kees-Jan Dijkzeul October 28 th, 2010

© Sioux Embedded Systems 2010 | 2 Contents  Intro  Me  You  Autotools  Autotool goals  The tools  Autoconf  Automake  LibTool  Conclusions

© Sioux Embedded Systems 2010 | 3 Who am I, and why am I here  Kees-Jan Dijkzeul  Software designer at Sioux Embedded Systems  Co-chair of the Linux SIG  Using Linux since 1994  Writing embedded software since 1998

© Sioux Embedded Systems 2010 | 4 Who am I, and why am I here (2)  Mostly writing Makefiles by hand  But for my latest pet project, I needed something more substantial  I randomly picked autotools

© Sioux Embedded Systems 2010 | 5 Mandatory commercial slide  Sioux Embedded Systems  Domain: Embedded Systems & Technical Automation  Machine Control, Medical Systems, Automotive, Consumer Electronics  Software & electronics development  Development Centre Projects: fixed price and risk reward  Partnering in product development  Platform product: Machine2World ® : remote monitoring & control  BinC – Be in Control: integrated security solutions for businesses and consumers  Consulting and assessments: software process, system architecture

© Sioux Embedded Systems 2010 | 6 Mandatory commercial slide

© Sioux Embedded Systems 2010 | 7 Who are you and why are you here?  You've heard of the autotools, and know what it is supposed to do  You've (accidentally) opened a configure.am or a Makefile.ac or whatever  Possibly Autotools blew up in your face

© Sioux Embedded Systems 2010 | 8 What are autotools? “The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source-code packages portable to many Unix-like systems” – Wikipedia

© Sioux Embedded Systems 2010 | 9 Autotools opinions “The developer has to use (and learn) syntaxes for the combo of automake + autoconf + libtool + make + sh + perl + m4” “So […] there is the opinion that dealing with the build system is hard, almost higher magic. This is a myth. A myth created by autotools.” Alexander Neundorf – Why the KDE project switched to CMake

© Sioux Embedded Systems 2010 | 10 There's praise also... “[…] that autoconf and automake permit substantial end-user adjustment. [...] Most alternative build systems throw all of that away and provide very little alternative” “Autoconf also embodies a lot of 'ancient wisdom' about detection of features available on all sorts of systems. I haven't found *any* other build systems that come close.”

© Sioux Embedded Systems 2010 | 11 Moving from Makefiles to autotools  Moving from Makefiles to autotools is like learning a new, powerful, language  You can do in a single line what used to take pages of coding  If you don't understand what the system is trying to do for you under the hood, you can shoot yourself in the foot badly  If you don't like what the system is doing for you, you're using the wrong tool

© Sioux Embedded Systems 2010 | 12 So what is autotools trying to do? User SystemDeveloper System Source code./configure make sudo make install

© Sioux Embedded Systems 2010 | 13 So what is autotools trying to do?  Portability is key  Correctly detect features of many target platforms  Enable the software to adapt to the platform using #ifdefs  Provide a common abstraction for shared libraries  Alleviate the drudgery of writing Makefiles

© Sioux Embedded Systems 2010 | 14 Contents  Intro  Me  You  Autotools  Autotool goals  The tools  Autoconf  Automake  LibTool  Conclusions

© Sioux Embedded Systems 2010 | 15 Autoconf  Goal: Generate a configure script that  Detects the system features required by your program  Allows the user to configure your program  Writing configure scripts by hand is error prone and no fun at all

© Sioux Embedded Systems 2010 | 16 Autoconf config.status configure autoconf Makefile.in config.h.in autoheaderautoheader Makefile config.h config.log Makefile.inMakefile Pure shell script *.in files contain placeholders Placeholders replaced with values configure.ac Shell script with M4 macros

© Sioux Embedded Systems 2010 | 17 Autoconf  There's already a lot of tools involved  And they have to be called in the correct order! Only edit the green files! The rest is generated! autoreconf

© Sioux Embedded Systems 2010 | 18 Autoconf Demo

© Sioux Embedded Systems 2010 | 19 Autoconf – wrap up  Autoconf helps you write a configure script to configure your software  The Makefile.in consists of mostly boilerplate  We shouldn't have to write that stuff

© Sioux Embedded Systems 2010 | 20 Contents  Intro  Me  You  Autotools  Autotool goals  The tools  Autoconf  Automake  LibTool  Conclusions

© Sioux Embedded Systems 2010 | 21 Automake config.status configureconfigure.ac Makefile.in config.h.in autoconf autoheader Makefile config.h config.log Makefile.inMakefile

© Sioux Embedded Systems 2010 | 22 Automake config.status configureconfigure.ac config.h.in autoconf autoheader config.h config.log Makefile.in Makefile automake Makefile.am Makefile++ pure Makefile Makefile + placeholders

© Sioux Embedded Systems 2010 | 23 Automake Demo

© Sioux Embedded Systems 2010 | 24 Automake – wrap up  Automake generates Makefiles  For building your project  For testing your project  For creating tarballs for distributing your project  So how do I portably build shared libraries?

© Sioux Embedded Systems 2010 | 25 Contents  Intro  Me  You  Autotools  Autotool goals  The tools  Autoconf  Automake  LibTool  Conclusions

© Sioux Embedded Systems 2010 | 26 LibTool config.status configureconfigure.ac Makefile.in config.h.in autoconf autoheader Makefile config.h config.log Makefile.in Makefile Makefile.am automake Makefile.am

© Sioux Embedded Systems 2010 | 27 LibTool config.status configure.ac Makefile.in config.h.in Makefile config.h Makefile.in Makefile Makefile.am automake Makefile.am ltmain.sh libtool Shell script, part of autotools Wraps compiler and linker

© Sioux Embedded Systems 2010 | 28 LibTool Demo

© Sioux Embedded Systems 2010 | 29 Let's jump to conclusions

| config.status configureconfigure.ac Makefile.amMakefile.in config.h.in Autoconf automake autoheader Makefile config.h config.log ltmain.sh Makefile.inMakefile.amMakefile libtool

© Sioux Embedded Systems 2010 | 31 Conclusions  I never realized so much work went into getting your software to run on someone else's machine.  I like the experience I'm providing for my users  I'm not so happy about the amount of effort on my part

© Sioux Embedded Systems 2010 | 32 Resources  Autotools: A practitioner's guide  on-line version on-line version  paper version paper version  Wikipedia Wikipedia  GNU coding standards GNU coding standards  Why the KDE project switched to CMAKE Why the KDE project switched to CMAKE  Did you call them Autocrap tools? Did you call them Autocrap tools?  Scroom, the pet project that started all this Scroom

© Sioux Embedded Systems 2010 | 33 Famous last words Don't fight the system autoreconf [-i] Only edit the green files! The rest is generated!

© Sioux Embedded Systems 2010 | 34 Questions?

© Sioux Embedded Systems Source of your development.

| User SystemDeveloper System config.status configureconfigure.ac Makefile.amMakefile.in config.h.in Autoconf automake autoheader Makefile config.h config.log config.site config.cache ltmain.sh Makefile.inMakefile.amMakefile libtool

© Sioux Embedded Systems 2010 | 37 config.cache  The configure script optionally caches the results of its tests  Convenient if you are debugging a lengthy configure script  Convenient when installing many packages with similar configuration

© Sioux Embedded Systems 2010 | 38 config.site  Before starting, the configure script reads a config.site file (if present)  May contain arguments to./configure  May contain test results  Be careful not to override user-specified values  test "$prefix" = NONE && prefix=/usr/share/local/gnu