SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Presentation
                 on
     GNU Build System
                 for
 (FOSS) From the Open Source Shelf
    CDAC Monthly Seminar Series

              Presented by
             Sagun Baijal


            Organised by
 CDAC, Kharghar, Navi Mumbai
E-mail: course_kh@cdacmumbai.in
WELCOME
Overview

Background
Why GNU Build System

Introduction to GNU Build System

Using GNU Build System

Conclusion

References
Background
•   Typical Methods of installing a software in Unix-
    like systems
      •   Installation by using a package manager
      •   Installtion from source code
•   GNU standard method of installation
      •   Packages normally come as a tarball.
      •   Decompress the package.
      •   Run configure script e.g. ...:~$./configure
      •   Run make e.g. ...:~$make
      •   Run make install e.g. ...:~$sudo make install
Background contd...
•   Issues while packaging the system for release
      •   Naming and Versioning of the package.
      •   Portability of system on a variety of platforms.
      •   Configuration script configure with standrad
          configurations options.
      •   Makefile.inS required by configure script.
      •   Conformity of Makefile and directory layout as per
          GNU standards.
      •   Necessary documentation files and tests.
      •   Bundling of the package into a tarball.
      •   Licensing of the system.
Why GNU Build System


•  Creating a configuration script and Makefiles
from scratch is a tedious, time-consuming and
error-prone task.
• Some users may be left unsatisfied due to
unavailability of some desired features.
• It may be needed to upgrade the overall setup to
follow the changes to the GNU Coding Standards.
Contd...
•   GNU Build System helps:
      •   simplify the development of portable programs.
      •   simplify the building of programs distributed as
          source code.
• Any bux fixes and improvements can be made at
one place.
• Users don't require any utilities of build system
at their end.
Introduction to GNU Build System

•   GNU Build System comprises:
      • autoconf: For generating configuration script configure.
      • automake: For generating makefile templates
        Makfile.inS
      • libtool: Helps creating the portable compiled libraries.
•   Some other auxilary tools:
      • Autoscan: For generating intial input file for autoconf.
      • Autoheader: For generating template header for
        configure.
      • aclocal: For generating aclocal.m4.
Contd...
•   Installation:
     •   To check, if installed in their most recent versions:
          • ...:~$autoconf - -version
          • ...:~$automake - -version
          • ...:~$libtool - -version
     •   If not installed, then (on any debian-like system):
          • ...:~$apt-cache search <tool-name> - searches for the
            tool-name in available package list.
          • ...:~$sudo apt-get install <tool-name> - installs the

              <tool-name>.
Using GNU Build System

•   Basic requirements:
      Source and documentation files of the package.
      •
    • One configure.ac/.in as initial input file for
      autoconf.
    • One Makefile.am for each directory in the package.
• Source and Documentation files:
    • Files containing source code and necessary
      documentation to be distributed in the package.
    • Ex.: .c, .cpp files, README etc..
Contd...
•   What is configure.ac?
      •   Initial input file for autoconf to generate configure
          script. Also used by automake, while creating
          Makefile.amS.
      •   Contains macros needed to test the system features
          required or used by the package.
      •   Using autoscan:
          • autoscan scans source files and creates configure.scan.
          • After making some adjustments, if required,
            configure.scan can be renamed to configure.ac.
          • Adjustments may be like adding some missing macros
            or changing the order of some macros etc..
Contd...
•   Common macros:
    •   AC_PREREQ: specifies the minimum version of autoconf that can
        successfully compile a given configure.ac.
    •   AC_INIT: initializes autoconf.
    •   AM_INIT_AUTOMAKE: initializes automake.
    •   AC_PROG_CC: determines a C compiler to use and sets output
        variable CC to its value.
    •   AC_PROG_CXX: determines a C++ compiler to use and sets output
        variable CXX to its value.
    •   AC_CONFIG_HEADER: causes to create a config.h file gathering
        ‘#define’s defined by other macros in configure.ac.
    •   AC_CONFIG_FILES: declares the list of files to be created from their
        *.in templates.
    •   AC_OUTPUT: generates and runs config.status, which in turn creates
        the makefiles and any other files resulting from configuration.
Contd...

•   Example configure.ac:
    AC_PREREQ(2.61)
    AC_INIT([hello], [0.1], [sagun@cdacmumbai.in])
     AM_INIT_AUTOMAKE([-Wall -Werror])
     AC_PROG_CC
     AC_CONFIG_HEADER([config.h])
     AC_CONFIG_FILES([
       Makefile
       src/Makefile
    ])
    AC_OUTPUT
Contd...
•   What is Makefile.am?
         • Initial input file for automake to generate
           Makefile.in.
         • One Makefile.am for each directory in package
           including root directory.
         • Normally contains a list of variable (and rule)
           definitions required when make is invoked.
     •   Common Makefile targets:
             • make all: Build programs, libraries, documentation,
               etc.
             • make install: Install what needs to be installed,
               copying the files from the package's tree to system-
               wide directories.
Contd...
•   make uninstall: The opposite of make install: erase the
    installed files.
•   make clean: Erase from the build tree the files built by
    make all.
•   make distclean: Additionally erase anything
    ./configure created.
•   make check: Run the test suite, if any.
•   make installcheck: Check the installed programs or
    libraries, if supported.
•   make dist: Recreate package-version.tar.gz from all
    the source files.
Contd...
•   Common variables for Makefile.am:
    •   bin_PROGRAMS: specifies the <program> to be built
        and installed on .../bin directory.
    •   <program>_SOURCES: lists one or more source files
        compiled to build the <program>.
    •   SUBDIRS: lists all sub-directories to be built.
    •   dist_doc_DATA: lists documentation files to be
        distributed and installed in ../doc directory.
    •   <program>_DEPENDENCIES: specifies dependencies,
        if any.
    •   <program>_<FLAGS>: various compilation flags can
        be set.
Contd...

 • <program>_LDADD: specifies extra objects and
   libraries to be added with <program>.
 • <program>_LDFLAGS: specifies extra linker flags for
   <program>.
• An example Makefile.am:
   bin_PROGRAMS = hello
   hello_SOURCES = hello.c
Contd...
•   Some characteristics of GNU Build System:
      •   VPATH Builds: When source tree and build tree
          are different, such builds are called VPATH builds.
      •   Cross-compilation: When a program is built on one
          platform and run on another platform is called
          cross-compilation.
      •   Renaming: GNU build system allows to
          automatically rename executables etc. before
          installation.
      •   Dependency tracking: GNU build system allows to
          track dependencies automatically.
      •   Nested packages: Autoconfiscated packages can be
          nested to arbitrary depth.
Contd...
•   Applying tools to create the package:
      •   Ensure all necessary source, documentation and
          Makefiel.amS files have been created.
      •   Run autoscan to create prelimanary configure.scan.
          • ..:~/<pkg-dir>$autoscan
      •   If required, edit configure.scan to update package-
          name,          version,         invocation        to
          AM_INIT_AUTOMAKE macro etc. and rename it
          to configure.ac.
      •   Run aclocal to create aclocal.m4. This file contains
          macro definitions not part of standard autoconf
          macros.
          • ..:~/<pkg-dir>$aclocal
Contd...
•   Run autoheader to create config.h.in. This file is a
    template header for configure.
    • ..:~/<pkg-dir>$autoheader
•   Run autoconf to create configure from configure.ac
    and aclocal.m4.
    • ..:~/<pkg-dir>$autoconf
•   Run automake to create Makefile.inS from
    Makefile.amS.
    • ..:~/<pkg-dir>$automake
•   Run configure to create Makefiles from
    Makefile.inS, config.h from config.h.in and perform
    various checks about the environment.
    • ..:~/<pkg-dir>$./configure
Contd...

•   Now run make to build the system.
    • ..:~/<pkg-dir>$make
•   If make executes successfully, run make distcheck to
    create the package for distribution as a tarball.
    • ..:~/<pkg-dir>$make distcheck
•   Run make install to install the package.
    • ..:~/<pkg-dir>$sudo make install
•   Run make uninstall to uninstall the package.
    • ..:~/<pkg-dir>$sudo make uninstall
Conclusion

•   From User's point of view:
     •   provides a standard procedure for installation.
     •   procedure consists of only a small set of commands.
•   From Developer's point of view:
     •   Creating portable distributions become easy.
     •   Updations or improvements, if any, can be done at
         one place.
References
 http://autotoolset.sourceforge.net/tutorial.html
 http://www.gnu.org/software/automake/manual/automake.html

 http://sources.redhat.com/autobook/

 http://www.gnu.org/software/hello/manual/autoconf/autoscan-

Invocation.html#autoscan-Invocation
 http://www.lrde.epita.fr/~adl/autotools.html

 http://en.wikipedia.org/wiki/GNU_build_system

 http://www.gnu.org/prep/standards/standards.html

 http://www.dwheeler.com/essays/releasing-floss-software.html

 http://www.gnu.org/software/hello/manual/autoconf/Autoconf-Macro-

Index.html
 http://www.devshed.com/c/a/Administration/Linux-Administration-Installing-

Software/9/
 http://www.control-escape.com/linux/lx-swinstall.html

 http://www.unixguide.net/linux/faq/05.02.shtml

 http://www.gnu.org/software/libtool/
Thank You
E-mail: course_kh@cdacmumbai.in

Contenu connexe

Tendances

Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and CompilationBud Siddhisena
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programmingVandana Salve
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device driversAlexandre Moreno
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel DevelopmentPriyank Kapadia
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linuxVandana Salve
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Linux kernel module programming guide
Linux kernel module programming guideLinux kernel module programming guide
Linux kernel module programming guideDũng Nguyễn
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom BoardPatrick Bellasi
 

Tendances (20)

Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
005 skyeye
005 skyeye005 skyeye
005 skyeye
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linux
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Linux kernel module programming guide
Linux kernel module programming guideLinux kernel module programming guide
Linux kernel module programming guide
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
 

Similaire à Gnubs pres-foss-cdac-sem

OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo家榮 吳
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automakeniurui
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded systemNirma University
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the AutotoolsScott Garman
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfThninh2
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio Salvador
 
Getting started with CFEngine - Webinar
Getting started with CFEngine - WebinarGetting started with CFEngine - Webinar
Getting started with CFEngine - WebinarCFEngine
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Manuel Garcia
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerKuan Yen Heng
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux EnvironmentDongho Kang
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdfAbid Malik
 

Similaire à Gnubs pres-foss-cdac-sem (20)

Autotools
AutotoolsAutotools
Autotools
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automake
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Autotools
AutotoolsAutotools
Autotools
 
Buildroot easy embedded system
Buildroot easy embedded systemBuildroot easy embedded system
Buildroot easy embedded system
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdf
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
Getting started with CFEngine - Webinar
Getting started with CFEngine - WebinarGetting started with CFEngine - Webinar
Getting started with CFEngine - Webinar
 
Autotools
AutotoolsAutotools
Autotools
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and ...
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux Environment
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 

Dernier

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Dernier (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Gnubs pres-foss-cdac-sem

  • 1. Presentation on GNU Build System for (FOSS) From the Open Source Shelf CDAC Monthly Seminar Series Presented by Sagun Baijal Organised by CDAC, Kharghar, Navi Mumbai E-mail: course_kh@cdacmumbai.in
  • 3. Overview Background Why GNU Build System Introduction to GNU Build System Using GNU Build System Conclusion References
  • 4. Background • Typical Methods of installing a software in Unix- like systems • Installation by using a package manager • Installtion from source code • GNU standard method of installation • Packages normally come as a tarball. • Decompress the package. • Run configure script e.g. ...:~$./configure • Run make e.g. ...:~$make • Run make install e.g. ...:~$sudo make install
  • 5. Background contd... • Issues while packaging the system for release • Naming and Versioning of the package. • Portability of system on a variety of platforms. • Configuration script configure with standrad configurations options. • Makefile.inS required by configure script. • Conformity of Makefile and directory layout as per GNU standards. • Necessary documentation files and tests. • Bundling of the package into a tarball. • Licensing of the system.
  • 6. Why GNU Build System • Creating a configuration script and Makefiles from scratch is a tedious, time-consuming and error-prone task. • Some users may be left unsatisfied due to unavailability of some desired features. • It may be needed to upgrade the overall setup to follow the changes to the GNU Coding Standards.
  • 7. Contd... • GNU Build System helps: • simplify the development of portable programs. • simplify the building of programs distributed as source code. • Any bux fixes and improvements can be made at one place. • Users don't require any utilities of build system at their end.
  • 8. Introduction to GNU Build System • GNU Build System comprises: • autoconf: For generating configuration script configure. • automake: For generating makefile templates Makfile.inS • libtool: Helps creating the portable compiled libraries. • Some other auxilary tools: • Autoscan: For generating intial input file for autoconf. • Autoheader: For generating template header for configure. • aclocal: For generating aclocal.m4.
  • 9. Contd... • Installation: • To check, if installed in their most recent versions: • ...:~$autoconf - -version • ...:~$automake - -version • ...:~$libtool - -version • If not installed, then (on any debian-like system): • ...:~$apt-cache search <tool-name> - searches for the tool-name in available package list. • ...:~$sudo apt-get install <tool-name> - installs the <tool-name>.
  • 10. Using GNU Build System • Basic requirements: Source and documentation files of the package. • • One configure.ac/.in as initial input file for autoconf. • One Makefile.am for each directory in the package. • Source and Documentation files: • Files containing source code and necessary documentation to be distributed in the package. • Ex.: .c, .cpp files, README etc..
  • 11. Contd... • What is configure.ac? • Initial input file for autoconf to generate configure script. Also used by automake, while creating Makefile.amS. • Contains macros needed to test the system features required or used by the package. • Using autoscan: • autoscan scans source files and creates configure.scan. • After making some adjustments, if required, configure.scan can be renamed to configure.ac. • Adjustments may be like adding some missing macros or changing the order of some macros etc..
  • 12. Contd... • Common macros: • AC_PREREQ: specifies the minimum version of autoconf that can successfully compile a given configure.ac. • AC_INIT: initializes autoconf. • AM_INIT_AUTOMAKE: initializes automake. • AC_PROG_CC: determines a C compiler to use and sets output variable CC to its value. • AC_PROG_CXX: determines a C++ compiler to use and sets output variable CXX to its value. • AC_CONFIG_HEADER: causes to create a config.h file gathering ‘#define’s defined by other macros in configure.ac. • AC_CONFIG_FILES: declares the list of files to be created from their *.in templates. • AC_OUTPUT: generates and runs config.status, which in turn creates the makefiles and any other files resulting from configuration.
  • 13. Contd... • Example configure.ac: AC_PREREQ(2.61) AC_INIT([hello], [0.1], [sagun@cdacmumbai.in]) AM_INIT_AUTOMAKE([-Wall -Werror]) AC_PROG_CC AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT
  • 14. Contd... • What is Makefile.am? • Initial input file for automake to generate Makefile.in. • One Makefile.am for each directory in package including root directory. • Normally contains a list of variable (and rule) definitions required when make is invoked. • Common Makefile targets: • make all: Build programs, libraries, documentation, etc. • make install: Install what needs to be installed, copying the files from the package's tree to system- wide directories.
  • 15. Contd... • make uninstall: The opposite of make install: erase the installed files. • make clean: Erase from the build tree the files built by make all. • make distclean: Additionally erase anything ./configure created. • make check: Run the test suite, if any. • make installcheck: Check the installed programs or libraries, if supported. • make dist: Recreate package-version.tar.gz from all the source files.
  • 16. Contd... • Common variables for Makefile.am: • bin_PROGRAMS: specifies the <program> to be built and installed on .../bin directory. • <program>_SOURCES: lists one or more source files compiled to build the <program>. • SUBDIRS: lists all sub-directories to be built. • dist_doc_DATA: lists documentation files to be distributed and installed in ../doc directory. • <program>_DEPENDENCIES: specifies dependencies, if any. • <program>_<FLAGS>: various compilation flags can be set.
  • 17. Contd... • <program>_LDADD: specifies extra objects and libraries to be added with <program>. • <program>_LDFLAGS: specifies extra linker flags for <program>. • An example Makefile.am: bin_PROGRAMS = hello hello_SOURCES = hello.c
  • 18. Contd... • Some characteristics of GNU Build System: • VPATH Builds: When source tree and build tree are different, such builds are called VPATH builds. • Cross-compilation: When a program is built on one platform and run on another platform is called cross-compilation. • Renaming: GNU build system allows to automatically rename executables etc. before installation. • Dependency tracking: GNU build system allows to track dependencies automatically. • Nested packages: Autoconfiscated packages can be nested to arbitrary depth.
  • 19. Contd... • Applying tools to create the package: • Ensure all necessary source, documentation and Makefiel.amS files have been created. • Run autoscan to create prelimanary configure.scan. • ..:~/<pkg-dir>$autoscan • If required, edit configure.scan to update package- name, version, invocation to AM_INIT_AUTOMAKE macro etc. and rename it to configure.ac. • Run aclocal to create aclocal.m4. This file contains macro definitions not part of standard autoconf macros. • ..:~/<pkg-dir>$aclocal
  • 20. Contd... • Run autoheader to create config.h.in. This file is a template header for configure. • ..:~/<pkg-dir>$autoheader • Run autoconf to create configure from configure.ac and aclocal.m4. • ..:~/<pkg-dir>$autoconf • Run automake to create Makefile.inS from Makefile.amS. • ..:~/<pkg-dir>$automake • Run configure to create Makefiles from Makefile.inS, config.h from config.h.in and perform various checks about the environment. • ..:~/<pkg-dir>$./configure
  • 21. Contd... • Now run make to build the system. • ..:~/<pkg-dir>$make • If make executes successfully, run make distcheck to create the package for distribution as a tarball. • ..:~/<pkg-dir>$make distcheck • Run make install to install the package. • ..:~/<pkg-dir>$sudo make install • Run make uninstall to uninstall the package. • ..:~/<pkg-dir>$sudo make uninstall
  • 22. Conclusion • From User's point of view: • provides a standard procedure for installation. • procedure consists of only a small set of commands. • From Developer's point of view: • Creating portable distributions become easy. • Updations or improvements, if any, can be done at one place.
  • 23. References  http://autotoolset.sourceforge.net/tutorial.html  http://www.gnu.org/software/automake/manual/automake.html  http://sources.redhat.com/autobook/  http://www.gnu.org/software/hello/manual/autoconf/autoscan- Invocation.html#autoscan-Invocation  http://www.lrde.epita.fr/~adl/autotools.html  http://en.wikipedia.org/wiki/GNU_build_system  http://www.gnu.org/prep/standards/standards.html  http://www.dwheeler.com/essays/releasing-floss-software.html  http://www.gnu.org/software/hello/manual/autoconf/Autoconf-Macro- Index.html  http://www.devshed.com/c/a/Administration/Linux-Administration-Installing- Software/9/  http://www.control-escape.com/linux/lx-swinstall.html  http://www.unixguide.net/linux/faq/05.02.shtml  http://www.gnu.org/software/libtool/