/!\ Warning:
While these guidelines are still useful, you migth consider switching to meson instead.
See Initiatives/GnomeGoals/MesonPorting for more details

GNOME Goal: Modernize your autotools configuration

Introduction

Autotools is the most common system to build programs in GNOME project.

Remove deprecated macros from our configure.ac files and use the new syntax will do our build system more legible and portable

Some useful guides:

Reference documentation:

Guidelines

The Autotools comes with a program to make the work for us, simply run

autoupdate
autoscan

in your source tree and you have a new updated configure.ac, plus a list of macros it recommends you use (due to dependencies needing them). (Check the result for possible errors.)

Some more tips:

  • Remove use of gnome-common in your module: use autoconf-archive macros instead, and simplify your autogen.sh according to the instructions on Projects/GnomeCommon/Migration.

  • Remove any version check in the autogen.sh file if the version in autogen <= version in configure.ac:

The check in autogen.sh is usually done to try and find the "best" version. The version number passed to AM_INIT_AUTOMAKE(), AC_PREREQ()... is a minimum requirement which causes Automake to abort if not fulfilled, so if the autogen.sh script only checks for a minimum version without trying to select between different binaries, then it is superfluous

  • Respect the standard configure.ac layout

  • Try to avoid the use of AM_MAINTAINER_MODE. AM_MAINTAINER_MODE (called like that) disables dependency-checking for autotools-generated stuff. AM_MAINTAINER_MODE([enable]) retains the default behavior, but lets users pass a configure option to disable the dependency checking. AM_MAINTAINER_MODE([enable]) has none of the disadvantages of AM_MAINTAINER_MODE and all of the advantages. So, if you want this macro, use you should use AM_MAINTAINER_MODE([enable]). See the automake manual for a extended explanation.

  • Do not use GNOME_COMMON_INIT, as it does not work with autoreconf. Simply add this to your Makefile.am. You have to define the macros dir in your configure.ac, in this case: AC_CONFIG_MACRO_DIR([m4])

  • Use all the parameters of AC_INIT(), (for the fifth parameter you need autoconf >= 2.64, although it is harmless for older autoconf versions):

AC_INIT([Glom],[1.13.2],[https://bugzilla.gnome.org/enter_bug.cgi?product=Glom],[glom],[http://www.glom.org/])
  • Use updated versions of the programs (all of these versions (and newer) are present in Debian stable):
    • automake >= 1.11.1 (AM_INIT_AUTOMAKE([1.11.1])) (Automake 1.10 and 1.11 are known to be suffering from critical security issues)

    • autoconf >= 2.64 (AC_PREREQ(2.64))

    • libtool >= 2.2.6 (LT_PREREQ([2.2.6]))

    • intltool >= 0.50.1 (IT_PROG_INTLTOOL([0.50.1])) (which has support for GSettings, GtkBuilder, etc.)

  • Use LT_INIT() syntax for libtool (needs libtool >= 2.2.0). More info about LT_INIT(). For example, change this:

AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_DISABLE_STATIC
AM_PROG_LIBTOOL

to this

LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])

AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-bzip2])
  • If any path in the tarball exceeds 99 characters, you need to add the tar-ustar (or tar-pax) automake option; otherwise tarballs will be corrupted.

    It's been proposed to use version 1.11.1 of automake and generate xz distribution tarballs instead using the dist-xz option, because of the much better compresion ratio.

    ChPe: dist-xz creates an unnessary dependency on automake 1.11, since most people want only to build the module, not create a tarball. Also, there is no need to use 1.11.1 specifically since, again, the .1 is only relevant for {make dist.

    BastienNocera: We should consider using "tar-pax" as the default tar, see bug 645830 for details.

    • ChPe: Usually, tar-ustar is enough, and the automake manual says it is more portable.

      • OlavVitters: tar-pax doesn't work on OpenBSD. Must use tar-ustar.

  • MatthiasClasen: This goal should be updated to cover working with automake 1.12.

  • Use ''autoconf-archive'' macros instead of gnome-common. See the gnome-common migration guide for more information on porting away from gnome-common.

    • AX_IS_RELEASE() to determine whether to enable release features or disable debug features.

    • AX_COMPILER_FLAGS() instead of custom flags handling or GNOME_COMPILE_WARNINGS. Then add the $(WARN_CFLAGS) variable to CFLAGS, the $(WARN_LDFLAGS) variable to LDFLAGS, and $(WARN_SCANNERFLAGS) to *_SCANNERFLAGS for each generated GIR file.

    • AX_CHECK_ENABLE_DEBUG() instead of GNOME_DEBUG_CHECK.

    • AX_CODE_COVERAGE() instead of GNOME_CODE_COVERAGE.

  • Additional autoconf-archive macros that should be used:
    • AX_VALGRIND_CHECK() instead of custom Valgrind handling code for running tests under.

    • AX_PKG_CHECK_MODULES() instead of normal PKG_CHECK_MODULES() when building libraries, as it simplifies handling of public vs private dependencies for listing in generated pkg-config .pc files.

  • Use AM_SILENT_RULES([yes]) to get a pretty Kbuild-like output

Other tips

  • Ship tarballs with all sources and generated files included.
  • Do not run autoreconf/autogen.sh during builds.
  • Do not exploit autotools's internals.

Comments before approval

{i} Add your comments to this goal proposal here

While I agree that removal of AM_MAINTAINER_MODE is right, the debian maintainers seem to disagree (see e.g. 450450 and 532550). So this part should be discussed on ddl first. ChPe

Presumably the (new?) recommendation to use AM_MAINTAINER_MODE([enable]) deals with that? MurrayCumming

ChPe: I must object to the recommendation to just bump the required autoconf/automake/etc versions. What good does that do? If it works with the e.g. automake 1.9, there really is no need to require 1.11.1 ! IMHO we should only bump the required versions where we use new features that aren't available in the older version. We should not make it unnecessarily hard to build on older systems.

ChPe: Also, why is this goal being silently implemented by filing bugs against various Gnome components with references to this page, when right at the top of this page it says that this is only a proposed goal and should not be implemented before being officially approved?

Sebastian: In my autogen.sh skript the maintainer mode flag is also passed the the configure script like ./configure --enable-maintainer-mode "$@" should that parameter be removed too? This goal should mention how this case is to be handled.

SébastienWilmet: Maybe the migration from gnome-common to autoconf-archive should be a separated goal? The previous items are already done in a lot of modules I think, some bugs were already filed and fixed so if we add more items it's more difficult to keep track of which modules are done. And if items are indefinitely added to this goal it'll never be done.

Status of this goal

{i} Tip: If you choose to work on a module, create the bug report on the GNOME bugzilla for the relevant module, and make it block bug <<insert here a link to the tracker bug>>. This way people will know someone already works on it, and won't duplicate the work you're doing.

State

Markup

todo

<: #ff8080> todo

patch

<: #ffcc50> [[GnomeBug:xxxxx|patch]]

done

<: #80ff80> [[GnomeBug:xxxxx|done]]

not needed

<: #80ff80> not needed

Above are the states and corresponding markup to update the modules state table below. Note that the states were reset on 2015-01-30 due to the goal being significantly updated. Modules which were previously ‘done’ are now ‘wip’.

This list should also be updated for all current git modules.

Tarball

Status

Desktop

alacarte

to do

brasero

done

bug-buddy

to do

cheese

to do

dasher

to do

deskbar-applet

to do

ekiga

to do

empathy

to do

eog

to do

epiphany

to do

evince

to do

evolution-data-server

to do

evolution

to do

evolution-exchange

to do

evolution-mapi

to do

evolution-webcal

to do

file-roller

to do

gcalctool

to do

gconf-editor

to do

gdm

to do

gedit

wip

gnome-applets

to do

gnome-backgrounds

to do

gnome-bluetooth

to do

gnome-control-center

to do

gnome-desktop

to do

gnome-desktop-sharp

to do

gnome-disk-utility

patch

gnome-doc-utils

to do

gnome-games

to do

gnome-icon-theme

to do

gnome-keyring

to do

gnome-netstatus

to do

gnome-nettool

wip

gnome-mag

to do

gnome-media

to do

gnome-menus

to do

gnome-packagekit

to do

gnome-panel

to do

gnome-power-manager

to do

gnome-python-desktop

to do

gnome-screensaver

to do

gnome-session

to do

gnome-settings-daemon

to do

gnome-sharp

to do

gnome-speech

to do

gnome-system-monitor

to do

gnome-system-tools

to do

gnome-terminal

to do

gnome-themes

to do

gnome-user-docs

to do

gnome-user-share

to do

gnome-utils

to do

gok

to do

gstreamer

to do

gst-plugins-base

to do

gst-plugins-good

to do

gtk-engines

to do

gtkhtml

to do

gtksourceview

done

gucharmap

to do

gvfs

to do

hamster-applet

to do

libgail-gnome

to do

libgnomekbd

to do

libgtop

to do

libgweather

to do

liboobs

to do

librsvg

to do

libsoup

to do

libwnck

to do

metacity

to do

mousetweaks

to do

nautilus

to do

nautilus-sendto

to do

orca

to do

pygtksourceview

to do

seahorse

to do

sound-juicer

to do

swfdec-gnome

to do

tomboy

to do

totem

to do

totem-pl-parser

to do

vinagre

done

vino

done

vte

to do

yelp

to do

zenity

to do

Platform

GConf

to do

at-spi

to do

atk

to do

glib

to do

gtk+

to do

gtk-doc

to do

pango

to do

Admin

pessulus

to do

sabayon

to do

Development Tools

accerciser

to do

anjuta

to do

devhelp

to do

gdl

to do

glade3

wip

gnome-devel-docs

to do

Bindings (C++)

glibmm

not needed

pangomm

not needed

gtkmm

not needed

libglademm

to do

gconfmm

not needed

libgnomecanvasmm

to do

libgnome-vfsmm

to do

libgnomemm

to do

libgnomeuimm

to do

libxml++

not needed

Bindings (java)

glib-java (jg-common)

to do

libgtk-java

to do

libgnome-java

to do

libgconf-java

to do

libglade-java

to do

Bindings (JavaScript)

gjs

patch

seed

to do

Bindings (mono)

gtk-sharp

to do

Bindings (perl)

Glib

to do

Gtk2

to do

Gtk2-GladeXML

to do

Gnome2-GConf

to do

Gnome2-Canvas

to do

Gnome2-VFS

to do

Gnome2

to do

Bindings (python)

pygobject

to do

pygtk

to do

pyorbit

to do

gnome-python

to do

Mobile

GConf (dbus-based)

to do

clutter-gst

to do

External Dependencies

avahi

to do

Berkeley DB (libdb)

to do

cairo

to do

cairomm

not needed

clutter

to do

clutter-cairo

to do

clutter-gtk

to do

conduit

to do

dbus

to do

dbus-glib

to do

dbus-python

to do

desktop-file-utils

to do

DeviceKit-disks

to do

DeviceKit-power

to do

enchant

to do

expat

to do

farsight2

to do

fontconfig

to do

gamin

to do

GMime

to do

gnutls

to do

gpgme

to do

gtk-vnc

to do

hal

to do

hicolor-icon-theme

to do

icon-naming-utils

to do

intltool

to do

iso-codes

to do

libatasmart

to do

libcanberra

to do

libchamplain

to do

libcolorblind

to do

libcroco

to do

libgda

to do

libgdata

to do

libggz, ggz-client-libs

to do

libgpg-error

to do

libgcrypt

to do

libgsf

to do

libical

to do

libmapi

to do

libmusicbrainz

to do

libnotify

to do

liboil

to do

libproxy

to do

libtasn1

to do

libtelepathy

to do

libxklavier

to do

libxml2

to do

libxslt

to do

Mono.Addins

to do

mozilla (firefox)

to do

ndesk-dbus

to do

ndesk-dbus-glib

to do

opal

to do

pkg-config

to do

PolicyKit

to do

PolicyKit-gnome

to do

pulseaudio

to do

poppler

to do

pycairo

to do

ptlib

to do

Python

to do

rarian

to do

shared-mime-info

to do

sqlite

to do

startup-notification

to do

swfdec

to do

system-tools-backends

to do

telepathy-glib

to do

telepathy-mission-control

to do

unique

to do

tracker

to do

vala

to do

webkit

to do

Other

abiword

to do

atomix

wip

banshee

to do

banter

to do

beagle

to do

contact-lookup-applet

to do

couch-db

to do

dconf

to do

dia

to do

eggcups

to do

evolution-couchdb

to do

f-spot

to do

ghex

wip

gimp

to do

glom

to do

gnome-blog

to do

gnome-cups-manager

to do

gnome-hello

wip

gnome-launch-box

patch

gnome-main-menu

to do

gnome-shell

wip

GNOME Phone Manager

to do

gnome-mud

to do

goocanvas

to do

goocanvasmm

to do

GParted

to do

Gnumeric

to do

gossip

to do

gtetrinet

to do

gthumb

to do

gtranslator

wip

krb5-auth-dialog

to do

libbtctl

to do

libgnomekbd

to do

libgoffice

to do

libgsf

to do

libpeas

wip

meiga

wip

nautilus-actions

to do

nemiver

to do

NetworkManager

to do

network-manager-applet

wip

notification-daemon

wip

planner

to do

rhythmbox

to do

xchat-gnome

to do

Initiatives/GnomeGoals/ModernAutotools (last edited 2017-08-28 18:20:00 by JavierJardon)