-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
181 lines (148 loc) · 6.06 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([mcabber],[0.10.0-dev],[[email protected]])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config-modules.h])
AC_PROG_LIBTOOL
AC_PROG_RANLIB
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
if test "x$GCC" = "xyes"; then
dnl Get gcc version
AC_MSG_CHECKING([gcc version])
gccver=$($CC -dumpversion)
gccvermajor=$(echo $gccver | cut -d . -f1)
gccverminor=$(echo $gccver | cut -d . -f2)
gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor)
AC_MSG_RESULT($gccver)
CFLAGS="$CFLAGS -Wall"
if test x"$gccvermajor" = x"4" -a x"$gccverminor" = x"2"; then
DBGCFLAGS="-fgnu89-inline"
fi
fi
AC_SYS_LARGEFILE
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \
stdlib.h string.h strings.h sys/socket.h sys/time.h \
syslog.h termios.h wchar.h wctype.h localcharset.h])
AC_CHECK_HEADERS([unistd.h], , AC_MSG_ERROR([Missing header file]))
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([alarm arc4random bzero gethostbyname gethostname inet_ntoa \
isascii memmove memset modf select setlocale socket strcasecmp \
strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \
iswblank])
PKG_CHECK_MODULES(MCABBER, mcabber >= 0.10.0)
# Check for glib
AM_PATH_GLIB_2_0(2.14.0,
[AC_DEFINE([HAVE_GLIB_REGEX], 1,
[Define if GLib has regex support])],
[AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),
[g_list_append], ["$gmodule_module"])],
[g_regex_new "$gmodule_module"])
PKG_CHECK_MODULES(GMODULES, gmodule-2.0)
AC_ARG_ENABLE(debug,
[AC_HELP_STRING(--enable-debug, add development compilation options)],
debug=$enableval, debug="")
if test x"${debug}" = x"yes"; then
AC_DEFINE_UNQUOTED([ENABLE_DEBUG],[1],[Devel compilation options])
if test "x$GCC" = "xyes"; then
if test "$gccvernum" -ge "400"; then
CFLAGS="$CFLAGS -Wextra"
else
CFLAGS="$CFLAGS -W"
fi
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0"
fi # gcc
CFLAGS="$CFLAGS -g"
else
CFLAGS="-O2 $CFLAGS"
fi
# We need _GNU_SOURCE for strptime() and strcasestr()
CFLAGS="$CFLAGS -D_GNU_SOURCE"
AC_ARG_ENABLE(all-modules,
AC_HELP_STRING([--enable-all-modules], [enable all modules]),
enable_all_modules=$enableval)
AC_ARG_ENABLE(module-clock,
AC_HELP_STRING([--enable-module-clock],
[enable module clock]),
enable_module_clock=$enableval)
AC_ARG_ENABLE(module-comment,
AC_HELP_STRING([--enable-module-comment],
[enable module comment]),
enable_module_comment=$enableval)
AC_ARG_ENABLE(module-extsayng,
AC_HELP_STRING([--enable-module-extsayng],
[enable module extsayng]),
enable_module_extsayng=$enableval)
AC_ARG_ENABLE(module-ignore_auth,
AC_HELP_STRING([--enable-module-ignore_auth],
[enable module ignore_auth]),
enable_module_ignore_auth=$enableval)
AC_ARG_ENABLE(module-info_msgcount,
AC_HELP_STRING([--enable-module-info_msgcount],
[enable module info_msgcount]),
enable_module_info_msgcount=$enableval)
AC_ARG_ENABLE(module-killpresence,
AC_HELP_STRING([--enable-module-killpresence],
[enable module killpresence]),
enable_module_lastmsg=$enableval)
AC_ARG_ENABLE(module-lastmsg,
AC_HELP_STRING([--enable-module-lastmsg],
[enable module lastmsg]),
enable_module_lastmsg=$enableval)
AC_ARG_ENABLE(module-show_mdr,
AC_HELP_STRING([--enable-module-show_mdr],
[enable module show_mdr]),
enable_module_show_mdr=$enableval)
AM_CONDITIONAL([INSTALL_MODULE_CLOCK],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_clock}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_COMMENT],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_comment}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_EXTSAYNG],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_extsayng}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_IGNORE_AUTH],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_ignore_auth}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_INFO_MSGCOUNT],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_info_msgcount}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_KILLPRESENCE],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_killpresence}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_LASTMSG],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_lastmsg}" = x"yes"])
AM_CONDITIONAL([INSTALL_MODULE_SHOW_MDR],
[test x"${enable_all_modules}" = x"yes" -o \
x"${enable_module_show_mdr}" = x"yes"])
AC_CONFIG_FILES([clock/Makefile
comment/Makefile
extsay-ng/Makefile
ignore_auth/Makefile
info_msgcount/Makefile
killpresence/Makefile
lastmsg/Makefile
show_mdr/Makefile
Makefile])
AC_OUTPUT