-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
109 lines (97 loc) · 2.82 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
# Process this file with autoconf to create configure.
AC_PREREQ([2.65])
# ====================
# Version informations
# ====================
m4_define([mythes_version_major],[1])
m4_define([mythes_version_minor],[2])
m4_define([mythes_version_micro],[6])
m4_define([mythes_version],[mythes_version_major.mythes_version_minor.mythes_version_micro])
# =============
# Automake init
# =============
AC_INIT([mythes],[mythes_version])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LANG([C++])
# ===========================
# Find required base packages
# ===========================
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
LT_INIT([win32-dll disable-static pic-only])
AC_CANONICAL_HOST
# =================================
# Libtool/Version Makefile settings
# =================================
AC_SUBST(MYTHES_MAJOR_VERSION, [mythes_version_major])
AC_SUBST(MYTHES_MINOR_VERSION, [mythes_version_minor])
AC_SUBST(MYTHES_MICRO_VERSION, [mythes_version_micro])
AC_SUBST(MYTHES_VERSION, [mythes_version])
# Libtool information
# Bump current when changing interfaces and null others
# Bump revision if there was any code change
# Bump age if interfaces were only added and no other change was done
AC_SUBST(LT_CURRENT, [0])
AC_SUBST(LT_REVISION, [0])
AC_SUBST(LT_AGE, [0])
# ===============
# Find librevenge
# ===============
PKG_CHECK_MODULES([HUNSPELL],[
hunspell
])
AC_SUBST([HUNSPELL_CFLAGS])
AC_SUBST([HUNSPELL_LIBS])
# ================
# Check for cflags
# ================
AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--disable-werror], [Treat all warnings as errors,
usefull for development])],
[enable_werror="$enableval"],
[enable_werror=yes]
)
AS_IF([test x"$enable_werror" != "xno"], [
CFLAGS="$CFLAGS -Werror"
CXXFLAGS="$CXXFLAGS -Werror"
])
# ============
# Debug switch
# ============
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Turn on debugging])],
[enable_debug="$enableval"],
[enable_debug=no]
)
AS_IF([test "x$enable_debug" = "xyes"], [
DEBUG_CXXFLAGS="-DDEBUG -g"
], [
DEBUG_CXXFLAGS="-DNDEBUG"
])
AC_SUBST(DEBUG_CXXFLAGS)
# =====================
# Prepare all .in files
# =====================
AC_CONFIG_FILES([
Makefile
mythes.pc
])
AC_OUTPUT
# ==============================================
# Display final informations about configuration
# ==============================================
AC_MSG_NOTICE([
==============================================================================
Build configuration:
debug: ${enable_debug}
werror: ${enable_werror}
==============================================================================
])