pjsip_add_use_callerid_contact: fixed alembic script
[asterisk/asterisk.git] / menuselect / configure.ac
1 AC_PREREQ(2.59)
2
3 m4_define([MENUSELECT_VERSION],
4           m4_bpatsubst(m4_esyscmd([./make_version .]),
5                        [\([0-9.]*\)\(\w\|\W\)*],
6                        [\1]))
7 AC_INIT(menuselect, MENUSELECT_VERSION, www.asterisk.org)
8
9 # check existence of the package
10 AC_CONFIG_SRCDIR([menuselect.c])
11
12 # specify output header file
13 AC_CONFIG_HEADER(autoconfig.h)
14
15 AC_COPYRIGHT("Menuselect")
16
17 AC_CANONICAL_HOST
18
19 HOST_OS=${host_os}
20 AC_SUBST(HOST_OS)
21
22 case "${host_os}" in
23      *dragonfly*)
24      CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
25      LDFLAGS="${LDFLAGS} -L/usr/local/lib"
26      ;;
27      *netbsd*)
28      CPPFLAGS="${CPPFLAGS} -I/usr/pkg/include"
29      LDFLAGS="${LDFLAGS} -L/usr/pkg/lib"
30      ;;
31      *bsd*)
32      CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
33      LDFLAGS="${LDFLAGS} -L/usr/local/lib"
34      ;;
35 esac
36
37 AH_TOP(
38 #ifndef MENUSELECT_AUTOCONFIG_H
39 #define MENUSELECT_AUTOCONFIG_H
40 )
41
42 AH_BOTTOM([#endif])
43
44 # Checks for programs.
45 AC_PROG_CC
46 AST_CHECK_GNU_MAKE
47
48
49 AC_LANG(C)
50 AC_ARG_ENABLE([debug],
51         [AS_HELP_STRING([--enable-debug], [Turn on debug mode])],
52         [case "${enableval}" in
53                 y|ye|yes) MENUSELECT_DEBUG=yes ;;
54                 n|no)  MENUSELECT_DEBUG=no ;;
55                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug)  ;;
56     esac])
57 AC_SUBST(MENUSELECT_DEBUG)
58
59 AC_FUNC_ALLOCA
60 AC_CHECK_FUNCS([asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf])
61
62 # The frontend can use curses, ncurses, newt or GTK2 so check for all of them
63
64 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
65 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
66 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
67 AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
68
69 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
70 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [ncurses.h])
71 if test "${PBX_NCURSES}" != 1; then
72   # some platforms have the header in a sub-directory, for example Solaris
73   AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [ncurses/ncurses.h])
74   if test "${PBX_NCURSES}" != 1; then
75     AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
76   else
77     HAVE_NCURSES_SUBDIR=yes
78   fi
79 fi
80 AC_SUBST(HAVE_NCURSES_SUBDIR)
81 AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
82         [#include <libxml/tree.h>
83         #include <libxml/parser.h>],
84         [LIBXML_TEST_VERSION])
85
86 if test "${PBX_LIBXML2}" != 1; then
87   AC_MSG_ERROR([Could not find required 'Libxml2' development package])
88 fi
89
90 AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0])
91 AC_SUBST(PBX_GTK2)
92 AC_SUBST(GTK2_INCLUDE)
93 AC_SUBST(GTK2_LIB)
94
95 test "$silent"=yes && ac_sub_configure_args="${ac_sub_configure_args} --silent"
96
97 AC_CONFIG_FILES([makeopts])
98 AC_OUTPUT
99
100 AC_MSG_NOTICE(Menuselect build configuration successfully completed)