author | Mikael Berthe <mikael@lilotux.net> |
Sun, 04 Apr 2010 16:08:15 +0200 | |
changeset 35 | 337add12c399 |
parent 34 | 105fdf20c1c1 |
child 38 | 3dad6bd6cde2 |
permissions | -rw-r--r-- |
0 | 1 |
# -*- Autoconf -*- |
2 |
# Process this file with autoconf to produce a configure script. |
|
3 |
||
4 |
AC_PREREQ(2.59) |
|
4 | 5 |
AC_INIT([mcabber],[0.10.0-dev],[mcabber@lilotux.net]) |
0 | 6 |
AM_INIT_AUTOMAKE |
1
99fd216641d8
Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
0
diff
changeset
|
7 |
AM_CONFIG_HEADER([config-modules.h]) |
0 | 8 |
|
9 |
AC_PROG_LIBTOOL |
|
10 |
AC_PROG_RANLIB |
|
11 |
||
12 |
# Checks for programs. |
|
13 |
AC_PROG_CC |
|
14 |
AC_PROG_INSTALL |
|
15 |
||
16 |
if test "x$GCC" = "xyes"; then |
|
17 |
dnl Get gcc version |
|
18 |
AC_MSG_CHECKING([gcc version]) |
|
19 |
gccver=$($CC -dumpversion) |
|
20 |
gccvermajor=$(echo $gccver | cut -d . -f1) |
|
21 |
gccverminor=$(echo $gccver | cut -d . -f2) |
|
22 |
gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) |
|
23 |
AC_MSG_RESULT($gccver) |
|
24 |
||
25 |
CFLAGS="$CFLAGS -Wall" |
|
26 |
if test x"$gccvermajor" = x"4" -a x"$gccverminor" = x"2"; then |
|
27 |
DBGCFLAGS="-fgnu89-inline" |
|
28 |
fi |
|
29 |
fi |
|
30 |
||
31 |
AC_SYS_LARGEFILE |
|
32 |
||
33 |
# Checks for header files. |
|
34 |
AC_HEADER_STDC |
|
35 |
AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ |
|
36 |
stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
|
37 |
syslog.h termios.h wchar.h wctype.h localcharset.h]) |
|
38 |
AC_CHECK_HEADERS([unistd.h], , AC_MSG_ERROR([Missing header file])) |
|
39 |
||
40 |
# Checks for typedefs, structures, and compiler characteristics. |
|
41 |
AC_HEADER_STDBOOL |
|
42 |
AC_C_CONST |
|
43 |
AC_C_INLINE |
|
44 |
AC_TYPE_SIZE_T |
|
45 |
AC_HEADER_TIME |
|
46 |
AC_STRUCT_TM |
|
47 |
||
48 |
# Checks for library functions. |
|
49 |
AC_FUNC_ERROR_AT_LINE |
|
50 |
AC_FUNC_MALLOC |
|
51 |
AC_FUNC_MEMCMP |
|
52 |
AC_FUNC_REALLOC |
|
53 |
AC_FUNC_SELECT_ARGTYPES |
|
54 |
AC_TYPE_SIGNAL |
|
55 |
AC_FUNC_STRFTIME |
|
56 |
AC_FUNC_VPRINTF |
|
57 |
AC_CHECK_FUNCS([alarm arc4random bzero gethostbyname gethostname inet_ntoa \ |
|
58 |
isascii memmove memset modf select setlocale socket strcasecmp \ |
|
59 |
strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \ |
|
60 |
iswblank]) |
|
61 |
||
62 |
||
4 | 63 |
PKG_CHECK_MODULES(MCABBER, mcabber >= 0.10.0) |
64 |
||
0 | 65 |
# Check for glib |
66 |
AM_PATH_GLIB_2_0(2.14.0, |
|
67 |
[AC_DEFINE([HAVE_GLIB_REGEX], 1, |
|
68 |
[Define if GLib has regex support])], |
|
69 |
[AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]), |
|
70 |
[g_list_append], ["$gmodule_module"])], |
|
71 |
[g_regex_new "$gmodule_module"]) |
|
72 |
||
4 | 73 |
PKG_CHECK_MODULES(GMODULES, gmodule-2.0) |
0 | 74 |
|
75 |
AC_ARG_ENABLE(debug, |
|
76 |
[AC_HELP_STRING(--enable-debug, add development compilation options)], |
|
77 |
debug=$enableval, debug="") |
|
78 |
if test x"${debug}" = x"yes"; then |
|
79 |
AC_DEFINE_UNQUOTED([ENABLE_DEBUG],[1],[Devel compilation options]) |
|
80 |
if test "x$GCC" = "xyes"; then |
|
81 |
if test "$gccvernum" -ge "400"; then |
|
82 |
CFLAGS="$CFLAGS -Wextra" |
|
83 |
else |
|
84 |
CFLAGS="$CFLAGS -W" |
|
85 |
fi |
|
86 |
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0" |
|
87 |
fi # gcc |
|
88 |
CFLAGS="$CFLAGS -g" |
|
89 |
else |
|
90 |
CFLAGS="-O2 $CFLAGS" |
|
91 |
fi |
|
92 |
||
93 |
# We need _GNU_SOURCE for strptime() and strcasestr() |
|
94 |
CFLAGS="$CFLAGS -D_GNU_SOURCE" |
|
95 |
||
4 | 96 |
AC_ARG_ENABLE(all-modules, |
97 |
AC_HELP_STRING([--enable-all-modules], [enable all modules]), |
|
2
b6516e8751bb
More autotools tweaking...
Mikael Berthe <mikael@lilotux.net>
parents:
1
diff
changeset
|
98 |
enable_all_modules=$enableval) |
b6516e8751bb
More autotools tweaking...
Mikael Berthe <mikael@lilotux.net>
parents:
1
diff
changeset
|
99 |
|
6 | 100 |
AC_ARG_ENABLE(module-clock, |
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
101 |
AC_HELP_STRING([--enable-module-clock], |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
102 |
[enable module clock]), |
6 | 103 |
enable_module_clock=$enableval) |
4 | 104 |
AC_ARG_ENABLE(module-comment, |
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
105 |
AC_HELP_STRING([--enable-module-comment], |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
106 |
[enable module comment]), |
4 | 107 |
enable_module_comment=$enableval) |
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
108 |
AC_ARG_ENABLE(module-extsayng, |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
109 |
AC_HELP_STRING([--enable-module-extsayng], |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
110 |
[enable module extsayng]), |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
111 |
enable_module_extsayng=$enableval) |
17 | 112 |
AC_ARG_ENABLE(module-info_msgcount, |
113 |
AC_HELP_STRING([--enable-module-info_msgcount], |
|
114 |
[enable module info_msgcount]), |
|
115 |
enable_module_info_msgcount=$enableval) |
|
19 | 116 |
AC_ARG_ENABLE(module-killpresence, |
117 |
AC_HELP_STRING([--enable-module-killpresence], |
|
118 |
[enable module killpresence]), |
|
119 |
enable_module_lastmsg=$enableval) |
|
10 | 120 |
AC_ARG_ENABLE(module-lastmsg, |
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
121 |
AC_HELP_STRING([--enable-module-lastmsg], |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
122 |
[enable module lastmsg]), |
10 | 123 |
enable_module_lastmsg=$enableval) |
4 | 124 |
|
6 | 125 |
AM_CONDITIONAL([INSTALL_MODULE_CLOCK], |
126 |
[test x"${enable_all_modules}" = x"yes" -o \ |
|
127 |
x"${enable_module_clock}" = x"yes"]) |
|
128 |
||
4 | 129 |
AM_CONDITIONAL([INSTALL_MODULE_COMMENT], |
130 |
[test x"${enable_all_modules}" = x"yes" -o \ |
|
131 |
x"${enable_module_comment}" = x"yes"]) |
|
132 |
||
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
133 |
AM_CONDITIONAL([INSTALL_MODULE_EXTSAYNG], |
4 | 134 |
[test x"${enable_all_modules}" = x"yes" -o \ |
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
135 |
x"${enable_module_extsayng}" = x"yes"]) |
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
136 |
|
17 | 137 |
AM_CONDITIONAL([INSTALL_MODULE_INFO_MSGCOUNT], |
138 |
[test x"${enable_all_modules}" = x"yes" -o \ |
|
139 |
x"${enable_module_info_msgcount}" = x"yes"]) |
|
140 |
||
19 | 141 |
AM_CONDITIONAL([INSTALL_MODULE_KILLPRESENCE], |
142 |
[test x"${enable_all_modules}" = x"yes" -o \ |
|
143 |
x"${enable_module_killpresence}" = x"yes"]) |
|
144 |
||
10 | 145 |
AM_CONDITIONAL([INSTALL_MODULE_LASTMSG], |
146 |
[test x"${enable_all_modules}" = x"yes" -o \ |
|
147 |
x"${enable_module_lastmsg}" = x"yes"]) |
|
148 |
||
6 | 149 |
AC_CONFIG_FILES([clock/Makefile |
150 |
comment/Makefile |
|
21
9798e3aaa851
Add module extsayng, rename previous one to extsay_old
Mikael Berthe <mikael@lilotux.net>
parents:
19
diff
changeset
|
151 |
extsay-ng/Makefile |
17 | 152 |
info_msgcount/Makefile |
19 | 153 |
killpresence/Makefile |
10 | 154 |
lastmsg/Makefile |
0 | 155 |
Makefile]) |
156 |
AC_OUTPUT |