SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

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