restore proper CPPFLAGS and LDFLAGS for FreeBSD,
[asterisk/asterisk.git] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 #
3 # Make sure we use autoconf 2.60 to generate the "configure" script,
4 # in case we want to commit it. Other than that, version 2.59 is
5 # perfectly fine for our purposes, so people who want to modify
6 # this file just have to remember to set the AC_PREREQ argument
7 # to something that suits their needs.
8
9 AC_PREREQ(2.60)
10
11 m4_define([PBX_VERSION],
12           m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
13                        [\([0-9.]*\)\(\w\|\W\)*],
14                        [\1]))
15 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
16
17 # cross-compile macros
18 AC_CANONICAL_BUILD
19 AC_CANONICAL_HOST
20
21 # check existence of the package
22 AC_CONFIG_SRCDIR([main/asterisk.c])
23
24 # specify output header file
25 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
26
27 AC_COPYRIGHT("Asterisk")
28 AC_REVISION($Revision$)
29
30 case "${host_os}" in
31      freebsd*)
32      ac_default_prefix=/usr/local
33      CPPFLAGS=-I/usr/local/include
34      LDFLAGS=-L/usr/local/lib
35      ;;
36      *)
37      ac_default_prefix=/usr
38      if test ${sysconfdir} = '${prefix}/etc'; then
39         sysconfdir=/etc
40      fi
41      if test ${mandir} = '${prefix}/man'; then
42         mandir=/usr/share/man
43      fi
44      ;;
45 esac
46
47 if test ${localstatedir} = '${prefix}/var'; then
48      localstatedir=/var
49 fi
50
51 BUILD_PLATFORM=${build}
52 BUILD_CPU=${build_cpu}
53 BUILD_VENDOR=${build_vendor}
54 BUILD_OS=${build_os}
55
56 AC_SUBST(BUILD_PLATFORM)
57 AC_SUBST(BUILD_CPU)
58 AC_SUBST(BUILD_VENDOR)
59 AC_SUBST(BUILD_OS)
60
61 HOST_PLATFORM=${host}
62 HOST_CPU=${host_cpu}
63 HOST_VENDOR=${host_vendor}
64 HOST_OS=${host_os}
65
66 AC_SUBST(HOST_PLATFORM)
67 AC_SUBST(HOST_CPU)
68 AC_SUBST(HOST_VENDOR)
69 AC_SUBST(HOST_OS)
70
71 case "${host_os}" in
72      freebsd*)
73      OSARCH=FreeBSD
74      ;;
75      netbsd*)
76      OSARCH=NetBSD
77      ;;
78      openbsd*)
79      OSARCH=OpenBSD
80      ;;
81      solaris*)
82      OSARCH=SunOS
83      ;;
84      *)
85      OSARCH=${HOST_OS}
86      ;;
87 esac
88
89 AC_SUBST(OSARCH)
90
91 #  check for uname
92 AC_PATH_TOOL([UNAME], [uname], No)
93 if test ! x"${UNAME}" = xNo; then
94    PBX_OSREV=$(${UNAME} -r)
95 fi
96 AC_SUBST(PBX_OSREV)
97
98 # This needs to be before any macros that use the C compiler
99 AC_GNU_SOURCE
100
101 AH_TOP(
102 #ifndef ASTERISK_AUTOCONFIG_H
103 #define ASTERISK_AUTOCONFIG_H
104
105 #include "asterisk/buildopts.h"
106
107 #ifndef _REENTRANT
108 #define _REENTRANT
109 #endif
110 )
111
112 AH_BOTTOM(
113 #endif
114 )
115
116 # cross-compile checks
117 if test "${cross_compiling}" = "yes"; 
118 then
119    AC_CHECK_TOOL(CC, gcc, :)
120    AC_CHECK_TOOL(CXX, g++, :)
121    AC_CHECK_TOOL(LD, ld, :)
122    AC_CHECK_TOOL(RANLIB, ranlib, :)
123    AC_CHECK_TOOL(AR, ar, :)
124 fi
125
126 # Checks for programs.
127 AC_PROG_CC
128 AC_PROG_CXX
129 AC_PROG_CPP
130 AC_PROG_CXXCPP
131 AC_PROG_AWK
132 AC_PROG_INSTALL
133 AC_PROG_LN_S
134 AC_PROG_RANLIB
135 AST_CHECK_GNU_MAKE
136
137 AC_PATH_PROG([GREP], [grep], :)
138 AC_PATH_PROG([AR], [ar], :)
139 AC_PATH_PROG([FIND], [find], :)
140 AC_PATH_PROG([COMPRESS], [compress], :)
141 AC_PATH_PROG([BASENAME], [basename], :)
142 AC_PATH_PROG([ID], [id], :)
143 AC_PATH_PROG([DIRNAME], [dirname], :)
144 AC_PATH_PROG([SHELL], [sh], :)
145 AC_PATH_PROG([LN], [ln], :)
146 AC_PATH_PROG([DOT], [dot], :)
147
148 AC_LANG(C)
149
150 AC_ARG_ENABLE(dev-mode,
151         [  --enable-dev-mode    Turn on developer mode],
152         [case "${enableval}" in
153               y|ye|yes) AST_DEVMODE=yes ;;
154               n|no)  AST_DEVMODE=no ;;
155               *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
156         esac])
157 AC_SUBST(AST_DEVMODE)
158
159 # package option names should be in alphabetical order
160 # by the --with option name, to make things easier for the users :-)
161
162 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
163 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
164 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
165 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
166 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
167 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
168 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
169 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
170 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
171 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
172 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
173 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
174 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
175 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
176 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
177 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
178 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
179 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
180 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
181 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
182 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
183 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
184 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
185 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
186 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
187 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
188 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
189 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
190 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
191 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
192 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
193 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
194 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
195 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
196 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
197 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
198 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
199 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
200 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
201
202 # check for basic system features and functionality before
203 # checking for package libraries
204
205 AC_FUNC_ALLOCA
206 AC_HEADER_DIRENT
207 AC_HEADER_STDC
208 AC_HEADER_SYS_WAIT
209 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h])
210
211 AC_SYS_LARGEFILE
212
213 # Checks for typedefs, structures, and compiler characteristics.
214 AC_HEADER_STDBOOL
215 AC_C_CONST
216 AC_TYPE_UID_T
217 AC_C_INLINE
218 AC_TYPE_MODE_T
219 AC_TYPE_OFF_T
220 AC_TYPE_PID_T
221 AC_TYPE_SIZE_T
222 AC_CHECK_MEMBERS([struct stat.st_blksize])
223 AC_HEADER_TIME
224 AC_STRUCT_TM
225 AC_C_VOLATILE
226 AC_CHECK_TYPES([ptrdiff_t])
227
228 # Checks for library functions.
229 AC_FUNC_CHOWN
230 AC_FUNC_CLOSEDIR_VOID
231 AC_FUNC_ERROR_AT_LINE
232 AST_FUNC_FORK
233 AC_FUNC_FSEEKO
234 AC_PROG_GCC_TRADITIONAL
235 # XXX: these are commented out until we determine whether it matters if our malloc()
236 # acts exactly like glibc's or not
237 # AC_FUNC_MALLOC
238 # AC_FUNC_REALLOC
239 AC_FUNC_MEMCMP
240 AC_FUNC_MKTIME
241 AC_FUNC_MMAP
242 AC_FUNC_SELECT_ARGTYPES
243 AC_FUNC_SETVBUF_REVERSED
244 AC_TYPE_SIGNAL
245 AC_FUNC_STAT
246 AC_FUNC_STRCOLL
247 AC_FUNC_STRFTIME
248 AC_FUNC_STRNLEN
249 AC_FUNC_STRTOD
250 AC_FUNC_UTIME_NULL
251 AC_FUNC_VPRINTF
252 AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
253
254 AC_MSG_CHECKING(for compiler atomic operations)
255 AC_LINK_IFELSE(
256 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
257 AC_MSG_RESULT(yes)
258 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
259 AC_MSG_RESULT(no)
260 )
261
262 AST_GCC_ATTRIBUTE(pure)
263 AST_GCC_ATTRIBUTE(malloc)
264 AST_GCC_ATTRIBUTE(const)
265 AST_GCC_ATTRIBUTE(unused)
266 AST_GCC_ATTRIBUTE(always_inline)
267
268 AC_MSG_CHECKING(for -ffunction-sections support)
269 saved_CFLAGS="${CFLAGS}"
270 CFLAGS="${CFLAGS} -ffunction-sections"
271 AC_COMPILE_IFELSE(
272         AC_LANG_PROGRAM([], [int x = 1;]),
273         AC_MSG_RESULT(yes)
274         [saved_LDFLAGS="${LDFLAGS}"]
275         [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
276         AC_MSG_CHECKING(for --gc-sections support)
277         AC_LINK_IFELSE(
278                 AC_LANG_PROGRAM([], [int x = 1;]),
279                 AC_MSG_RESULT(yes)
280                 [GC_CFLAGS="-ffunction-sections"]
281                 [[GC_LDFLAGS="-Wl,--gc-sections"]],
282                 AC_MSG_RESULT(no)
283         )
284         [LDFLAGS="${saved_LDFLAGS}"],
285         AC_MSG_RESULT(no)
286 )
287 CFLAGS="${saved_CFLAGS}"
288 AC_SUBST(GC_CFLAGS)
289 AC_SUBST(GC_LDFLAGS)
290
291 AC_MSG_CHECKING(for res_ninit)
292 AC_LINK_IFELSE(
293         AC_LANG_PROGRAM([#include <resolv.h>],
294                         [int foo = res_ninit(NULL);]),
295         AC_MSG_RESULT(yes)
296         AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
297         AC_MSG_RESULT(no)
298 )
299
300 AC_MSG_CHECKING(for RTLD_NOLOAD)
301 AC_LINK_IFELSE(
302         AC_LANG_PROGRAM([#include <dlfcn.h>],
303                         [int foo = RTLD_NOLOAD;]),
304         AC_MSG_RESULT(yes)
305         AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
306         AC_MSG_RESULT(no)
307 )
308
309 AC_CHECK_HEADER([libkern/OSAtomic.h],
310                 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
311
312 AC_CHECK_SIZEOF(int)
313
314 # do the package library checks now
315
316 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
317
318 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
319
320 if test "x${host_os}" = "xlinux-gnu" ; then
321   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
322 fi
323
324 GSM_INTERNAL="yes"
325 AC_SUBST(GSM_INTERNAL)
326 GSM_SYSTEM="yes"
327 if test "${USE_GSM}" != "no"; then
328    if test "${GSM_DIR}" = "internal"; then
329       GSM_SYSTEM="no"
330    elif test "${GSM_DIR}" != ""; then
331       GSM_INTERNAL="no"
332    fi
333    if test "${GSM_SYSTEM}" = "yes"; then
334       gsmlibdir=""
335       if test "x${GSM_DIR}" != "x"; then
336          if test -d ${GSM_DIR}/lib; then
337             gsmlibdir="-L${GSM_DIR}/lib"
338          else
339             gsmlibdir="-L${GSM_DIR}"
340          fi
341       fi
342       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
343       [Define to indicate the GSM library]), [], ${gsmlibdir})
344       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
345          GSM_LIB="-lgsm"
346          if test "x${GSM_DIR}" != "x"; then
347             GSM_LIB="${gsmlibdir} ${GSM_LIB}"
348             GSM_INCLUDE="-I${GSM_DIR}/include"
349          fi
350          PBX_GSM=1
351          GSM_INTERNAL="no"
352       fi
353    fi
354    if test "${GSM_INTERNAL}" = "yes"; then
355       PBX_GSM=1
356    fi
357 fi
358
359 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
360
361 if test "${PBX_IKSEMEL}" = 1; then
362    AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
363    if test "${PBX_GNUTLS}" = 1; then
364       IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
365    fi
366 fi
367
368 if test "${USE_IMAP_TK}" != "no"; then
369    if test "${IMAP_TK_DIR}" = ""; then
370       IMAP_TK_DIR=`pwd`"/../imap-2004g"
371    fi
372    AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
373    saved_cppflags="${CPPFLAGS}"
374    saved_libs="${LIBS}"
375    if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
376       imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
377    fi
378    CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
379    LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
380    AC_LINK_IFELSE(
381         AC_LANG_PROGRAM(
382                 [#include "c-client.h"
383                 void mm_searched (MAILSTREAM *stream,unsigned long number)
384                 {
385                 }
386                 void mm_exists (MAILSTREAM *stream,unsigned long number)
387                 {
388                 }
389                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
390                 {
391                 }
392                 void mm_flags (MAILSTREAM *stream,unsigned long number)
393                 {
394                 }
395                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
396                 {
397                 }
398                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
399                 {
400                 }
401                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
402                 {
403                 }
404                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
405                 {
406                 }
407                 void mm_log (char *string,long errflg)
408                 {
409                 }
410                 void mm_dlog (char *string)
411                 {
412                 }
413                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
414                 {
415                 }
416                 void mm_critical (MAILSTREAM *stream)
417                 {
418                 }
419                 void mm_nocritical (MAILSTREAM *stream)
420                 {
421                 }
422                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
423                 {
424                 }
425                 void mm_fatal (char *string)
426                 {
427                 }],
428                 [
429                 MAILSTREAM *foo = mail_open(NULL, "", 0);
430                 ]
431         ),
432         [ac_cv_imap_tk="yes"],
433         [ac_cv_imap_tk="no"]
434    )
435    if test "${ac_cv_imap_tk}" = "yes"; then
436    AC_LINK_IFELSE(
437       AC_LANG_PROGRAM(
438          [#include "c-client.h"
439          void mm_searched (MAILSTREAM *stream,unsigned long number)
440          {
441          }
442          void mm_exists (MAILSTREAM *stream,unsigned long number)
443          {
444          }
445          void mm_expunged (MAILSTREAM *stream,unsigned long number)
446          {
447          }
448          void mm_flags (MAILSTREAM *stream,unsigned long number)
449          {
450          }
451          void mm_notify (MAILSTREAM *stream,char *string,long errflg)
452          {
453          }
454          void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
455          {
456          }
457          void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
458          {
459          }
460          void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
461          {
462          }
463          void mm_log (char *string,long errflg)
464          {
465          }
466          void mm_dlog (char *string)
467          {
468          }
469          void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
470          {
471          }
472          void mm_critical (MAILSTREAM *stream)
473          {
474          }
475          void mm_nocritical (MAILSTREAM *stream)
476          {
477          }
478          long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
479          {
480          }
481          void mm_fatal (char *string)
482          {
483          }],
484          [
485          long check = mail_expunge_full(NULL, "", 0);
486          ]
487       ),
488       [ac_cv_imap_tk2006="yes"],
489       [ac_cv_imap_tk2006="no"]
490   )
491   fi
492    CPPFLAGS="${saved_cppflags}"
493    LIBS="${saved_libs}"
494    if test "${ac_cv_imap_tk}" = "yes"; then
495       AC_MSG_RESULT(yes) 
496       IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
497       IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
498       PBX_IMAP_TK=1
499       AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
500       if test "${ac_cv_imap_tk2006}" = "yes"; then
501          AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
502       fi
503    elif test ! -z "${IMAP_TK_MANDATORY}"; then
504       AC_MSG_RESULT(no) 
505       AC_MSG_NOTICE(***)
506       AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
507       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
508       AC_MSG_NOTICE(*** including --without-imap.)
509       exit 1
510    else
511       AC_MSG_RESULT(no) 
512    fi
513 fi
514
515 AC_LANG_PUSH(C++)
516
517 if test "${USE_KDE}" != "no"; then
518    AC_MSG_CHECKING(for crashHandler in -lkdecore)
519    saved_libs="${LIBS}"
520    saved_cppflags="${CPPFLAGS}"
521    CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
522    if test -d ${KDE_DIR}/lib; then
523       kdelibdir="${KDE_DIR}/lib"
524    else
525       kdelibdir="${KDE_DIR}"
526    fi
527    LIBS="${LIBS} -L${kdelibdir} -lkdecore"
528
529    AC_LINK_IFELSE(
530         [AC_LANG_PROGRAM(
531                         [#include "kcrash.h"],
532                         [KCrash::defaultCrashHandler(1);])
533         ],
534         [ac_cv_lib_kde_crash="yes"],
535         [ac_cv_lib_kde_crash="no"])
536                 
537    LIBS="${saved_libs}"
538    CPPFLAGS="${saved_cppflags}"
539         
540    if test "${ac_cv_lib_kde_crash}" = "yes"; then
541       AC_MSG_RESULT(yes) 
542       KDE_LIB="-lkdecore -lkdeui"
543       if test "${KDE_DIR}" != ""; then
544          KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
545          KDE_INCLUDE="-I${KDE_DIR}/include"
546       fi
547       PBX_KDE=1
548       AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
549    elif test ! -z "${KDE_MANDATORY}"; then
550       AC_MSG_RESULT(no) 
551       AC_MSG_NOTICE(***)
552       AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
553       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
554       AC_MSG_NOTICE(*** including --without-kde.)
555       exit 1
556    else
557       AC_MSG_RESULT(no) 
558    fi
559 fi
560 if test "${PBX_KDE}" = 1; then
561    AC_PATH_TOOL(KDEINIT, kdeinit, No)
562    if test ! x"${KDEINIT}" = xNo; then
563       KDEDIR=$(${DIRNAME} ${KDEINIT})
564       KDEDIR=$(${DIRNAME} ${KDEDIR})
565    fi
566    AC_SUBST([KDEDIR])
567 fi
568
569 AC_LANG_POP
570
571 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
572
573 if test "${PBX_MISDN}" = 1; then
574    AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
575    AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
576 fi
577
578 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
579
580 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
581
582 NETSNMP_CONFIG=No
583 if test "${USE_NETSNMP}" != "no"; then  
584    if test "x${NETSNMP_DIR}" != "x"; then
585       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
586       if test x"${NETSNMP_CONFIG}" = xNo; then
587          AC_MSG_NOTICE(***)
588          AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
589          AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
590          AC_MSG_NOTICE(*** Either correct the installation, or run configure)
591          AC_MSG_NOTICE(*** including --without-netsnmp)
592          exit 1
593       fi
594    else
595       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
596    fi
597 fi
598 if test x"${NETSNMP_CONFIG}" != xNo; then
599    NETSNMP_libs=`net-snmp-config --agent-libs`
600    
601    AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
602    [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
603
604    if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
605       NETSNMP_LIB="${NETSNMP_libs}"
606       PBX_NETSNMP=1
607    elif test ! -z "${NETSNMP_MANDATORY}";
608    then
609       AC_MSG_NOTICE(***)
610       AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
611       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
612       AC_MSG_NOTICE(*** including --without-netsnmp)
613       exit 1
614    fi
615 elif test ! -z "${NETSNMP_MANDATORY}";
616 then
617    AC_MSG_NOTICE(***)
618    AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
619    AC_MSG_NOTICE(*** Either correct the installation, or run configure)
620    AC_MSG_NOTICE(*** including --without-netsnmp)
621    exit 1
622 fi
623
624 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
625
626 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
627
628 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
629
630 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
631
632 PBX_OSS=0
633 AC_CHECK_HEADER([linux/soundcard.h],
634                 [
635                 PBX_OSS=1
636                 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
637                 ])
638 if test "$PBX_OSS" = "0"; then
639    AC_CHECK_HEADER([sys/soundcard.h],
640                    [
641                    PBX_OSS=1
642                    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
643                    ])
644 fi
645 if test "$PBX_OSS" = "0"; then
646    AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
647 fi
648
649 PG_CONFIG=No
650 if test "${USE_PGSQL}" != "no"; then    
651    if test "x${PGSQL_DIR}" != "x"; then
652       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
653       if test x"${PG_CONFIG}" = xNo; then
654          AC_MSG_NOTICE(***)
655          AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
656          AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
657          AC_MSG_NOTICE(*** Either correct the installation, or run configure)
658          AC_MSG_NOTICE(*** including --without-postgres)
659          exit 1
660       fi
661    else
662       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
663    fi
664 fi
665 if test "${PG_CONFIG}" != No; then
666    PGSQL_libdir=`pg_config --libdir`
667    PGSQL_includedir=`pg_config --includedir`
668    
669    AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
670    [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
671
672    if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
673       PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
674       PGSQL_INCLUDE="-I${PGSQL_includedir}"
675       PBX_PGSQL=1
676    elif test ! -z "${PGSQL_MANDATORY}";
677    then
678       AC_MSG_NOTICE(***)
679       AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
680       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
681       AC_MSG_NOTICE(*** including --without-postgres)
682       exit 1
683    fi
684 elif test ! -z "${PGSQL_MANDATORY}";
685 then
686    AC_MSG_NOTICE(***)
687    AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
688    AC_MSG_NOTICE(*** Either correct the installation, or run configure)
689    AC_MSG_NOTICE(*** including --without-postgres)
690    exit 1
691 fi
692
693 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
694
695 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
696
697 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
698
699 if test "${USE_PWLIB}" != "no"; then
700         if test ! -z "${PWLIB_DIR}"; then
701                 PWLIBDIR="${PWLIB_DIR}"
702         fi
703         AST_CHECK_PWLIB()
704         AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
705                 
706         if test "${HAS_PWLIB:-unset}" != "unset"; then
707                 AST_CHECK_OPENH323_PLATFORM()
708
709                 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
710
711                 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
712                         [Define if your system has the PWLib libraries.],
713                         [#include "ptlib.h"],
714                         [BOOL q = PTime::IsDaylightSavings();])
715         fi
716 fi
717
718 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a ! -z "${PWLIB_MANDATORY}"; then
719    AC_MSG_NOTICE(***)
720    AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
721    AC_MSG_NOTICE(*** Either correct the installation, or run configure)
722    AC_MSG_NOTICE(*** including --without-pwlib)
723    exit 1
724 fi
725
726 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
727         if test ! -z "${OPENH323_DIR}"; then
728                 OPENH323DIR="${OPENH323_DIR}"
729         fi
730         AST_CHECK_OPENH323()
731         AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
732         AST_CHECK_OPENH323_BUILD()
733         PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
734         AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
735                 [Define if your system has the OpenH323 libraries.],
736                 [#include "ptlib.h"
737                 #include "h323.h"
738                 #include "h323ep.h"],
739                 [H323EndPoint ep = H323EndPoint();],
740                 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
741 fi
742 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a ! -z "${OPENH323_MANDATORY}"; then
743    AC_MSG_NOTICE(***)
744    AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
745    AC_MSG_NOTICE(*** Either correct the installation, or run configure)
746    AC_MSG_NOTICE(*** including --without-pwlib)
747    exit 1
748 fi
749
750
751 AC_LANG_PUSH(C++)
752
753 if test "${USE_QT}" != "no"; then
754    AC_MSG_CHECKING(for QDate in -lqt)
755    saved_libs="${LIBS}"
756    saved_cppflags="${CPPFLAGS}"
757    if test "x${QT_DIR}" != "x"; then
758       LIBS="${LIBS} -L${QT_DIR}/lib"
759       CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
760    fi
761    LIBS="${LIBS} -lqt"
762    qtlib="qt"
763    AC_LINK_IFELSE(
764         [
765                 AC_LANG_PROGRAM(
766                 [#include <qt3/qdatetime.h>],
767                 [QDate date();])
768         ],
769         [ac_cv_lib_qt_qt_date="yes"],
770         [ac_cv_lib_qt_qt_date="no"])
771    LIBS="${saved_libs}"
772    CPPFLAGS="${saved_cppflags}"
773         
774    if test "${ac_cv_lib_qt_qt_date}" = "no"; then
775       saved_libs="${LIBS}"
776       saved_cppflags="${CPPFLAGS}"
777       if test "x${QT_DIR}" != "x"; then
778          LIBS="${LIBS} -L${QT_DIR}/lib"
779          CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
780       fi
781       LIBS="${LIBS} -lqt-mt"
782       qtlib="qt-mt"     
783       AC_LINK_IFELSE(
784                 [
785                         AC_LANG_PROGRAM(
786                         [#include <qt3/qdatetime.h>],
787                         [QDate date();])
788                 ],
789                 [ac_cv_lib_qt_qt_date="yes"],
790                 [ac_cv_lib_qt_qt_date="no"])
791       LIBS="${saved_libs}"
792       CPPFLAGS="${saved_cppflags}"
793    fi   
794
795    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
796       AC_MSG_RESULT(yes) 
797    else
798       AC_MSG_RESULT(no) 
799    fi
800         
801    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
802       QT_LIB="-l${qtlib}"
803       if test "${QT_DIR}" != ""; then
804          QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
805          QT_INCLUDE="-I${QT_DIR}/include"
806       fi
807       PBX_QT=1
808       AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
809       AC_PATH_TOOL(QTMOC, moc, No)
810    elif test ! -z "${QT_MANDATORY}"; 
811    then
812       AC_MSG_NOTICE(***)
813       AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
814       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
815       AC_MSG_NOTICE(*** including --without-qt.)
816       exit 1
817    fi
818 fi
819
820 AC_LANG_POP
821
822 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
823
824 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
825
826 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
827
828 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
829
830 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
831 if test "${PBX_FREETDS}" != "0";
832 then
833     case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
834         *0.64*)
835                 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
836         ;;
837     *0.63*)
838         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
839         ;;
840     *0.62*)
841         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
842         ;;
843     *)
844         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
845         ;;
846     esac
847 fi
848
849 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
850
851 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
852
853 if test "${host_os}" != "linux-gnu" ; then
854   tonezone_extra="-lm"
855 fi
856
857 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
858
859 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
860
861 AC_LANG_PUSH(C++)
862
863 if test "${USE_VPB}" != "no"; then
864    AC_MSG_CHECKING(for vpb_open in -lvpb)
865    saved_libs="${LIBS}"
866    saved_cppflags="${CPPFLAGS}"
867    if test "x${VPB_DIR}" != "x"; then
868       if test -d ${VPB_DIR}/lib; then
869          vpblibdir=${VPB_DIR}/lib
870       else
871          vpblibdir=${VPB_DIR}
872       fi
873       LIBS="${LIBS} -L${vpblibdir}"
874       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
875    fi
876    LIBS="${LIBS} -lvpb -lpthread"
877    AC_LINK_IFELSE(
878         [
879         AC_LANG_PROGRAM(
880         [#include <vpbapi.h>],
881         [int q = vpb_open(0,0);])
882         ],
883         [       AC_MSG_RESULT(yes) 
884                 ac_cv_lib_vpb_vpb_open="yes" 
885         ],
886         [       AC_MSG_RESULT(no) 
887                 ac_cv_lib_vpb_vpb_open="no" 
888         ]
889         )
890    LIBS="${saved_libs}"
891    CPPFLAGS="${saved_cppflags}"
892    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
893         VPB_LIB="-lvpb"
894         if test "${VPB_DIR}" != ""; then
895            VPB_LIB="-L${vpblibdir}  ${VPB_LIB}"
896            VPB_INCLUDE="-I${VPB_DIR}/include"
897         fi
898         PBX_VPB=1
899         AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
900    elif test ! -z "${VPB_MANDATORY}"; then
901       AC_MSG_NOTICE(***)
902       AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
903       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
904       AC_MSG_NOTICE(*** including --without-vpb.)
905       exit 1
906    fi
907 fi
908
909 AC_LANG_POP
910
911 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
912
913 if test "${USE_ZAPTEL}" != "no"; then
914    AC_MSG_CHECKING(for ZT_TONE_DTMF_BASE in zaptel.h)
915    saved_cppflags="${CPPFLAGS}"
916    if test "x${ZAPTEL_DIR}" != "x"; then
917       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
918    fi
919    AC_COMPILE_IFELSE(
920         [
921         AC_LANG_PROGRAM(
922         [#include <zaptel/zaptel.h>],
923         [int foo = ZT_TONE_DTMF_BASE;])
924         ],
925         [       AC_MSG_RESULT(yes) 
926                 ac_cv_zaptel_h="yes" 
927         ],
928         [       AC_MSG_RESULT(no) 
929                 ac_cv_zaptel_h="no" 
930         ]
931         )
932    CPPFLAGS="${saved_cppflags}"
933    if test "${ac_cv_zaptel_h}" = "yes"; then
934         if test "${ZAPTEL_DIR}" != ""; then
935            ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
936         fi
937         PBX_ZAPTEL=1
938         AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
939    elif test ! -z "${ZAPTEL_MANDATORY}"; 
940    then
941       AC_MSG_NOTICE(***)
942       AC_MSG_NOTICE(*** The Zaptel installation on this system appears to be broken.)
943       AC_MSG_NOTICE(*** Either correct the installation, or run configure)
944       AC_MSG_NOTICE(*** including --without-zaptel.)
945       exit 1
946    fi
947 fi
948
949 EDITLINE_LIB=""
950 if test "x$TERMCAP_LIB" != "x" ; then
951   EDITLINE_LIB="$TERMCAP_LIB"
952 elif test "x$TINFO_LIB" != "x" ; then
953   EDITLINE_LIB="$TINFO_LIB"
954 elif test "x$CURSES_LIB" != "x" ; then
955   EDITLINE_LIB="$CURSES_LIB"
956 elif test "x$NCURSES_LIB" != "x" ; then
957   EDITLINE_LIB="$NCURSES_LIB"
958 else
959   AC_MSG_ERROR(*** termcap support not found)
960 fi
961 AC_SUBST(EDITLINE_LIB)
962
963 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
964 AC_SUBST(PBX_H323)
965
966 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
967                                    #include <linux/version.h>
968                                    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
969                                    #include <linux/compiler.h>
970                                    #endif
971                                    ])
972 AC_SUBST(PBX_IXJUSER)
973
974 PBX_GTK=0
975 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
976 if test ! "x${GTKCONFIG}" = xNo; then
977    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
978    GTK_LIB=$(${GTKCONFIG} --libs gthread)
979    PBX_GTK=1
980    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
981 fi
982 AC_SUBST(PBX_GTK)
983 AC_SUBST(GTK_INCLUDE)
984 AC_SUBST(GTK_LIB)
985
986 if test "${USE_CURL}" != "no"; then
987    AC_PATH_TOOL([CURL], [curl-config], No)
988    if test ! x"${CURL}" = xNo; then
989    # check for version
990       if test "${host_os}" = "SunOS"; then
991             if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
992                 CURL_INCLUDE=$(${CURL} --cflags)
993                 CURL_LIB=$(${CURL} --libs)
994                 PBX_CURL=1
995                 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
996             fi
997          else
998             if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
999                 CURL_INCLUDE=$(${CURL} --cflags)
1000                 CURL_LIB=$(${CURL} --libs)
1001                 PBX_CURL=1
1002                 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1003             fi
1004         fi
1005     fi
1006 fi
1007
1008 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1009 AC_OUTPUT
1010
1011 if test "x${silent}" != "xyes" ; then
1012 echo
1013 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
1014 echo "            .\$7\$7..          .7\$\$7:.    "
1015 echo "          .\$\$:.                 ,\$7.7   "
1016 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
1017 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
1018 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
1019 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
1020 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
1021 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
1022 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
1023 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
1024 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
1025 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
1026 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
1027 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
1028 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
1029 echo " \$\$\$\$\$                        \$\$\$       "
1030 echo "  \$\$\$\$7.                       \$\$  (TM)     "
1031 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
1032 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
1033 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
1034 echo
1035 fi
1036
1037 AC_MSG_NOTICE(Package configured for: )
1038 AC_MSG_NOTICE( OS type  : $host_os)
1039 AC_MSG_NOTICE( Host CPU : $host_cpu)
1040 if test "${cross_compiling}" = "yes"; then
1041    AC_MSG_NOTICE( Cross Compilation = YES)
1042 fi