Mercurial > ~mikael > mcabber > hg
comparison mcabber/configure.ac @ 1089:a61c3311a5bb
Hopefully fix unicode detection on BSD systems
The ncurses library's unicode support wasn't correctly detected on some
systems (FreeBSD for example).
This patch adds a HAVE_UNICODE define with autoconf.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 07 Dec 2006 21:18:48 +0100 |
parents | b6c6734a781b |
children | 8188037a9e2a |
comparison
equal
deleted
inserted
replaced
1088:c55b24818546 | 1089:a61c3311a5bb |
---|---|
5 AC_INIT([mcabber],[0.8.4-dev],[mcabber@lilotux.net]) | 5 AC_INIT([mcabber],[0.8.4-dev],[mcabber@lilotux.net]) |
6 AM_INIT_AUTOMAKE | 6 AM_INIT_AUTOMAKE |
7 AC_CONFIG_SRCDIR([src]) | 7 AC_CONFIG_SRCDIR([src]) |
8 AM_CONFIG_HEADER(config.h) | 8 AM_CONFIG_HEADER(config.h) |
9 | 9 |
10 AC_PROG_LIBTOOL | 10 #AC_PROG_LIBTOOL |
11 AC_PROG_RANLIB | |
11 | 12 |
12 # Checks for programs. | 13 # Checks for programs. |
13 AC_PROG_CC | 14 AC_PROG_CC |
14 AC_PROG_INSTALL | 15 AC_PROG_INSTALL |
15 | 16 |
22 gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) | 23 gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor) |
23 AC_MSG_RESULT($gccver) | 24 AC_MSG_RESULT($gccver) |
24 | 25 |
25 CFLAGS="$CFLAGS -Wall" | 26 CFLAGS="$CFLAGS -Wall" |
26 fi | 27 fi |
27 | |
28 # Checks for libraries. | |
29 | |
30 AC_CHECK_FUNC(initscr,, | |
31 [ | |
32 cf_ncurses="ncurses" | |
33 for lib in ncursesw ncurses | |
34 do | |
35 AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break]) | |
36 done | |
37 AC_CHECK_LIB($cf_ncurses, initscr, | |
38 [LIBS="$LIBS -l$cf_ncurses" | |
39 if test "$cf_ncurses" = ncursesw; then | |
40 AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/panel.h],, | |
41 [AC_CHECK_HEADERS([ncurses.h panel.h],, | |
42 AC_MSG_ERROR([Missing header file]))]) | |
43 else | |
44 AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],, | |
45 [AC_CHECK_HEADERS([ncurses.h panel.h],, | |
46 AC_MSG_ERROR([Missing header file]))]) | |
47 fi | |
48 ], | |
49 [CF_CURSES_LIBS]) | |
50 ]) | |
51 | |
52 AC_CHECK_LIB([panelw], [new_panel],, | |
53 AC_CHECK_LIB([panel], [new_panel]) | |
54 ) | |
55 | |
56 AC_CHECK_DECLS([strptime],,, | |
57 [#define _GNU_SOURCE | |
58 #include <time.h>]) | |
59 | 28 |
60 # Checks for header files. | 29 # Checks for header files. |
61 AC_HEADER_STDC | 30 AC_HEADER_STDC |
62 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ | 31 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ |
63 stdlib.h string.h strings.h sys/socket.h sys/time.h \ | 32 stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
84 AC_FUNC_VPRINTF | 53 AC_FUNC_VPRINTF |
85 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii \ | 54 AC_CHECK_FUNCS([alarm bzero gethostbyname gethostname inet_ntoa isascii \ |
86 memmove memset modf select setlocale socket strcasecmp \ | 55 memmove memset modf select setlocale socket strcasecmp \ |
87 strchr strdup strncasecmp strrchr strstr strcasestr]) | 56 strchr strdup strncasecmp strrchr strstr strcasestr]) |
88 | 57 |
58 | |
59 AC_CHECK_DECLS([strptime],,, | |
60 [#define _GNU_SOURCE | |
61 #include <time.h>]) | |
62 | |
89 # Check for tm_gmtoff | 63 # Check for tm_gmtoff |
90 MC_TM_GMTOFF | 64 MC_TM_GMTOFF |
65 | |
66 # Checks for libraries. | |
67 | |
68 AC_CHECK_FUNC(initscr,, | |
69 [ | |
70 cf_ncurses="ncurses" | |
71 for lib in ncursesw ncurses | |
72 do | |
73 AC_CHECK_LIB($lib, waddnwstr, | |
74 [cf_ncurses="$lib"; cf_ncurses_unicode="yes"; break]) | |
75 done | |
76 AC_CHECK_LIB($cf_ncurses, initscr, | |
77 [LIBS="$LIBS -l$cf_ncurses" | |
78 if test "$cf_ncurses" = ncursesw; then | |
79 AC_CHECK_HEADERS([ncursesw/ncurses.h ncursesw/panel.h],, | |
80 [AC_CHECK_HEADERS([ncurses.h panel.h],, | |
81 AC_MSG_ERROR([Missing header file]))]) | |
82 else | |
83 AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],, | |
84 [AC_CHECK_HEADERS([ncurses.h panel.h],, | |
85 AC_MSG_ERROR([Missing header file]))]) | |
86 fi | |
87 ], | |
88 [CF_CURSES_LIBS]) | |
89 ]) | |
90 | |
91 AC_CHECK_LIB([panelw], [new_panel],, | |
92 AC_CHECK_LIB([panel], [new_panel]) | |
93 ) | |
94 | |
95 if test x"$cf_ncurses_unicode" = x"yes"; then | |
96 AC_DEFINE([HAVE_UNICODE], [], [Define if ncurses have unicode support]) | |
97 else | |
98 AC_MSG_WARN([Your ncurses installation does not support unicode]) | |
99 fi | |
91 | 100 |
92 # Check for glib | 101 # Check for glib |
93 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) | 102 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append]) |
94 | 103 |
95 # Check for gpgme | 104 # Check for gpgme |