2
# Stolen unashamedly from Clutter. Here's how this goes down:
4
# api_version = The soname version "libnux-1.0.so"
5
# version = The package version "1.2.2"
7
# Making a point release:
8
# - Increase micro_version to the next even number
9
# - Increasde interface_age to the next even number UNLESS there was an API
10
# addition/deprecation, at which point you should set it to 0
13
# - Increase micro_version to the next odd number
14
# - Increase interface_version to the next odd number
16
m4_define([nux_major_version], [1])
17
m4_define([nux_minor_version], [1])
18
m4_define([nux_micro_version], [0])
20
# Bump this when we break ABI
21
m4_define([nux_api_version], [1.0])
23
m4_define([nux_version],
24
[nux_major_version.nux_minor_version.nux_micro_version])
26
# increase the interface age by 1 for each release; if the API changes,
27
# set to 0. interface_age and binary_age are used to create the soname
28
# of the shared object:
30
# (<minor> * 100 + <micro>) - <interface_age>
32
# this allows using the same soname for different micro-releases in case
33
# no API was added or deprecated. for instance:
35
# nux 1.2.0 -> 100 * 2 + 0 = 200, interface age = 0 -> 200
36
# nux 1.2.2 -> 100 * 2 + 2 = 202, interface age = 2 -> 200
37
# nux 1.2.4 -> 100 * 2 + 4 = 204, interface age = 4 -> 200
38
# [ API addition, deprecation ]
39
# nux 1.2.6 -> 100 * 2 + 6 = 206, interface age = 0 -> 206
40
# nux 1.2.8 -> 100 * 2 + 8 = 208, interface age = 2 -> 206
41
# nux 1.2.10 -> 100 * 2 + 10 = 210, interface age = 4 -> 206
44
m4_define([nux_interface_age], [0])
45
m4_define([nux_binary_age],
46
[m4_eval(100 * nux_minor_version + nux_micro_version)])
52
[https://bugs.launchpad.net/nux])
54
AC_CONFIG_SRCDIR([Makefile.am])
55
AM_CONFIG_HEADER([config.h])
56
AM_INIT_AUTOMAKE([1.10])
58
NUX_MAJOR_VERSION=nux_major_version
59
NUX_MINOR_VERSION=nux_minor_version
60
NUX_MICRO_VERSION=nux_micro_version
61
NUX_VERSION=nux_version
62
NUX_API_VERSION=nux_api_version
63
AC_SUBST(NUX_MAJOR_VERSION)
64
AC_SUBST(NUX_MINOR_VERSION)
65
AC_SUBST(NUX_MICRO_VERSION)
67
AC_SUBST(NUX_API_VERSION)
69
m4_define([lt_current],
70
[m4_eval(100 * nux_minor_version + nux_micro_version - nux_interface_age)])
71
m4_define([lt_revision], [nux_interface_age])
72
m4_define([lt_age], [m4_eval(nux_binary_age - nux_interface_age)])
73
NUX_LT_CURRENT=lt_current
74
NUX_LT_REV=lt_revision
76
NUX_LT_VERSION="$NUX_LT_CURRENT:$NUX_LT_REV:$NUX_LT_AGE"
77
NUX_LT_LDFLAGS="-version-info $NUX_LT_VERSION"
79
AC_SUBST(NUX_LT_VERSION)
80
AC_SUBST(NUX_LT_LDFLAGS)
82
dnl ===========================================================================
88
# require libtool >= 2.2
90
LT_INIT([disable-static])
92
# Checks for header files
95
# Checks for typedefs, structures and compiler charecteristics
98
# Checks for library functions
101
AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
105
dnl ===========================================================================
107
PKG_CHECK_MODULES(NUX_CORE, glib-2.0 >= 2.25.14)
108
AC_SUBST(NUX_CORE_CFLAGS)
109
AC_SUBST(NUX_CORE_LIBS)
111
dnl ===========================================================================
113
if test "x$GCC" = "xyes"; then
118
# use strict compiler flags only on development releases
119
m4_define([maintainer_flags_default], [m4_if(m4_eval(nux_minor_version % 2), [1], [yes], [no])])
120
AC_ARG_ENABLE([maintainer-flags],
121
[AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
122
[Use strict compiler flags @<:@default=no@:>@])],
124
[enable_maintainer_flags=maintainer_flags_default])
127
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
129
MAINTAINER_CFLAGS="-Werror -Wall -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
133
AC_SUBST(MAINTAINER_CFLAGS)
135
dnl ===========================================================================
149
echo " Prefix : ${prefix}"