Posts

Showing posts with the label Autotools

GNU Autotools II - "Hello world" project with tests

Spanish version / Versión en Español In order to explore the concepts from the first post in a more practical fashion, today we will look at a step by step guide for creating a C programming language project built and tested using Autotools . 1: Application entry point This will be src/main.c . It's typical to have a src directory for source code, because when the project grows, it will probably need other top-level directories such as man for man pages , data for data files, and so on. src/main.c #include <config.h> #include <stdio.h> int main (void) { puts("Hello World!"); puts("This is " PACKAGE_STRING "."); return 0; } Including config.h is necessary because that's where PACKAGE_STRING will be defined. In turn, config.h will be generated by Autotools. 2: Top-level configure.ac file All configure.ac files contain Autoconf instructions which control the generation of the configure script. These...

GNU Autotools II - Hola mundo con tests

Versión en inglés / English version Para bajar a tierra los conceptos del primer post , hoy seguiremos paso a paso la creación de un proyecto en lenguaje C usando Autotools como sistema de build . 1: Punto de entrada En primer lugar, se crea el punto de entrada del programa, src/main.c . Es típico tener un directorio src para el código fuente, ya que al evolucionar el proyecto, probablemente se agreguen directorios como man para páginas de ayuda ( man pages ), data para archivos de datos, etc. src/main.c #include <config.h> #include <stdio.h> int main (void) { puts("Hello World!"); puts("This is " PACKAGE_STRING "."); return 0; } La inclusión de config.h viene dada porque ese archivo será generado por Autotools, y es donde estará definido PACKAGE_STRING. 2: Archivo configure.ac raíz Los archivos configure.ac contienen instrucciones Autoconf que controlan la generación del script configure . Dichas instru...

GNU Autotools I - Introduction

Spanish version / Versión en Español First thing first: what are GNU Autotools , and what are they used for? The moniker "GNU Autotools" refers to a collection of software packages: Autoconf , Automake and Libtool . These packages include programs aimed at standardizing and automating the build, test, release and installation processes across multiple platforms. In that sense, it shares a lot of goals and purpose with other tools such as CMake . Most of the GNU software is built using Autotools; git is a famous example. More specifically, what the Autotools do is generate configure scripts and Makefiles from certain configuration files. When generating these files, portability across different platforms is considered in order to allow the package to be built in as many different environments as possible. A user's perspective In this context, we will consider a user a person who downloaded a source tarball for some package, and wants to build it and inst...

GNU Autotools I - Introducción

Versión en inglés / English version En primer lugar: ¿qué son las Autotools de GNU , y para qué sirven? El nombre "GNU Autotools" se refiera a una colección de paquetes de software : Autoconf , Automake y Libtool . Estos paquetes contienen programas cuyo objetivo es estandarizar y automatizar los procesos de compilación, prueba, entrega e instalación a través de distintas plataformas. En ese sentido, comparte propósito con otras herramientas como CMake . Gran parte de el software de GNU ha sido creado con Autotools; git es un ejemplo célebre. Más específicamente, lo que las Autotools hacen es generar scripts y Makefiles a partir de archivos de configuración de entrada escritos por el desarrolador. Al generar estos scripts y Makefiles , se considera la portabilidad a través de distintas plataformas a fin de que el paquete funcione en la mayor cantidad de entornos posible. La perspectiva del usuario En este contexto, se considerará al usuario como una per...