~stolowski/nux/merge-trunk

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 16:03:10 UTC
  • Revision ID: neil.patel@canonical.com-20100901160310-qdeocg7lgu5f0agf
Initial autofoo

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Stolen unashamedly from Clutter. Here's how this goes down:
 
3
#
 
4
# api_version = The soname version "libnux-1.0.so"
 
5
# version = The package version "1.2.2"
 
6
 
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
 
11
#
 
12
# After the release:
 
13
#   - Increase micro_version to the next odd number
 
14
#   - Increase interface_version to the next odd number
 
15
 
16
m4_define([nux_major_version], [1])
 
17
m4_define([nux_minor_version], [1])
 
18
m4_define([nux_micro_version], [0])
 
19
 
 
20
# Bump this when we break ABI
 
21
m4_define([nux_api_version], [1.0])
 
22
 
 
23
m4_define([nux_version],
 
24
          [nux_major_version.nux_minor_version.nux_micro_version])
 
25
 
 
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:
 
29
#
 
30
#  (<minor> * 100 + <micro>) - <interface_age>
 
31
#
 
32
# this allows using the same soname for different micro-releases in case
 
33
# no API was added or deprecated. for instance:
 
34
#
 
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
 
42
#   ...
 
43
#
 
44
m4_define([nux_interface_age], [0])
 
45
m4_define([nux_binary_age],
 
46
          [m4_eval(100 * nux_minor_version + nux_micro_version)])
 
47
 
 
48
AC_PREREQ(2.59)
 
49
 
 
50
AC_INIT([nux],
 
51
        [nux_version],
 
52
        [https://bugs.launchpad.net/nux])
 
53
 
 
54
AC_CONFIG_SRCDIR([Makefile.am])
 
55
AM_CONFIG_HEADER([config.h])
 
56
AM_INIT_AUTOMAKE([1.10])
 
57
 
 
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)
 
66
AC_SUBST(NUX_VERSION)
 
67
AC_SUBST(NUX_API_VERSION)
 
68
 
 
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
 
75
NUX_LT_AGE=lt_age
 
76
NUX_LT_VERSION="$NUX_LT_CURRENT:$NUX_LT_REV:$NUX_LT_AGE"
 
77
NUX_LT_LDFLAGS="-version-info $NUX_LT_VERSION"
 
78
 
 
79
AC_SUBST(NUX_LT_VERSION)
 
80
AC_SUBST(NUX_LT_LDFLAGS)
 
81
 
 
82
dnl ===========================================================================
 
83
 
 
84
# Checks for programs
 
85
AC_PROG_CXX
 
86
AM_PROG_CC_C_O
 
87
 
 
88
# require libtool >= 2.2
 
89
LT_PREREQ([2.2.6])
 
90
LT_INIT([disable-static])
 
91
 
 
92
# Checks for header files
 
93
AC_HEADER_STDC
 
94
 
 
95
# Checks for typedefs, structures and compiler charecteristics
 
96
AC_C_CONST
 
97
 
 
98
# Checks for library functions
 
99
AC_FUNC_MALLOC
 
100
AC_FUNC_MMAP
 
101
AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
 
102
 
 
103
PKG_PROG_PKG_CONFIG
 
104
 
 
105
dnl ===========================================================================
 
106
 
 
107
PKG_CHECK_MODULES(NUX_CORE, glib-2.0 >= 2.25.14)
 
108
AC_SUBST(NUX_CORE_CFLAGS)
 
109
AC_SUBST(NUX_CORE_LIBS)
 
110
 
 
111
dnl ===========================================================================
 
112
 
 
113
if test "x$GCC" = "xyes"; then
 
114
  GCC_FLAGS="-g -Wall"
 
115
fi
 
116
AC_SUBST(GCC_FLAGS)
 
117
 
 
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@:>@])],
 
123
              [],
 
124
              [enable_maintainer_flags=maintainer_flags_default])
 
125
 
 
126
MAINTAINER_CFLAGS=""
 
127
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
 
128
      [
 
129
        MAINTAINER_CFLAGS="-Werror -Wall -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
 
130
      ]
 
131
)
 
132
 
 
133
AC_SUBST(MAINTAINER_CFLAGS)
 
134
 
 
135
dnl ===========================================================================
 
136
 
 
137
AC_CONFIG_FILES([
 
138
  Makefile
 
139
  data/Makefile
 
140
  tests/Makefile
 
141
])
 
142
 
 
143
AC_OUTPUT
 
144
 
 
145
echo ""
 
146
echo " Nux $VERSION"
 
147
echo " =========="
 
148
echo ""
 
149
echo " Prefix                   : ${prefix}"
 
150
echo ""