Mercurial > pidgin
annotate console/libgnt/configure.ac @ 14110:5cefeb370262
[gaim-migrate @ 16744]
Code re-use!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 14 Aug 2006 06:27:04 +0000 |
parents | 61ba85cf05a6 |
children | c18bdf510325 |
rev | line source |
---|---|
13891
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 dnl Process this file with autoconf to produce a configure script. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 AC_INIT([libgnt], [0.0.0dev], [gaim-devel@lists.sourceforge.net]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 AC_CANONICAL_SYSTEM |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 AM_CONFIG_HEADER(config.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 AC_PREREQ([2.50]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 AC_PATH_PROG(sedpath, sed) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 dnl Storing configure arguments |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 dnl Checks for programs. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 AC_PROG_CC |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 AC_DISABLE_STATIC |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 AM_PROG_LIBTOOL |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 LIBTOOL="$LIBTOOL --silent" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 AC_PROG_INSTALL |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 dnl we don't use autobreak on cygwin!! |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 dnl AC_CYGWIN |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 dnl Checks for header files. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 AC_HEADER_STDC |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 AC_HEADER_SYS_WAIT |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 AC_CHECK_HEADERS(arpa/nameser_compat.h fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h regex.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 dnl Checks for typedefs, structures, and compiler characteristics. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 AC_C_CONST |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 AC_STRUCT_TM |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 AC_C_BIGENDIAN |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 dnl Checks for library functions. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 AC_TYPE_SIGNAL |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 AC_FUNC_STRFTIME |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 AC_CHECK_FUNCS(strdup strstr atexit setlocale) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
39 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 dnl Check for inet_aton |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, , |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 [AC_ERROR(inet_aton not found)])]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 AC_CHECK_LIB(resolv, __res_query) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 AC_CHECK_LIB(nsl, gethostent) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 AC_CHECK_FUNC(socket, , |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 [AC_CHECK_LIB(socket, socket, , [AC_ERROR([socket not found])])]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 dnl If all goes well, by this point the previous two checks will have |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 dnl pulled in -lsocket and -lnsl if we need them. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE([HAVE_GETADDRINFO], [1], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 [Define to 1 if you have the getaddrinfo function.])], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 [AC_CHECK_LIB(socket, getaddrinfo, |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 [AC_DEFINE([HAVE_GETADDRINFO]) LIBS="-lsocket -lsnl $LIBS"], , , -lnsl)]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 dnl Check for socklen_t (in Unix98) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 AC_MSG_CHECKING(for socklen_t) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 AC_TRY_COMPILE([ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 #include <sys/types.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 #include <sys/socket.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 socklen_t x; |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 ], [], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 AC_MSG_RESULT(yes) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 AC_TRY_COMPILE([ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 #include <sys/types.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 #include <sys/socket.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 int accept(int, struct sockaddr *, size_t *); |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 ], [], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 AC_MSG_RESULT(size_t) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 AC_DEFINE(socklen_t, size_t, [socklen_t size]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 AC_MSG_RESULT(int) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 AC_DEFINE(socklen_t, int, [socklen_t size]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 dnl to prevent the g_stat()/g_unlink() crash, |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 AC_SYS_LARGEFILE |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 dnl FreeBSD doesn't have libdl, dlopen is provided by libc |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 AC_CHECK_FUNC(dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 AC_MSG_CHECKING(for the %z format string in strftime()) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 AC_TRY_RUN([ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 #ifdef HAVE_SYS_TIME_H |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 #include <sys/time.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 #endif |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 #include <time.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
90 #include <stdio.h> |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 int main() |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 { |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 char buf[6]; |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 time_t t = time(NULL); |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 return 1; |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf); |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 return !((buf[0] == '-' || buf[0] == '+') && |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
103 (buf[1] >= '0' && buf[1] <= '9') && |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
104 (buf[2] >= '0' && buf[2] <= '9') && |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
105 (buf[3] >= '0' && buf[3] <= '9') && |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
106 (buf[4] >= '0' && buf[4] <= '9') |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
107 ); |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
108 } |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
109 ], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
110 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
111 AC_MSG_RESULT(yes) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
112 AC_DEFINE([HAVE_STRFTIME_Z_FORMAT], [1], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 [Define to 1 if you have a strftime() that supports the %z format string.]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 ], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 AC_MSG_RESULT(no) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
117 ], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
118 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 # Fallback for Cross Compiling... |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 # This will enable the compatibility code. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 AC_MSG_RESULT(no) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 ] |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 ) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
124 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
126 AC_CHECK_HEADER(sys/utsname.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
127 AC_CHECK_FUNC(uname) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 if test "x$enable_debug" = "xyes" ; then |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 enable_fatal_asserts="yes" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
132 fi |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 if test "x$enable_fatal_asserts" = "xyes" ; then |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
135 AC_DEFINE(GAIM_FATAL_ASSERTS, 1, [Define to make assertions fatal (useful for debugging).]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
136 fi |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
137 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
138 if test "x$enable_deprecated" = "xno"; then |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
139 DEBUG_CFLAGS="$DEBUG_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
140 fi |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
141 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
142 if test "x$GCC" = "xyes"; then |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
143 dnl We enable -Wall later. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
144 dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
145 dnl This leads to warnings we don't want. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
146 CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'` |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
147 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
148 dnl ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
149 dnl |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
150 dnl Future Possibilities |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
151 dnl |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
152 dnl Consider adding -Wbad-function-cast. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
153 dnl This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
154 dnl We'd need an intermediate variable. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
155 dnl |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
156 dnl Consider adding -Wfloat-equal. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
157 dnl This leads to warnings with Perl. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
158 dnl Perhaps we could write ugly configure magic and pass -Wno-float-equal down to that subdirectory. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
159 dnl On the other hand, it's probably actually broken, so maybe the Perl folks should fix that? |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
160 dnl |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
161 dnl Consider removing -Wno-sign-compare (from the -Wextra set) and fixing all those cases. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
162 dnl This is likely non-trivial. |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
163 dnl |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
164 for newflag in \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
165 "-Waggregate-return" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
166 "-Wcast-align" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
167 "-Wdeclaration-after-statement" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
168 "-Werror-implicit-function-declaration" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
169 "-Wextra -Wno-sign-compare -Wno-unused-parameter" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
170 "-Winit-self" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
171 "-Wmissing-declarations" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
172 "-Wmissing-prototypes" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
173 "-Wnested-externs" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
174 "-Wpointer-arith" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
175 "-Wundef" \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
176 ; do |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
177 orig_CFLAGS="$CFLAGS" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
178 CFLAGS="$CFLAGS $newflag" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
179 AC_MSG_CHECKING(for $newflag option to gcc) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
180 AC_TRY_COMPILE([], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
181 int main() {return 0;} |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
182 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
183 AC_MSG_RESULT(yes) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
184 CFLAGS="$orig_CFLAGS" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
185 DEBUG_CFLAGS="$DEBUG_CFLAGS $newflag" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
186 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
187 AC_MSG_RESULT(no) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
188 CFLAGS="$orig_CFLAGS" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
189 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
190 done |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
191 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
192 if test "x$enable_fortify" = "xyes"; then |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
193 AC_MSG_CHECKING(for FORTIFY_SOURCE support) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
194 AC_TRY_COMPILE([#include <features.h>], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
195 int main() { |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
196 #if !(__GNUC_PREREQ (4, 1) \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
197 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
198 || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
199 && __GNUC_MINOR__ == 4 \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
200 && (__GNUC_PATCHLEVEL__ > 2 \ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
201 || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8)))) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
202 #error No FORTIFY_SOURCE support |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
203 #endif |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
204 return 0; |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
205 } |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
206 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
207 AC_MSG_RESULT(yes) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
208 DEBUG_CFLAGS="$DEBUG_CFLAGS -D_FORTIFY_SOURCE=2" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
209 ], [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
210 AC_MSG_RESULT(no) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
211 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
212 fi |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
213 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
214 DEBUG_CFLAGS="-Wall $DEBUG_CFLAGS" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
215 CFLAGS="-g $CFLAGS" |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
216 fi |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
217 AC_SUBST(CFLAGS) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
218 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
219 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.0 gobject-2.0 gmodule-2.0], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
220 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
221 AC_SUBST(GLIB_CFLAGS) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
222 AC_SUBST(GLIB_LIBS) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
223 ], |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
224 [ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
225 AC_MSG_ERROR([ |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
226 *** GLib 2.0 is required to build Gaim; please make sure you have the GLib |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
227 *** development headers installed. The latest version of GLib is |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
228 *** always available at http://www.gtk.org/.]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
229 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
230 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
231 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
232 AC_MSG_CHECKING(for me pot o' gold) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
233 AC_MSG_RESULT(no) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
234 AC_CHECK_FUNCS(gethostid lrand48) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
235 AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
236 AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
237 AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
238 AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
239 AC_CHECK_HEADERS(termios.h) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
240 #AC_VAR_TIMEZONE_EXTERNALS |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
241 |
13918
61ba85cf05a6
[gaim-migrate @ 16421]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
13904
diff
changeset
|
242 AC_CHECK_LIB(ncursesw, initscr, , [AC_MSG_ERROR([ |
61ba85cf05a6
[gaim-migrate @ 16421]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
13904
diff
changeset
|
243 *** You need ncursesw. ])]) |
13891
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
244 |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
245 AC_OUTPUT([Makefile |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
246 gnt.pc |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
247 ]) |
da1046158b3b
[gaim-migrate @ 16374]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
248 |