comparison mcabber/configure.ac @ 926:8a31dd49130d

configure: Improve ncurses detection (use ncursesw if available)
author Mikael Berthe <mikael@lilotux.net>
date Sun, 02 Jul 2006 23:20:07 +0200
parents a07bd351008b
children dcd6d23d7a13
comparison
equal deleted inserted replaced
925:442e2f9e8bfb 926:8a31dd49130d
24 24
25 CFLAGS="$CFLAGS -Wall" 25 CFLAGS="$CFLAGS -Wall"
26 fi 26 fi
27 27
28 # Checks for libraries. 28 # Checks for libraries.
29 AC_CHECK_LIB([ncurses], [initscr], , AC_MSG_ERROR([NCURSES library needed])) 29
30 AC_CHECK_LIB([panel], [new_panel]) 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_MSG_ERROR([Missing header file]))
42 else
43 AC_CHECK_HEADERS([ncurses/ncurses.h ncurses/panel.h],,
44 [AC_CHECK_HEADERS([ncurses.h panel.h],,
45 AC_MSG_ERROR([Missing header file]))])
46 fi
47 ],
48 [CF_CURSES_LIBS])
49 ])
50
51 AC_CHECK_LIB([panelw], [new_panel],,
52 AC_CHECK_LIB([panel], [new_panel])
53 )
31 54
32 AC_CHECK_DECLS([strptime],,, 55 AC_CHECK_DECLS([strptime],,,
33 [#define _GNU_SOURCE 56 [#define _GNU_SOURCE
34 #include <time.h>]) 57 #include <time.h>])
35 58
36 # Checks for header files. 59 # Checks for header files.
37 AC_HEADER_STDC 60 AC_HEADER_STDC
38 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ 61 AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \
39 stdlib.h string.h strings.h sys/socket.h sys/time.h \ 62 stdlib.h string.h strings.h sys/socket.h sys/time.h \
40 syslog.h termios.h unistd.h getopt.h]) 63 syslog.h termios.h unistd.h getopt.h])
41 AC_CHECK_HEADERS([ncurses.h panel.h getopt.h], , 64 AC_CHECK_HEADERS([getopt.h], , AC_MSG_ERROR([Missing header file]))
42 AC_MSG_ERROR([Missing header file]))
43 AC_VAR_TIMEZONE_EXTERNALS 65 AC_VAR_TIMEZONE_EXTERNALS
44 66
45 # Checks for typedefs, structures, and compiler characteristics. 67 # Checks for typedefs, structures, and compiler characteristics.
46 AC_HEADER_STDBOOL 68 AC_HEADER_STDBOOL
47 AC_C_CONST 69 AC_C_CONST