Merge "res_rtp_asterisk.c: Fix rtp source address learning for broken clients"
[asterisk/asterisk.git] / menuselect / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4
5 m4_define([MENUSELECT_VERSION],
6           m4_bpatsubst(m4_esyscmd([./make_version .]),
7                        [\([0-9.]*\)\(\w\|\W\)*],
8                        [\1]))
9 AC_INIT(menuselect, MENUSELECT_VERSION, www.asterisk.org)
10
11 # check existence of the package
12 AC_CONFIG_SRCDIR([menuselect.c])
13
14 # specify output header file
15 AC_CONFIG_HEADER(autoconfig.h)
16
17 AC_COPYRIGHT("Menuselect")
18
19 AC_CANONICAL_BUILD
20 AC_CANONICAL_HOST
21
22 HOST_OS=${host_os}
23 AC_SUBST(HOST_OS)
24
25 PBX_WINARCH=0
26 case "${host_os}" in
27      freebsd*)
28      OSARCH=FreeBSD
29      ;;
30      netbsd*)
31      OSARCH=NetBSD
32      ;;
33      openbsd*)
34      OSARCH=OpenBSD
35      ;;
36      solaris*)
37      OSARCH=SunOS
38      ;;
39      mingw32)
40      OSARCH=mingw32
41      PBX_WINARCH=1
42      ;;
43      cygwin)
44      OSARCH=cygwin
45      PBX_WINARCH=1
46      ;;
47      linux-gnueabi)
48      OSARCH=linux-gnu
49      ;;
50      *)
51      OSARCH=${host_os}
52      ;;
53 esac
54
55 AH_TOP(
56 #ifndef MENUSELECT_AUTOCONFIG_H
57 #define MENUSELECT_AUTOCONFIG_H
58
59 #ifndef _REENTRANT
60 #define _REENTRANT
61 #endif
62 )
63
64 AH_BOTTOM(
65 #endif
66 )
67
68 # Checks for programs.
69 AC_PROG_CC
70 AST_CHECK_GNU_MAKE
71
72
73 AC_LANG(C)
74 AC_ARG_ENABLE([debug],
75         [AS_HELP_STRING([--enable-debug], [Turn on debug mode])],
76         [case "${enableval}" in
77                 y|ye|yes) MENUSELECT_DEBUG=yes ;;
78                 n|no)  MENUSELECT_DEBUG=no ;;
79                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug)  ;;
80     esac])
81 AC_SUBST(MENUSELECT_DEBUG)
82
83 AC_FUNC_ALLOCA
84 AC_CHECK_FUNCS([asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf])
85
86 # The frontend can use curses, ncurses, newt or GTK2 so check for all of them
87
88 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
89 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
90 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
91 AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
92
93 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
94 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
95 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
96 AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
97         [#include <libxml/tree.h>
98         #include <libxml/parser.h>],
99         [LIBXML_TEST_VERSION])
100
101 if test "${PBX_LIBXML2}" != 1; then
102   AC_MSG_ERROR([Could not find required 'Libxml2' development package])
103 fi
104
105 AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0])
106 AC_SUBST(PBX_GTK2)
107 AC_SUBST(GTK2_INCLUDE)
108 AC_SUBST(GTK2_LIB)
109
110 test "$silent"=yes && ac_sub_configure_args="${ac_sub_configure_args} --silent"
111
112 AC_CONFIG_FILES([makeopts])
113 AC_OUTPUT
114
115 AC_MSG_NOTICE(Menuselect build configuration successfully completed)