4 dnl ------------------------------------------------------------------------
5 dnl create a small program to test the settings of mISDNuser package
6 dnl ------------------------------------------------------------------------
7 # ported from the KDE project
8 AC_DEFUN([PBX_PRINT_MISDNUSER_PROGRAM],
10 cat > conftest.$ac_ext <<EOF
22 /* TODO: try to reference some function here */
28 dnl ------------------------------------------------------------------------
29 dnl create a small program to test the settings of mISDN package
30 dnl ------------------------------------------------------------------------
31 # ported from the KDE project
32 AC_DEFUN([PBX_PRINT_MISDNKERNEL_PROGRAM],
34 cat > conftest.$ac_ext <<EOF
39 #include <linux/isdn_compat.h>
40 #include <linux/mISDNif.h>
45 #define MISDN_MAJOR_VERSION_TEST $misdn_kernel_major_version_demand
46 #define MISDN_MINOR_VERSION_TEST $misdn_kernel_minor_version_demand
47 #define MISDN_VERSION_TEST ((MISDN_MAJOR_VERSION_TEST<<16) | MISDN_MINOR_VERSION_TEST)
48 //#define MISDN_VERSION ((MISDN_MAJOR_VERSION<<16) | MISDN_MINOR_VERSION)
50 #if (MISDN_VERSION < MISDN_VERSION_TEST)
51 # error mISDN version mismatch. Need at least $misdn_kernel_major_version_demand.$misdn_kernel_minor_version_demand
58 /* access some constants from misdn kernel headers */
59 u16 v1 = CMX_TXDATA_ON;
60 u16 v2 = CMX_TXDATA_OFF;
65 /* extend here more variables or function call
66 * to access more header information */
69 /* anti optimisation constuct */
70 sum1 = v1 + v2 + v3 + v4 + v5;
80 dnl $1 is the include file
81 dnl $2 is the prefix before include
82 dnl $3 is the suffix, e.g. some variable or class definitions
83 dnl $4 is the program body within main()
84 AC_DEFUN([PBX_PRINT_PROGRAM],
94 dnl ------------------------------------------------------------------------
95 dnl if --enable-debug, it disables optimisation and enables debugging symbols
96 dnl if --disable-debug (default) other way around
97 dnl ------------------------------------------------------------------------
98 AC_DEFUN([AC_CHECK_COMPILERS],
99 [# taken from KDE project
101 # enable debugging options on demand
103 AC_ARG_ENABLE([debug],
104 [AS_HELP_STRING([--enable-debug],
105 [enable debugging symbols, turns off compiler optimisations (default=disable)])
107 [use_debug_code="yes"],
108 [use_debug_code="no"]
110 AM_CONDITIONAL(ENABLE_DEBUGGING, test "x$DEBUGGING" == "xyes" )
111 AC_ARG_ENABLE(dummyoption,
112 AC_HELP_STRING([--disable-debug],
113 [disables debugging symbols, turns on compiler optimisations]),
118 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
123 if test "$GCC" = "yes" ; then
124 if test "$use_debug_code" != "no"; then
125 CFLAGS="-g -O0 $CFLAGS"
131 if test -z "$LDFLAGS" && test "$use_debug_code" = "no" && test "$GCC" = "yes"; then
135 CXXFLAGS=" $CXXFLAGS"
138 if test "$GXX" = "yes" ; then
139 if test "$use_debug_code" != "no"; then
140 CXXFLAGS="-g -O0 $CXXFLAGS"
142 CXXFLAGS="-O2 $CXXFLAGS"
149 dnl ------------------------------------------------------------------------
150 dnl Try to find the mISDN-user headers and libraries.
151 dnl $(MISDN_LDFLAGS) will be -Lmisdnliblocation (if needed)
152 dnl and $(MISDN_INCLUDES) will be -Imisdnhdrlocation (if needed)
153 dnl ------------------------------------------------------------------------
155 AC_DEFUN([AC_PATH_MISDNUSER],
157 dnl AC_REQUIRE([K_PATH_X])
158 dnl AC_REQUIRE([KDE_USE_MISDN])
159 dnl AC_REQUIRE([KDE_CHECK_LIB64])
161 dnl ------------------------------------------------------------------------
162 dnl Add configure flag to enable linking to MT version of mISDN-user library.
163 dnl ------------------------------------------------------------------------
167 dnl AC_HELP_STRING([--disable-mt],[link to non-threaded mISDN-user (deprecated)]),
168 dnl pbx_use_misdn_mt=$enableval,
170 dnl if test $pbx_misdnver = 3; then
171 dnl pbx_use_misdn_mt=yes
173 dnl pbx_use_misdn_mt=no
178 dnl USING_MISDN_MT=""
180 dnl ------------------------------------------------------------------------
181 dnl If we not get --disable-misdn-mt then adjust some vars for the host.
182 dnl ------------------------------------------------------------------------
186 dnl if test "x$pbx_use_misdn_mt" = "xyes"; then
187 dnl KDE_CHECK_THREADING
188 dnl if test "x$pbx_use_threading" = "xyes"; then
189 dnl CPPFLAGS="$USE_THREADS -DMISDN_THREAD_SUPPORT $CPPFLAGS"
190 dnl KDE_MT_LDFLAGS="$USE_THREADS"
191 dnl KDE_MT_LIBS="$LIBPTHREAD"
193 dnl pbx_use_misdn_mt=no
196 dnl AC_SUBST(KDE_MT_LDFLAGS)
197 dnl AC_SUBST(KDE_MT_LIBS)
199 dnl pbx_misdn_was_given=yes
201 dnl ------------------------------------------------------------------------
202 dnl If we haven't been told how to link to mISDN-user, we work it out for ourselves.
203 dnl ------------------------------------------------------------------------
204 dnl if test -z "$LIBMISDN_GLOB"; then
205 dnl if test "x$pbx_use_misdn_emb" = "xyes"; then
206 dnl LIBMISDN_GLOB="libmisdne.*"
208 dnl LIBMISDN_GLOB="libmisdn.*"
212 dnl ------------------------------------------------------------
213 dnl If we got --enable-embedded then adjust the mISDN-user library name.
214 dnl ------------------------------------------------------------
215 dnl if test "x$pbx_use_misdn_emb" = "xyes"; then
216 dnl misdnlib="misdne"
221 dnl pbx_int_misdn="-l$misdnlib"
223 dnl if test -z "$LIBQPE"; then
224 dnl ------------------------------------------------------------
225 dnl If we got --enable-palmtop then add -lqpe to the link line
226 dnl ------------------------------------------------------------
227 dnl if test "x$pbx_use_misdn_emb" = "xyes"; then
228 dnl if test "x$pbx_use_misdn_emb_palm" = "xyes"; then
238 dnl ------------------------------------------------------------------------
239 dnl If we got --enable-misdn-mt then adjust the mISDN-user library name for the host.
240 dnl ------------------------------------------------------------------------
242 dnl if test "x$pbx_use_misdn_mt" = "xyes"; then
243 dnl LIBMISDN="-l$misdnlib-mt"
244 dnl pbx_int_misdn="-l$misdnlib-mt"
245 dnl LIBMISDN_GLOB="lib$misdnlib-mt.*"
246 dnl USING_MISDN_MT="using -mt"
248 dnl LIBMISDN="-l$misdnlib"
251 dnl if test $pbx_misdnver != 1; then
253 dnl AC_REQUIRE([AC_FIND_PNG])
254 dnl AC_REQUIRE([AC_FIND_JPEG])
255 dnl LIBMISDN="$LIBMISDN $LIBPNG $LIBJPEG"
258 dnl if test $pbx_misdnver = 3; then
259 dnl AC_REQUIRE([KDE_CHECK_LIBDL])
260 dnl LIBMISDN="$LIBMISDN $LIBDL"
263 dnl probably there could be a whole installation of misdn
264 pbx_misdn_dirs="/usr/local/mISDNuser /usr/local/misdn /usr/lib/mISDNuser /usr/lib/misdn"
267 AC_MSG_CHECKING([for mISDN-user])
268 LIBMISDN="-l$misdnlib -lisdnnet"
270 dnl if test "x$pbx_use_misdn_emb" != "xyes" && test "x$pbx_use_misdn_mac" != "xyes"; then
271 dnl LIBMISDN="$LIBMISDN $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
273 ac_misdnuser_includes=NO ac_misdnuser_libraries=NO ac_misdnuser_bindir=NO
274 misdnuser_libraries=""
275 misdnuser_includes=""
276 AC_ARG_WITH(misdnuser-dir,
277 AC_HELP_STRING([--with-misdnuser-dir=DIR],[where the root of mISDN-user is installed]),
278 [ ac_misdnuser_includes="$withval"/include
279 ac_misdnuser_libraries="$withval"/lib
280 ac_misdnuser_bindir="$withval"/bin
283 AC_ARG_WITH(misdnuser-includes,
284 AC_HELP_STRING([--with-misdnuser-includes=DIR],[where the mISDN-user includes are (default=$with-misdnuser-dir/include)]),
286 ac_misdnuser_includes="$withval"
289 pbx_misdn_libs_given=no
291 AC_ARG_WITH(misdnuser-libraries,
292 AC_HELP_STRING([--with-misdnuser-libraries=DIR],[where the mISDN-user library is installed (default=$with-misdnuser-dir/lib)]),
293 [ ac_misdnuser_libraries="$withval"
294 pbx_misdn_libs_given=yes
297 AC_CACHE_VAL(ac_cv_have_misdn,
298 [#try to guess mISDN-user locations
301 for dir in $pbx_misdn_dirs; do
302 misdn_incdirs="$misdn_incdirs $dir/include $dir"
304 misdn_incdirs="$MISDNINC $misdn_incdirs /usr/include/mISDNuser /usr/include/misdn /usr/include"
305 if test ! "$ac_misdnuser_includes" = "NO"; then
306 misdn_incdirs="$ac_misdnuser_includes $misdn_incdirs"
309 dnl if test "$pbx_misdnver" != "1"; then
310 pbx_misdn_header=mISDNlib.h
311 dnl -> und auch "isdn_net.h"
313 dnl pbx_misdn_header=qglobal.h
316 AC_FIND_FILE($pbx_misdn_header, $misdn_incdirs, misdn_incdir)
317 ac_misdnuser_includes="$misdn_incdir"
320 for dir in $pbx_misdn_dirs; do
321 misdn_libdirs="$misdn_libdirs $dir/lib $dir"
323 misdn_libdirs="$MISDNLIB $misdn_libdirs /usr/lib /usr/local/lib"
324 if test ! "$ac_misdnuser_libraries" = "NO"; then
325 misdn_libdir=$ac_misdnuser_libraries
327 misdn_libdirs="$ac_misdnuser_libraries $misdn_libdirs"
328 # if the mISDN-user was given, the chance is too big that libmisdn.* doesn't exist
330 for dir in $misdn_libdirs; do
331 try="ls -1 $dir/${LIBMISDN_GLOB}"
332 if test -n "`$try 2> /dev/null`"; then misdn_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
335 for a in $misdn_libdir/lib`echo ${pbx_int_misdn} | sed 's,^-l,,'`_incremental.*; do
336 if test -e "$a"; then
337 LIBMISDN="$LIBMISDN ${pbx_int_misdn}_incremental"
342 ac_misdnuser_libraries="$misdn_libdir"
347 ac_cxxflags_safe="$CXXFLAGS"
348 ac_ldflags_safe="$LDFLAGS"
351 CXXFLAGS="$CXXFLAGS -I$misdn_incdir $all_includes"
352 LDFLAGS="$LDFLAGS -L$misdn_libdir $all_libraries $USER_LDFLAGS"
353 LIBS="$LIBS $LIBMISDN"
355 PBX_PRINT_MISDNUSER_PROGRAM
357 if AC_TRY_EVAL(ac_link) && test -s conftest; then
360 echo "configure: failed program was:" >&AC_FD_CC
361 cat conftest.$ac_ext >&AC_FD_CC
362 ac_misdnuser_libraries="NO"
365 CXXFLAGS="$ac_cxxflags_safe"
366 LDFLAGS="$ac_ldflags_safe"
370 if test "$ac_misdnuser_includes" = NO || test "$ac_misdnuser_libraries" = NO; then
371 ac_cv_have_misdn="have_misdn=no"
372 ac_misdnuser_notfound=""
374 if test "$ac_misdnuser_includes" = NO; then
375 if test "$ac_misdnuser_libraries" = NO; then
376 ac_misdnuser_notfound="(headers and libraries)";
378 ac_misdnuser_notfound="(headers)";
381 dnl if test "x$pbx_use_misdn_mt" = "xyes"; then
382 dnl missing_misdn_mt="Make sure that you have compiled mISDN-user with thread support!"
383 dnl ac_misdnuser_notfound="(library $misdnlib-mt)";
385 ac_misdnuser_notfound="(library $misdnlib)";
389 AC_MSG_ERROR([mISDN-user ($pbx_misdn_minversion) $ac_misdnuser_notfound not found. Please check your installation!
390 For more details about this problem, look at the end of config.log.$missing_misdn_mt])
397 eval "$ac_cv_have_misdn"
399 if test "$have_misdn" != yes; then
400 AC_MSG_RESULT([$have_misdn]);
402 ac_cv_have_misdn="have_misdn=yes \
403 ac_misdnuser_includes=$ac_misdnuser_includes ac_misdnuser_libraries=$ac_misdnuser_libraries"
404 AC_MSG_RESULT([libraries $ac_misdnuser_libraries, headers $ac_misdnuser_includes $USING_MISDN_MT])
406 misdnuser_libraries="$ac_misdnuser_libraries"
407 misdnuser_includes="$ac_misdnuser_includes"
410 dnl if test ! "$pbx_misdn_libs_given" = "yes" && test ! "$pbx_misdnver" = 3; then
411 dnl KDE_CHECK_MISDN_DIRECT(misdnuser_libraries= ,[])
414 AC_SUBST(misdnuser_libraries)
415 AC_SUBST(misdnuser_includes)
417 if test -z "$misdnuser_includes"; then
420 MISDN_INCLUDES="-I$misdnuser_includes"
421 all_includes="$MISDN_INCLUDES $all_includes"
424 if test -z "$misdnuser_libraries"; then
427 MISDN_LDFLAGS="-L$misdnuser_libraries"
428 all_libraries="$MISDN_LDFLAGS $all_libraries"
430 dnl test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
432 AC_SUBST(MISDN_INCLUDES)
433 AC_SUBST(MISDN_LDFLAGS)
434 dnl AC_PATH_MISDN_MOC_UIC
436 dnl KDE_CHECK_MISDN_JPEG
438 dnl if test "x$pbx_use_misdn_emb" != "xyes" && test "x$pbx_use_misdn_mac" != "xyes"; then
439 dnl LIB_MISDN="$pbx_int_misdn $LIBJPEG_MISDN "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
441 dnl LIB_MISDN="$pbx_int_misdn $LIBJPEG_MISDN "'$(LIBZ) $(LIBPNG)'
443 dnl test -z "$KDE_MT_LIBS" || LIB_MISDN="$LIB_MISDN $KDE_MT_LIBS"
444 dnl for a in $misdn_libdir/lib`echo ${pbx_int_misdn} | sed 's,^-l,,'`_incremental.*; do
445 dnl if test -e "$a"; then
446 dnl LIB_MISDN="$LIB_MISDN ${pbx_int_misdn}_incremental"
452 dnl AC_SUBST(LIB_QPE)
454 AC_SUBST(pbx_misdnver)
460 dnl ------------------------------------------------------------------------
461 dnl Try to find the mISDN-kernel headers.
462 dnl $(MISDNKERNEL_INCLUDES) will be -Imisdnkernelhdrlocation (if needed)
463 dnl ------------------------------------------------------------------------
465 AC_DEFUN([AC_PATH_MISDNKERNEL],
469 misdn_kernel_major_version_demand=6
470 misdn_kernel_minor_version_demand=0
471 lcr_misdn_kernel_minversion=$misdn_kernel_major_version_demand.$misdn_kernel_minor_version_demand
473 dnl ## TODO !! convert misdnuser variables to misdn kernel header variables
475 dnl probably there could be a whole installation of misdn
476 kernel_ver=$(uname -r)
477 misdn_kernelheader_dirs="/lib/modules/$kernel_ver/source/include /usr/src/linux/include/"
480 AC_MSG_CHECKING([for mISDN-kernel])
481 dnl LIBMISDN="-l$misdnlib -lisdnnet"
483 dnl if test "x$pbx_use_misdn_emb" != "xyes" && test "x$pbx_use_misdn_mac" != "xyes"; then
484 dnl LIBMISDN="$LIBMISDN $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
486 dnl ac_misdnkernel_includes=NO ac_misdnkernel_libraries=NO ac_misdnkernel_bindir=NO
487 ac_misdnkernel_includes=NO
488 dnl misdnkernel_libraries=""
489 misdnkernel_includes=""
490 dnl AC_ARG_WITH(misdnkernel-dir,
491 dnl AC_HELP_STRING([--with-misdnkernel-dir=DIR],[where the mISDN-headers are installed ]),
492 dnl [ ac_misdnkernel_includes="$withval"/include
493 dnl ac_misdnkernel_libraries="$withval"/lib
494 dnl ac_misdnkernel_bindir="$withval"/bin
497 AC_ARG_WITH(misdnkernel-includes,
498 AC_HELP_STRING([--with-misdnkernel-includes=DIR],[where the mISDN-kernel includes are. Used if enable-socket-misdn]),
500 ac_misdnkernel_includes="$withval"
503 dnl pbx_misdn_libs_given=no
505 dnl AC_ARG_WITH(misdnkernel-libraries,
506 dnl AC_HELP_STRING([--with-misdnkernel-libraries=DIR],[where the mISDN-kernel library is installed.]),
507 dnl [ ac_misdnkernel_libraries="$withval"
508 dnl pbx_misdn_libs_given=yes
511 AC_CACHE_VAL(ac_cv_have_misdnkernel,
512 [#try to guess mISDN-user locations
514 misdnkernel_incdirs=""
515 for dir in $misdn_kernelheader_dirs; do
516 misdnkernel_incdirs="$misdnkernel_incdirs $dir/include $dir"
518 misdnkernel_incdirs="$MISDNKERNELINC $misdnkernel_incdirs /usr/include/mISDNuser /usr/include/misdn /usr/include"
519 if test ! "$ac_misdnkernel_includes" = "NO"; then
520 misdnkernel_incdirs="$ac_misdnkernel_includes $misdnkernel_incdirs"
523 pbx_misdn_kernel_header=linux/mISDNif.h
525 AC_FIND_FILE($pbx_misdn_kernel_header, $misdnkernel_incdirs, misdnkernel_incdir)
526 ac_misdnkernel_includes="$misdnkernel_incdir"
529 dnl for dir in $misdn_kernelheader_dirs; do
530 dnl misdn_libdirs="$misdn_libdirs $dir/lib $dir"
532 dnl misdn_libdirs="$MISDNLIB $misdn_libdirs /usr/lib /usr/local/lib"
533 dnl if test ! "$ac_misdnkernel_libraries" = "NO"; then
534 dnl misdn_libdir=$ac_misdnkernel_libraries
536 dnl misdn_libdirs="$ac_misdnkernel_libraries $misdn_libdirs"
537 dnl # if the mISDN-user was given, the chance is too big that libmisdn.* doesn't exist
538 dnl misdn_libdir=NONE
539 dnl for dir in $misdn_libdirs; do
540 dnl try="ls -1 $dir/${LIBMISDN_GLOB}"
541 dnl if test -n "`$try 2> /dev/null`"; then misdn_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
544 dnl for a in $misdn_libdir/lib`echo ${pbx_int_misdn} | sed 's,^-l,,'`_incremental.*; do
545 dnl if test -e "$a"; then
546 dnl LIBMISDN="$LIBMISDN ${pbx_int_misdn}_incremental"
551 dnl ac_misdnkernel_libraries="$misdn_libdir"
556 ac_cxxflags_safe="$CXXFLAGS"
557 ac_ldflags_safe="$LDFLAGS"
560 CXXFLAGS="$CXXFLAGS -I$misdnkernel_incdir $all_includes"
561 LDFLAGS="$LDFLAGS -L$misdn_libdir $all_libraries $USER_LDFLAGS"
562 LIBS="$LIBS $LIBMISDN"
564 PBX_PRINT_MISDNKERNEL_PROGRAM
566 if AC_TRY_EVAL(ac_compile) && test -s conftest.o; then
569 echo "configure: failed program was:" >&AC_FD_CC
570 cat conftest.$ac_ext >&AC_FD_CC
571 ac_misdnkernel_includes="NO"
572 dnl ac_misdnkernel_libraries="NO"
575 CXXFLAGS="$ac_cxxflags_safe"
576 LDFLAGS="$ac_ldflags_safe"
580 dnl if test "$ac_misdnkernel_includes" = NO || test "$ac_misdnkernel_libraries" = NO; then
581 if test "$ac_misdnkernel_includes" = NO; then
582 ac_cv_have_misdnkernel="have_misdnkernel=no"
583 ac_misdnkernel_notfound=""
585 dnl if test "$ac_misdnkernel_includes" = NO; then
586 dnl if test "$ac_misdnkernel_libraries" = NO; then
587 dnl ac_misdnkernel_notfound="(headers and libraries)";
589 ac_misdnkernel_notfound="(headers)";
592 dnl ac_misdnkernel_notfound="(library $misdnlib)";
595 AC_MSG_ERROR([mISDN kernel header (version >= $lcr_misdn_kernel_minversion) not found. Please check your installation!
596 For more details about this problem, look at the end of config.log.$missing_misdn_mt])
598 have_misdnkernel="yes"
602 dnl check cache content
603 dnl TODO: maybe move this to beginning (before compilation test?)
604 eval "$ac_cv_have_misdnkernel"
606 if test "$have_misdnkernel" != yes; then
607 AC_MSG_RESULT([$have_misdnkernel]);
609 ac_cv_have_misdnkernel="have_misdnkernel=yes \
610 ac_misdnkernel_includes=$ac_misdnkernel_includes"
611 dnl ac_misdnkernel_libraries=$ac_misdnkernel_libraries"
612 AC_MSG_RESULT([headers $ac_misdnkernel_includes])
614 dnl misdnkernel_libraries="$ac_misdnkernel_libraries"
615 misdnkernel_includes="$ac_misdnkernel_includes"
618 dnl if test ! "$pbx_misdn_libs_given" = "yes" && test ! "$pbx_misdnver" = 3; then
619 dnl KDE_CHECK_MISDN_DIRECT(misdnkernel_libraries= ,[])
622 dnl AC_SUBST(misdnkernel_libraries)
623 AC_SUBST(misdnkernel_includes)
625 if test -z "$misdnkernel_includes"; then
626 MISDNKERNEL_INCLUDES=""
628 MISDNKERNEL_INCLUDES="-I$misdnkernel_includes"
629 all_includes="$MISDNKERNEL_INCLUDES $all_includes"
632 dnl if test -z "$misdnkernel_libraries"; then
635 dnl MISDN_LDFLAGS="-L$misdnkernel_libraries"
636 dnl all_libraries="$MISDN_LDFLAGS $all_libraries"
638 dnl test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
640 AC_SUBST(MISDNKERNEL_INCLUDES)
641 dnl AC_SUBST(MISDN_LDFLAGS)
642 dnl AC_PATH_MISDN_MOC_UIC
644 dnl KDE_CHECK_MISDN_JPEG
646 dnl if test "x$pbx_use_misdn_emb" != "xyes" && test "x$pbx_use_misdn_mac" != "xyes"; then
647 dnl LIB_MISDN="$pbx_int_misdn $LIBJPEG_MISDN "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
649 dnl LIB_MISDN="$pbx_int_misdn $LIBJPEG_MISDN "'$(LIBZ) $(LIBPNG)'
651 dnl test -z "$KDE_MT_LIBS" || LIB_MISDN="$LIB_MISDN $KDE_MT_LIBS"
652 dnl for a in $misdn_libdir/lib`echo ${pbx_int_misdn} | sed 's,^-l,,'`_incremental.*; do
653 dnl if test -e "$a"; then
654 dnl LIB_MISDN="$LIB_MISDN ${pbx_int_misdn}_incremental"
659 dnl AC_SUBST(LIB_MISDN)
660 dnl AC_SUBST(LIB_QPE)
662 AC_SUBST(pbx_misdnver)
668 dnl ------------------------------------------------------------------------
669 dnl Find a file (or one of more files in a list of dirs)
670 dnl ------------------------------------------------------------------------
671 AC_DEFUN([AC_FIND_FILE],
678 echo "configure: __oline__: $i/$j" >&AC_FD_CC
679 if test -r "$i/$j"; then
680 echo "taking that" >&AC_FD_CC
690 dnl ------------------------------------------------------------------------
691 dnl Taken from http://autoconf-archive.cryp.to/ac_define_dir.html
692 dnl Copyright © 2006 Stepan Kasal <kasal@ucw.cz>
693 dnl Copyright © 2006 Andreas Schwab <schwab@suse.de>
694 dnl Copyright © 2006 Guido U. Draheim <guidod@gmx.de>
695 dnl Copyright © 2006 Alexandre Oliva
696 dnl Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
698 dnl This macro sets VARNAME to the expansion of the DIR variable, taking care
699 dnl of fixing up ${prefix} and such.
700 dnl ------------------------------------------------------------------------
701 AC_DEFUN([AC_DEFINE_DIR], [
704 test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
705 test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
706 dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
707 dnl refers to ${prefix}. Thus we have to use `eval' twice.
708 eval ac_define_dir="\"[$]$2\""
709 eval ac_define_dir="\"$ac_define_dir\""
710 AC_SUBST($1, "$ac_define_dir")
711 AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
712 test "$prefix_NONE" && prefix=NONE
713 test "$exec_prefix_NONE" && exec_prefix=NONE
717 dnl ------------------------------------------------------------------------
718 dnl taken from http://autoconf-archive.cryp.to/ax_ext_check_header.html
719 dnl Copyright © 2005 Duncan Simpson <dps@simpson.demon.co.uk>
720 dnl Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
722 dnl Checks locations of headers in various places
723 dnl Extended by Jörg Habenicht
724 dnl ------------------------------------------------------------------------
725 AC_DEFUN([AX_EXT_HAVE_HEADER],
727 AC_CHECK_HEADER($1, [$3 got="yes"], [$4 got="no"], [$5])
728 hdr=`echo $1 | $as_tr_sh`
731 if test "x${got}" = "xno"; then
732 ext_hashdr_cvdir=`echo $dir | $as_tr_sh`
733 AC_CACHE_CHECK([for $1 header with -I$dir],
734 [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
735 [ext_have_hdr_save_cflags=${CFLAGS}
736 CFLAGS="${CFLAGS} -I${dir}"
738 [AC_LANG_PROGRAM([#include <$1>])],
739 [got="yes"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="yes"],
740 [got="no"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="no"])
741 CFLAGS=$ext_have_hdr_save_cflags])
742 if eval `echo 'test x${'ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}'}' = "xyes"`; then
743 CFLAGS="${CFLAGS} -I${dir}"
744 CPPFLAGS="${CPPFLAGS} -I${dir}"
746 hdr=`echo $1 | $as_tr_cpp`
747 AC_DEFINE_UNQUOTED(HAVE_${hdr}, 1,
748 [Define this if you have the $1 header])
755 dnl ------------------------------------------------------------------------
756 dnl taken from http://autoconf-archive.cryp.to/ax_ext_check_header.html
757 dnl Copyright © 2005 Duncan Simpson <dps@simpson.demon.co.uk>
758 dnl Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
760 dnl Checks locations of headers in various places
761 dnl Extended by Jörg Habenicht
762 dnl ------------------------------------------------------------------------
763 dnl $1 include file name
764 dnl $2 directory list
767 dnl $5 include prefix
768 dnl $6 include suffix
769 dnl $7 main() body content
770 AC_DEFUN([PBX_EXT_HAVE_CXX_HEADER],
772 AC_CHECK_HEADER($1, [$3 got="yes"], [$4 got="no"], [$5])
773 hdr=`echo $1 | $as_tr_sh`
775 if test "x${got}" = "xno"; then
776 ext_hashdr_cvdir=`echo $dir | $as_tr_sh`
777 AC_CACHE_CHECK([for $1 header with -I$dir],
778 [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
779 [ext_have_hdr_save_cxxflags=${CXXFLAGS}
780 CXXFLAGS="${CXXFLAGS} -I${dir}"
782 [PBX_PRINT_PROGRAM([#include <$1>],[$5],[$6],[$7])],
783 [$3 got="yes"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="yes"],
784 [$4 got="no"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="no"])
785 CXXFLAGS=$ext_have_hdr_save_cxxflags])
786 if eval `echo 'test x${'ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}'}' = "xyes"`; then
787 CXXFLAGS="${CXXFLAGS} -I${dir}"
788 CPPFLAGS="${CPPFLAGS} -I${dir}"
790 hdr=`echo $1 | $as_tr_cpp`
791 AC_DEFINE_UNQUOTED(HAVE_${hdr}, 1,
792 [Define this if you have the $1 header])