SlideShare a Scribd company logo
1 of 24
Download to read offline
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

More Related Content

What's hot

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
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and CompilationBud Siddhisena
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device driversAlexandre Moreno
 
Device Drivers in Linux
Device Drivers in LinuxDevice Drivers in Linux
Device Drivers in LinuxShreyas MM
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linuxVandana Salve
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel DevelopmentPriyank Kapadia
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
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 Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device DriverGary Yeh
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modulesdibyajyotig
 

What's hot (20)

Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
 
Device Drivers in Linux
Device Drivers in LinuxDevice Drivers in Linux
Device Drivers in Linux
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Kernel modules
Kernel modulesKernel modules
Kernel modules
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linux
 
Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
005 skyeye
005 skyeye005 skyeye
005 skyeye
 
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
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device Driver
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 

Viewers also liked

Linux kernel code
Linux kernel codeLinux kernel code
Linux kernel codeGanesh Naik
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StorySage Sharp
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiMohamed Abdallah
 
Linux Kernel Introduction
Linux Kernel IntroductionLinux Kernel Introduction
Linux Kernel IntroductionSage Sharp
 
Performance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesPerformance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesSoheila Dehghanzadeh
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOKris Findlay
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linuxChih-Min Chao
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesShreyas MM
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwaredefinecareer
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016Chris Simmonds
 
Advanced Git
Advanced GitAdvanced Git
Advanced Gitsegv
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driverVandana Salve
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
 

Viewers also liked (20)

Linux kernel code
Linux kernel codeLinux kernel code
Linux kernel code
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success Story
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
 
Linux Kernel Introduction
Linux Kernel IntroductionLinux Kernel Introduction
Linux Kernel Introduction
 
Containers in the Cloud
Containers in the CloudContainers in the Cloud
Containers in the Cloud
 
Performance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesPerformance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual Machines
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to Kubernetes
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016
 
LINUX Device Drivers
LINUX Device DriversLINUX Device Drivers
LINUX Device Drivers
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 

Similar to 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
 

Similar to 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
 

Recently uploaded

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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 

Recently uploaded (20)

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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 

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/