change the check for zaptel to only check for linux/zaptel.h on Linux, and
[asterisk/asterisk.git] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 # AST_EXT_LIB([NAME], [FUNCTION], [package header], [package symbol name], [package friendly name], [additional LIB data])
15
16 AC_DEFUN([AST_EXT_LIB],
17 [
18 AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $5 files in PATH]),[
19 case ${withval} in
20      n|no)
21      USE_$1=no
22      ;;
23      y|ye|yes)
24      $1_MANDATORY="yes"
25      ;;
26      *)
27      $1_DIR="${withval}"
28      $1_MANDATORY="yes"
29      ;;
30 esac
31 ])
32
33 PBX_LIB$1=0
34
35 if test "${USE_$1}" != "no"; then
36    libdir=""
37    if test "x${$1_DIR}" != "x"; then
38       libdir="-L${$1_DIR}/lib"
39    fi
40    AC_CHECK_LIB([$1], [$2], [:], [], ${libdir} $6)
41
42    if test "${ac_cv_lib_$1_$2}" = "yes"; then
43       $1_LIB="-l$1 $6"
44       $4_HEADER_FOUND="1"
45       if test "x${$1_DIR}" != "x"; then
46          $1_LIB="${libdir} ${$1_LIB}"
47          $1_INCLUDE="-I${$1_DIR}/include"
48          if test "x$3" != "x" ; then
49             AC_CHECK_HEADER([${$1_DIR}/include/$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
50          fi
51       else
52          if test "x$3" != "x" ; then
53             AC_CHECK_HEADER([$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )
54          fi
55       fi
56       if test "x${$4_HEADER_FOUND}" = "x0" ; then
57          if test ! -z "${$1_MANDATORY}" ;
58          then
59             echo " ***"
60             echo " *** It appears that you do not have the $1 development package installed."
61             echo " *** Please install it to include $5 support, or re-run configure"
62             echo " *** without explicitly specifying --with-$1"
63             exit 1
64          fi
65          $1_LIB=""
66          $1_INCLUDE=""
67          PBX_LIB$1=0
68       else
69          PBX_LIB$1=1
70          AC_DEFINE_UNQUOTED([HAVE_$4], 1, [Define to indicate the $5 library])
71       fi
72    elif test ! -z "${$1_MANDATORY}";
73    then
74       echo "***"
75       echo "*** The $5 installation on this system appears to be broken."
76       echo "*** Either correct the installation, or run configure"
77       echo "*** without explicity specifying --with-$1"
78       exit 1
79    fi
80 fi
81 AC_SUBST([$1_LIB])
82 AC_SUBST([$1_INCLUDE])
83 AC_SUBST([PBX_LIB$1])
84 ])
85
86
87 AC_DEFUN(
88 [AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
89    GNU_MAKE='Not Found' ;
90    for a in make gmake gnumake ; do
91       if test -z "$a" ; then continue ; fi ;
92       if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
93          GNU_MAKE=$a ;
94          break;
95       fi
96    done ;
97 ) ;
98 if test  "x$GNU_MAKE" = "xNot Found"  ; then
99    echo " *** Please install GNU make.  It is required to build Asterisk!"
100    exit 1
101 fi
102 AC_SUBST([GNU_MAKE])
103 ])
104