SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
Don't Fear the Autotools!




Scott Garman
Portland Linux User Group
December 1, 2011
AC_INIT([Scott Garman], [1.0],
         [sgarman@zenlinux.com])

●   Embedded Linux SW Engineer at Intel
●   Working on the Yocto Project (yoctoproject.org)
●   I am not an Autotools fanboy; just a pragmatic user
●   I do not really know all that much about Autotools
●   It's just that knowing just enough about Autotools to be
    able to effectively work with it is a lot more than most
    people tend to know about it
●   This is a “gentle introduction” to hopefully inspire
    further study
What are “the Autotools?”
●   Cross-platform build system for compiled
    software (typically C/C++ applications)
●   Helps to encourage portability standards
    defined in the GNU Coding Standards (GCS)
    and Filesystem Hierarchy Standard (FHS)
●   The tools:
    ●   Autoconf
    ●   Automake
    ●   Libtool
From a User's Perspective

●   tar xvzf application-1.0.tar.gz
●   cd application-1.0/
●   ./configure
●   make
●   sudo make install
The Most Common Configure Error
●   Configure script fails and reports an error such
    as: “No package libfoo found”
●   This indicates that you need to install library foo
●   “But I already have a package named libfoo
    installed!”
●   The runtime library is installed from package
    libfoo, but to compile applications which use foo,
    you need to install the “development headers” -
    this package is generally named libfoo-dev or
    libfoo-devel
Troubleshooting Configure Errors
●   When configure is run, it generates a log file
    config.log, which contains:
    ●   Command line used to invoke configure
    ●   Platform information about your environment
    ●   Additional details about the tests configure ran
    ●   A line number from the configure script where
        config.status is generated and run
●   Submitting config.log with a bug report to the
    application maintainers gives them important
    information they need to fix the issue
config.status
●   Uses information from configure to perform
    substitutions in *.in template files to generate
    the output files:
                            configure      config.log



          config.h.in                      config.h

                           config.status

         Makefile.in                       Makefile
config.site
●   Running configure tests can take a while
●   If you're installing many apps from source, you'll be running a
    lot of the same tests over and over again
●   Things like the size of a long int are not going to change on
    your system
●   A config.site file can be created with seeded values for these
    tests, and will be used as a test result “cache”
●   Set an environment var CONFIG_SITE with the path to your
    config.site file to make use of it
●   Very handy when cross-compiling apps (since some tests
    compile small C programs, but those programs can't be run
    natively!)
Filesystem Hierarchy Standard (FHS)
●   Defines root filesystem layout guidelines and
    where various file types belong
●   For example: the difference between binaries in
    /sbin vs. /usr/sbin
●   Widespread adoption by GNU/Linux distros has
    made portability of build systems easier
●   Current version is 2.3 (from 2004); v3.0 is now
    available in draft form
●   http://www.pathname.com/fhs/
GNU Coding Standards (GCS)
●   How source build configuration should work
●   Defines standard Makefile targets (install, dist,
    check, installcheck, etc)
●   Defines standard directory variables (bindir,
    libexecdir, sysconfdir, etc)
●   Standard command-line options (to promote
    consistent behavior among GNU utilities)
●   Good advice for how to write portable C code
●   http://www.gnu.org/prep/standards/
From a Developer's Perspective
●   Autoconf:
       configure.ac     autoconf/autoreconf




                             configure        config.log



          config.h.in                         config.h

                           config.status

          Makefile.in                         Makefile
From a Developer's Perspective
●   Automake:
      configure.ac     autoconf/autoreconf




                            configure        config.log



         config.h.in                         config.h

                          config.status

         Makefile.in                         Makefile




                       automake/autoreconf   Makefile.am
Hello World Example


●   Let's take a look at how to take a trivial C
    program (GNU amhello) and enable basic
    Autotools support
Libtool
●   Differences in how shared libraries are built
    across Unix systems are especially challenging
    to deal with
●   Very specific and unique compiler options are
    often needed on different platforms
●   Differences in library naming conventions
●   Libtool abstracts these details into a wrapper
    script that is invoked in uniform fashion to build
    libraries
Libtool Utilities

●   libtool – generic example script
●   libtoolize – creates a custom version of the
    libtool script that works with your program
    (ltmain.sh); you then include this when
    distributing your sources
●   ltdl/ltdl.h – A standard way of loading shared
    libraries on-demand within your application (for
    when you want control over the process)
Why Use Autotools?
●   Attempting to address all of the subtle build failures that
    can occur between platforms yourself is an exercise in
    futility
●   Leverage the collective wisdom the project has attained,
    to result in portable shell scripts and makefiles which have
    minimal system requirements
●   Built-in support for following the GNU Coding Standards
    and FHS
●   Users and distro maintainers expect these features and
    already understand an Autotools-based build process
Resources
●   Autotools: A Practitioner's Guide to GNU Autoconf, Automake,
    and Libtool, by John Calcote. No Starch Press.
●   Autotools Tutorial by Alexandre Duret-Lutz:
    http://www.lrde.epita.fr/~adl/autotools.html
●   GNU Coding Standards: http://www.gnu.org/prep/standards/
●   Filesystem Hierarchy Standard:
    http://www.pathname.com/fhs/
●   Autoconf Macro Definitions:
    http://www.gnu.org/software/autoconf/manual/html_node/Auto
    conf-Macro-Index.html

Weitere ähnliche Inhalte

Was ist angesagt?

Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
Python_Session
Python_SessionPython_Session
Python_Sessionsiva ram
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentAcquia
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17siva ram
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kiteChristian Opitz
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangKohei Kimura
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI AppsTom Elliott
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Dronetdc-globalcode
 
Latex with git
Latex with gitLatex with git
Latex with gitsppmg
 
Builder and BuildKit
Builder and BuildKitBuilder and BuildKit
Builder and BuildKitMoby Project
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyNikhil Mungel
 
나도 할 수 있다 오픈소스
나도 할 수 있다 오픈소스나도 할 수 있다 오픈소스
나도 할 수 있다 오픈소스효준 강
 
wxPython and wxFormBuilder
wxPython and wxFormBuilderwxPython and wxFormBuilder
wxPython and wxFormBuilderJenny Liang
 
Web 2 .Zero Programming Providers
Web 2 .Zero Programming ProvidersWeb 2 .Zero Programming Providers
Web 2 .Zero Programming Providersebooker97
 
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016Eric Ahn
 

Was ist angesagt? (20)

Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Python_Session
Python_SessionPython_Session
Python_Session
 
How to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of DevelopmentHow to Use the Command Line to Increase Speed of Development
How to Use the Command Line to Increase Speed of Development
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
 
Development and deployment with composer and kite
Development and deployment with composer and kiteDevelopment and deployment with composer and kite
Development and deployment with composer and kite
 
Stupid Buildout Tricks
Stupid Buildout TricksStupid Buildout Tricks
Stupid Buildout Tricks
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with Golang
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI Apps
 
Intro django
Intro djangoIntro django
Intro django
 
Python Projects at Neova
Python Projects at NeovaPython Projects at Neova
Python Projects at Neova
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
 
Latex with git
Latex with gitLatex with git
Latex with git
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Builder and BuildKit
Builder and BuildKitBuilder and BuildKit
Builder and BuildKit
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
나도 할 수 있다 오픈소스
나도 할 수 있다 오픈소스나도 할 수 있다 오픈소스
나도 할 수 있다 오픈소스
 
wxPython and wxFormBuilder
wxPython and wxFormBuilderwxPython and wxFormBuilder
wxPython and wxFormBuilder
 
Getting started with wxWidgets
Getting started with wxWidgets Getting started with wxWidgets
Getting started with wxWidgets
 
Web 2 .Zero Programming Providers
Web 2 .Zero Programming ProvidersWeb 2 .Zero Programming Providers
Web 2 .Zero Programming Providers
 
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016
 

Ähnlich wie Don't Fear the Autotools! Understanding the Basics

Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical trainingThierry Gayet
 
Build and deploy scientific Python Applications
Build and deploy scientific Python Applications  Build and deploy scientific Python Applications
Build and deploy scientific Python Applications Ramakrishna Reddy
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.All Things Open
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceSourabh Singh Tomar
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligenceCarlos Toxtli
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Gnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semGnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semSagun Baijal
 
Gnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semGnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semSagun Baijal
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projectsMpho Mphego
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdfAbid Malik
 
Android open source project build system phi innovations - android summit 2015
Android open source project build system   phi innovations - android summit 2015Android open source project build system   phi innovations - android summit 2015
Android open source project build system phi innovations - android summit 2015Rafael Coutinho
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksKaty Slemon
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio Salvador
 

Ähnlich wie Don't Fear the Autotools! Understanding the Basics (20)

Autotools
AutotoolsAutotools
Autotools
 
Autotools
AutotoolsAutotools
Autotools
 
Autotools pratical training
Autotools pratical trainingAutotools pratical training
Autotools pratical training
 
Build and deploy scientific Python Applications
Build and deploy scientific Python Applications  Build and deploy scientific Python Applications
Build and deploy scientific Python Applications
 
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
It’s 2021. Why are we -still- rebooting for patches? A look at Live Patching.
 
Composer
ComposerComposer
Composer
 
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/SourceCrafting GNU/Linux distributions for Embedded target from Scratch/Source
Crafting GNU/Linux distributions for Embedded target from Scratch/Source
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Gnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semGnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-sem
 
Gnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semGnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-sem
 
Embedded Linux - Building toolchain
Embedded Linux - Building toolchainEmbedded Linux - Building toolchain
Embedded Linux - Building toolchain
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projects
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Android open source project build system phi innovations - android summit 2015
Android open source project build system   phi innovations - android summit 2015Android open source project build system   phi innovations - android summit 2015
Android open source project build system phi innovations - android summit 2015
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
Framework
FrameworkFramework
Framework
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 

Kürzlich hochgeladen

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Don't Fear the Autotools! Understanding the Basics

  • 1. Don't Fear the Autotools! Scott Garman Portland Linux User Group December 1, 2011
  • 2. AC_INIT([Scott Garman], [1.0], [sgarman@zenlinux.com]) ● Embedded Linux SW Engineer at Intel ● Working on the Yocto Project (yoctoproject.org) ● I am not an Autotools fanboy; just a pragmatic user ● I do not really know all that much about Autotools ● It's just that knowing just enough about Autotools to be able to effectively work with it is a lot more than most people tend to know about it ● This is a “gentle introduction” to hopefully inspire further study
  • 3. What are “the Autotools?” ● Cross-platform build system for compiled software (typically C/C++ applications) ● Helps to encourage portability standards defined in the GNU Coding Standards (GCS) and Filesystem Hierarchy Standard (FHS) ● The tools: ● Autoconf ● Automake ● Libtool
  • 4. From a User's Perspective ● tar xvzf application-1.0.tar.gz ● cd application-1.0/ ● ./configure ● make ● sudo make install
  • 5. The Most Common Configure Error ● Configure script fails and reports an error such as: “No package libfoo found” ● This indicates that you need to install library foo ● “But I already have a package named libfoo installed!” ● The runtime library is installed from package libfoo, but to compile applications which use foo, you need to install the “development headers” - this package is generally named libfoo-dev or libfoo-devel
  • 6. Troubleshooting Configure Errors ● When configure is run, it generates a log file config.log, which contains: ● Command line used to invoke configure ● Platform information about your environment ● Additional details about the tests configure ran ● A line number from the configure script where config.status is generated and run ● Submitting config.log with a bug report to the application maintainers gives them important information they need to fix the issue
  • 7. config.status ● Uses information from configure to perform substitutions in *.in template files to generate the output files: configure config.log config.h.in config.h config.status Makefile.in Makefile
  • 8. config.site ● Running configure tests can take a while ● If you're installing many apps from source, you'll be running a lot of the same tests over and over again ● Things like the size of a long int are not going to change on your system ● A config.site file can be created with seeded values for these tests, and will be used as a test result “cache” ● Set an environment var CONFIG_SITE with the path to your config.site file to make use of it ● Very handy when cross-compiling apps (since some tests compile small C programs, but those programs can't be run natively!)
  • 9. Filesystem Hierarchy Standard (FHS) ● Defines root filesystem layout guidelines and where various file types belong ● For example: the difference between binaries in /sbin vs. /usr/sbin ● Widespread adoption by GNU/Linux distros has made portability of build systems easier ● Current version is 2.3 (from 2004); v3.0 is now available in draft form ● http://www.pathname.com/fhs/
  • 10. GNU Coding Standards (GCS) ● How source build configuration should work ● Defines standard Makefile targets (install, dist, check, installcheck, etc) ● Defines standard directory variables (bindir, libexecdir, sysconfdir, etc) ● Standard command-line options (to promote consistent behavior among GNU utilities) ● Good advice for how to write portable C code ● http://www.gnu.org/prep/standards/
  • 11. From a Developer's Perspective ● Autoconf: configure.ac autoconf/autoreconf configure config.log config.h.in config.h config.status Makefile.in Makefile
  • 12. From a Developer's Perspective ● Automake: configure.ac autoconf/autoreconf configure config.log config.h.in config.h config.status Makefile.in Makefile automake/autoreconf Makefile.am
  • 13. Hello World Example ● Let's take a look at how to take a trivial C program (GNU amhello) and enable basic Autotools support
  • 14. Libtool ● Differences in how shared libraries are built across Unix systems are especially challenging to deal with ● Very specific and unique compiler options are often needed on different platforms ● Differences in library naming conventions ● Libtool abstracts these details into a wrapper script that is invoked in uniform fashion to build libraries
  • 15. Libtool Utilities ● libtool – generic example script ● libtoolize – creates a custom version of the libtool script that works with your program (ltmain.sh); you then include this when distributing your sources ● ltdl/ltdl.h – A standard way of loading shared libraries on-demand within your application (for when you want control over the process)
  • 16. Why Use Autotools? ● Attempting to address all of the subtle build failures that can occur between platforms yourself is an exercise in futility ● Leverage the collective wisdom the project has attained, to result in portable shell scripts and makefiles which have minimal system requirements ● Built-in support for following the GNU Coding Standards and FHS ● Users and distro maintainers expect these features and already understand an Autotools-based build process
  • 17. Resources ● Autotools: A Practitioner's Guide to GNU Autoconf, Automake, and Libtool, by John Calcote. No Starch Press. ● Autotools Tutorial by Alexandre Duret-Lutz: http://www.lrde.epita.fr/~adl/autotools.html ● GNU Coding Standards: http://www.gnu.org/prep/standards/ ● Filesystem Hierarchy Standard: http://www.pathname.com/fhs/ ● Autoconf Macro Definitions: http://www.gnu.org/software/autoconf/manual/html_node/Auto conf-Macro-Index.html