author | Mikael Berthe <mikael@lilotux.net> |
Sun, 07 Mar 2010 14:51:10 +0100 | |
changeset 1 | 99fd216641d8 |
parent 0 | d6d9e95a4ae5 |
child 2 | b6516e8751bb |
permissions | -rw-r--r-- |
0 | 1 |
# -*- Autoconf -*- |
2 |
# Process this file with autoconf to produce a configure script. |
|
3 |
||
4 |
AC_PREREQ(2.59) |
|
1
99fd216641d8
Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
0
diff
changeset
|
5 |
AC_INIT([mcabber-modules],[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 |
||
63 |
# Check for glib |
|
64 |
AM_PATH_GLIB_2_0(2.14.0, |
|
65 |
[AC_DEFINE([HAVE_GLIB_REGEX], 1, |
|
66 |
[Define if GLib has regex support])], |
|
67 |
[AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]), |
|
68 |
[g_list_append], ["$gmodule_module"])], |
|
69 |
[g_regex_new "$gmodule_module"]) |
|
70 |
||
71 |
# Export $libexecdir to the source tree |
|
72 |
AC_DEFINE_DIR(PKGLIB_DIR, "${libdir}/${PACKAGE}", [Modules directory]) |
|
73 |
||
74 |
AC_ARG_ENABLE(debug, |
|
75 |
[AC_HELP_STRING(--enable-debug, add development compilation options)], |
|
76 |
debug=$enableval, debug="") |
|
77 |
if test x"${debug}" = x"yes"; then |
|
78 |
AC_DEFINE_UNQUOTED([ENABLE_DEBUG],[1],[Devel compilation options]) |
|
79 |
if test "x$GCC" = "xyes"; then |
|
80 |
if test "$gccvernum" -ge "400"; then |
|
81 |
CFLAGS="$CFLAGS -Wextra" |
|
82 |
else |
|
83 |
CFLAGS="$CFLAGS -W" |
|
84 |
fi |
|
85 |
CFLAGS="$CFLAGS -Wno-unused-parameter -pedantic -std=gnu99 $DBGCFLAGS -O0" |
|
86 |
fi # gcc |
|
87 |
CFLAGS="$CFLAGS -g" |
|
88 |
else |
|
89 |
CFLAGS="-O2 $CFLAGS" |
|
90 |
fi |
|
91 |
||
92 |
# We need _GNU_SOURCE for strptime() and strcasestr() |
|
93 |
CFLAGS="$CFLAGS -D_GNU_SOURCE" |
|
94 |
||
1
99fd216641d8
Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
0
diff
changeset
|
95 |
AC_CONFIG_FILES([comment/Makefile |
99fd216641d8
Add module "comment", autotools stuff...
Mikael Berthe <mikael@lilotux.net>
parents:
0
diff
changeset
|
96 |
extsay/Makefile |
0 | 97 |
Makefile]) |
98 |
AC_OUTPUT |