root/packages/telephony/asterisk-gui-mdx/trunk/configure.ac

Revision 200, 4.9 kB (checked in by nextime, 2 years ago)

--

Line 
1 w
2 # Process this file with autoconf to produce a configure script.
3 #
4 # Make sure we use autoconf 2.60 to generate the "configure" script,
5 # in case we want to commit it. Other than that, version 2.59 is
6 # perfectly fine for our purposes, so people who want to modify
7 # this file just have to remember to set the AC_PREREQ argument
8 # to something that suits their needs.
9
10 AC_PREREQ(2.59)
11
12 m4_define([PBX_VERSION],
13           m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
14                        [\([0-9.]*\)\(\w\|\W\)*],
15                        [\1]))
16 AC_INIT(asterisk-gui, PBX_VERSION, www.asterisk.org)
17
18 # cross-compile macros
19 AC_CANONICAL_BUILD
20 AC_CANONICAL_HOST
21
22 # check existence of the package
23 AC_CONFIG_SRCDIR([tools/zapscan.c])
24
25 AC_COPYRIGHT("Asterisk-gui")
26 AC_REVISION($Revision: 48191 $)
27
28 case "${host_os}" in
29      freebsd*)
30      ac_default_prefix=/usr/local
31      CPPFLAGS=-I/usr/local/include
32      LDFLAGS=-L/usr/local/lib
33      ;;
34      *)
35      ac_default_prefix=/usr
36      if test ${sysconfdir} = '${prefix}/etc'; then
37         sysconfdir=/etc
38      fi
39      if test ${mandir} = '${prefix}/man'; then
40         mandir=/usr/share/man
41      fi
42      ;;
43 esac
44
45 if test ${localstatedir} = '${prefix}/var'; then
46      localstatedir=/var
47 fi
48
49 BUILD_PLATFORM=${build}
50 BUILD_CPU=${build_cpu}
51 BUILD_VENDOR=${build_vendor}
52 BUILD_OS=${build_os}
53
54 AC_SUBST(BUILD_PLATFORM)
55 AC_SUBST(BUILD_CPU)
56 AC_SUBST(BUILD_VENDOR)
57 AC_SUBST(BUILD_OS)
58
59 HOST_PLATFORM=${host}
60 HOST_CPU=${host_cpu}
61 HOST_VENDOR=${host_vendor}
62 HOST_OS=${host_os}
63
64 AC_SUBST(HOST_PLATFORM)
65 AC_SUBST(HOST_CPU)
66 AC_SUBST(HOST_VENDOR)
67 AC_SUBST(HOST_OS)
68
69 case "${host_os}" in
70      freebsd*)
71      OSARCH=FreeBSD
72      ;;
73      netbsd*)
74      OSARCH=NetBSD
75      ;;
76      openbsd*)
77      OSARCH=OpenBSD
78      ;;
79      solaris*)
80      OSARCH=SunOS
81      ;;
82      *)
83      OSARCH=${HOST_OS}
84      ;;
85 esac
86
87 AC_SUBST(OSARCH)
88
89 #  check for uname
90 AC_PATH_TOOL([UNAME], [uname], No)
91 if test ! x"${UNAME}" = xNo; then
92    PBX_OSREV=$(${UNAME} -r)
93 fi
94 AC_SUBST(PBX_OSREV)
95
96 # This needs to be before any macros that use the C compiler
97 AC_GNU_SOURCE
98
99 # cross-compile checks
100 if test "${cross_compiling}" = "yes";
101 then
102    AC_CHECK_TOOL(CC, gcc, :)
103    AC_CHECK_TOOL(CXX, g++, :)
104    AC_CHECK_TOOL(LD, ld, :)
105    AC_CHECK_TOOL(RANLIB, ranlib, :)
106    AC_CHECK_TOOL(AR, ar, :)
107 fi
108
109 # Checks for programs.
110 AC_PROG_CC
111 AC_PROG_CPP
112 AC_PROG_INSTALL
113 AST_CHECK_GNU_MAKE
114
115 AC_PATH_PROG([BASENAME], [basename], :)
116
117 AC_CONFIG_FILES([makeopts])
118
119 AC_LANG(C)
120
121 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
122
123 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
124
125 if test "${USE_ZAPTEL}" != "no"; then
126    if test "${PBX_ZAPTEL}" != "1"; then
127       AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel.h)
128       saved_cppflags="${CPPFLAGS}"
129       if test "x${ZAPTEL_DIR}" != "x"; then
130          CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
131       fi
132       AC_COMPILE_IFELSE(
133         [
134         AC_LANG_PROGRAM(
135         [#include <zaptel.h>],
136         [int foo = ZT_DIAL_OP_CANCEL;])
137         ],
138         [       AC_MSG_RESULT(yes)
139                 ac_cv_zaptel_h="yes"
140         ],
141         [       AC_MSG_RESULT(no)
142                 ac_cv_zaptel_h="no"
143         ]
144         )
145       CPPFLAGS="${saved_cppflags}"
146       if test "${ac_cv_zaptel_h}" = "yes"; then
147          AC_MSG_NOTICE(***)
148          AC_MSG_NOTICE(*** The Zaptel installation on this system is too old)
149          AC_MSG_NOTICE(*** to be useable with this version of the Asterisk-gui.)
150          AC_MSG_NOTICE(*** Either upgrade your Zaptel installation, or run configure)
151          AC_MSG_NOTICE(*** including --without-zaptel.)
152          exit 1
153       fi
154    fi
155 fi
156
157 AST_CHECK_MANDATORY
158
159 AC_OUTPUT
160
161 if test "x${silent}" != "xyes" ; then
162 echo
163 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
164 echo "            .\$7\$7..          .7\$\$7:.    "
165 echo "          .\$\$:.                 ,\$7.7   "
166 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
167 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
168 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
169 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
170 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
171 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
172 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
173 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
174 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
175 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
176 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
177 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
178 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
179 echo " \$\$\$\$\$                        \$\$\$       "
180 echo "  \$\$\$\$7.                       \$\$  (TM)     "
181 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
182 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
183 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
184 echo
185 fi
186
187 AC_MSG_NOTICE(Package configured for: )
188 AC_MSG_NOTICE( OS type  : $host_os)
189 AC_MSG_NOTICE( Host CPU : $host_cpu)
190 if test "${cross_compiling}" = "yes"; then
191    AC_MSG_NOTICE( Cross Compilation = YES)
192 fi
Note: See TracBrowser for help on using the browser.