-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigure.ac
135 lines (113 loc) · 4.04 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
AC_PREREQ([2.59])
# Making releases:
# set the new version number:
# odd minor -> development series
# even minor -> stable series
# increment micro for each release within a series
# set nano_version to 0
# make the release, tag it
# set nano_version to 1
m4_define([openglucose_major_version], [0])
m4_define([openglucose_minor_version], [0])
m4_define([openglucose_micro_version], [0])
m4_define([openglucose_nano_version], [1])
# Some magic
m4_define([openglucose_base_version],
[openglucose_major_version.openglucose_minor_version.openglucose_micro_version])
m4_define([openglucose_version],
[m4_if(openglucose_nano_version, 0, [openglucose_base_version],
[openglucose_base_version].[openglucose_nano_version])])
AC_INIT([OpenGlucose], [openglucose_version], [])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([1.11 -Wno-portability foreign subdir-objects])
AC_CONFIG_HEADERS(config.h)
AM_SILENT_RULES
dnl check for tools
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_INSTALL
LT_INIT
AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG([0.21])
OPENGLUCOSE_MAJOR_VERSION=openglucose_major_version
OPENGLUCOSE_MINOR_VERSION=openglucose_minor_version
OPENGLUCOSE_MICRO_VERSION=openglucose_micro_version
AC_SUBST([OPENGLUCOSE_MAJOR_VERSION])
AC_SUBST([OPENGLUCOSE_MINOR_VERSION])
AC_SUBST([OPENGLUCOSE_MICRO_VERSION])
dnl optimizations, etc.
COMPILER_OPTIMISATIONS
COMPILER_COVERAGE
LINKER_OPTIMISATIONS
LINKER_VERSION_SCRIPT
ifelse(openglucose_nano_version, 0,
[ # openglucose is version x.y.z - "official release",
# disable extra checks by default
official_release=yes
AC_ARG_ENABLE([fatal-warnings],
[AS_HELP_STRING([--enable-fatal-warnings],
[make various warnings fatal])],
[],
[enable_fatal_warnings=no])
],
[ # openglucose is version x.y.z.1 - development snapshot,
# enable extra checks by default
official_release=no
AC_ARG_ENABLE([fatal-warnings],
[AS_HELP_STRING([--disable-fatal-warnings],
[make various warnings non-fatal])],
[],
[enable_fatal_warnings=yes])
])
AC_SUBST([enable_fatal_warnings])
TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$enable_fatal_warnings" = xyes],
[all \
extra \
declaration-after-statement \
shadow \
strict-prototypes \
missing-prototypes \
sign-compare \
nested-externs \
pointer-arith \
format-security \
init-self],
[missing-field-initializers \
unused-parameter])
AC_SUBST([ERROR_CFLAGS])
GLIB_REQUIRED=2.40.0
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_40], [Ignore post 2.40 deprecations])
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_40], [Prevent post 2.40 APIs])
GUSB_REQUIRED=0.2.2
GTK_REQUIRED=3.16
AC_DEFINE([GTK_VERSION_MIN_REQUIRED], [GLIB_VERSION_3_16], [Ignore post 3.16 deprecations])
AC_DEFINE([GTK_VERSION_MAX_ALLOWED], [GLIB_VERSION_3_16], [Prevent post 3.16 APIs])
WEBKIT_REQUIRED=2.4.3
PKG_CHECK_MODULES(OPENGLUCOSE,
[
glib-2.0 >= $GLIB_REQUIRED
gobject-2.0 >= $GLIB_REQUIRED
gio-2.0 >= $GLIB_REQUIRED
gusb >= $GUSB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
webkit2gtk-3.0 >= WEBKIT_REQUIRED
])
# Only use this where we really do want things to depend on whether it's
# a release or not (like ABI-stability enforcement). For fatal warnings,
# use ${enable_fatal_warnings} instead.
AM_CONDITIONAL([OFFICIAL_RELEASE], [test "x$official_release" = xyes])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--disable-debug],[compile without debug code (note that this will disable much of the debug code in all GLib connection managers)]),
enable_debug=$enableval, enable_debug=yes )
AS_IF([test x$enable_debug = xyes],
[AC_DEFINE([ENABLE_DEBUG], [], [Enable debug code])])
AC_MSG_CHECKING([for udev directory])
PKG_CHECK_VAR([UDEV_DIR], [udev], [udevdir], ,
AC_MSG_FAILURE([Unable to find udev directory path.]))
AC_MSG_RESULT([$UDEV_DIR])
AC_MSG_CHECKING([for glib_compile_resources])
PKG_CHECK_VAR([GLIB_COMPILE_RESOURCES], [gio-2.0], [glib_compile_resources], ,
AC_MSG_FAILURE([Unable to find glib_compile_resources]))
AC_MSG_RESULT([found])
AC_OUTPUT(Makefile)