~ubuntu-branches/ubuntu/saucy/dahdi-tools/saucy-proposed

« back to all changes in this revision

Viewing changes to menuselect/acinclude.m4

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-08-25 12:48:37 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130825124837-wtefi7f9dsihg8is
Tags: 1:2.7.0-1ubuntu1
* Merge from debian. Remaining changes:
  - debian/control: Added gawk as dependency for dkms build
  - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source
  - debian/control: Set ubuntu maintainer    
  - added debian/dahdi.postinst
  - debian/control: Removed Uploaders field.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Helper function to check for gcc attributes.
2
 
# AST_GCC_ATTRIBUTE([attribute name], [attribute syntax], [attribute scope], [makeopts flag])
3
 
 
4
 
AC_DEFUN([AST_GCC_ATTRIBUTE],
5
 
[
6
 
AC_MSG_CHECKING(checking for compiler 'attribute $1' support)
7
 
saved_CFLAGS="$CFLAGS"
8
 
CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
9
 
m4_ifval([$4],$4=0)
10
 
 
11
 
if test "x$2" = "x"
12
 
then
13
 
AC_COMPILE_IFELSE(
14
 
        AC_LANG_PROGRAM([$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
15
 
                        []),
16
 
        AC_MSG_RESULT(yes)
17
 
        m4_ifval([$4],$4=1)
18
 
        AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
19
 
        AC_MSG_RESULT(no)
20
 
)
21
 
else
22
 
AC_COMPILE_IFELSE(
23
 
        AC_LANG_PROGRAM([$3 void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}],
24
 
                        []),
25
 
        AC_MSG_RESULT(yes)
26
 
        m4_ifval([$4],$4=1)
27
 
        AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
28
 
        AC_MSG_RESULT(no)
29
 
)
30
 
fi
31
 
 
32
 
m4_ifval([$4],[AC_SUBST($4)])
33
 
CFLAGS="$saved_CFLAGS"
34
 
])
35
 
 
36
 
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
37
 
 
38
 
AC_DEFUN([AST_EXT_LIB_SETUP],
39
 
[
40
 
$1_DESCRIP="$2"
41
 
$1_OPTION="$3"
42
 
AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),[
43
 
case ${withval} in
44
 
     n|no)
45
 
     USE_$1=no
46
 
     ;;
47
 
     y|ye|yes)
48
 
     $1_MANDATORY="yes"
49
 
     ;;
50
 
     *)
51
 
     $1_DIR="${withval}"
52
 
     $1_MANDATORY="yes"
53
 
     ;;
54
 
esac
55
 
])
56
 
PBX_$1=0
57
 
AC_SUBST([$1_LIB])
58
 
AC_SUBST([$1_INCLUDE])
59
 
AC_SUBST([PBX_$1])
60
 
])
61
 
 
62
 
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
63
 
 
64
 
AC_DEFUN([AST_EXT_LIB_CHECK],
65
 
[
66
 
if test "${USE_$1}" != "no"; then
67
 
   pbxlibdir=""
68
 
   if test "x${$1_DIR}" != "x"; then
69
 
      if test -d ${$1_DIR}/lib; then
70
 
         pbxlibdir="-L${$1_DIR}/lib"
71
 
      else
72
 
         pbxlibdir="-L${$1_DIR}"
73
 
      fi
74
 
   fi
75
 
   AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
76
 
 
77
 
   if test "${AST_$1_FOUND}" = "yes"; then
78
 
      $1_LIB="-l$2 $5"
79
 
      $1_HEADER_FOUND="1"
80
 
      if test "x${$1_DIR}" != "x"; then
81
 
         $1_LIB="${pbxlibdir} ${$1_LIB}"
82
 
         $1_INCLUDE="-I${$1_DIR}/include"
83
 
         if test "x$4" != "x" ; then
84
 
            AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
85
 
         fi
86
 
      else
87
 
         if test "x$4" != "x" ; then
88
 
            AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
89
 
         fi
90
 
      fi
91
 
      if test "x${$1_HEADER_FOUND}" = "x0" ; then
92
 
         if test ! -z "${$1_MANDATORY}" ;
93
 
         then
94
 
            AC_MSG_NOTICE( ***)
95
 
            AC_MSG_NOTICE( *** It appears that you do not have the $2 development package installed.)
96
 
            AC_MSG_NOTICE( *** Please install it to include ${$1_DESCRIP} support, or re-run configure)
97
 
            AC_MSG_NOTICE( *** without explicitly specifying --with-${$1_OPTION})
98
 
            exit 1
99
 
         fi
100
 
         $1_LIB=""
101
 
         $1_INCLUDE=""
102
 
         PBX_$1=0
103
 
      else
104
 
         PBX_$1=1
105
 
         AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
106
 
      fi
107
 
   elif test ! -z "${$1_MANDATORY}";
108
 
   then
109
 
      AC_MSG_NOTICE(***)
110
 
      AC_MSG_NOTICE(*** The ${$1_DESCRIP} installation on this system appears to be broken.)
111
 
      AC_MSG_NOTICE(*** Either correct the installation, or run configure)
112
 
      AC_MSG_NOTICE(*** without explicitly specifying --with-${$1_OPTION})
113
 
      exit 1
114
 
   fi
115
 
fi
116
 
])
117
 
 
118
 
 
119
 
AC_DEFUN(
120
 
[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK([for GNU make], [ac_cv_GNU_MAKE],
121
 
   ac_cv_GNU_MAKE='Not Found' ;
122
 
   ac_cv_GNU_MAKE_VERSION_MAJOR=0 ;
123
 
   ac_cv_GNU_MAKE_VERSION_MINOR=0 ;
124
 
   for a in make gmake gnumake ; do
125
 
      if test -z "$a" ; then continue ; fi ;
126
 
      if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
127
 
         ac_cv_GNU_MAKE=$a ;
128
 
         ac_cv_GNU_MAKE_VERSION_MAJOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
129
 
         ac_cv_GNU_MAKE_VERSION_MINOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
130
 
         break;
131
 
      fi
132
 
   done ;
133
 
) ;
134
 
if test  "x$ac_cv_GNU_MAKE" = "xNot Found"  ; then
135
 
   AC_MSG_ERROR( *** Please install GNU make.  It is required to build Asterisk!)
136
 
   exit 1
137
 
fi
138
 
AC_SUBST([GNU_MAKE], [$ac_cv_GNU_MAKE])
139
 
])
140
 
 
141
 
# AST_FUNC_FORK
142
 
# -------------
143
 
AN_FUNCTION([fork],  [AST_FUNC_FORK])
144
 
AN_FUNCTION([vfork], [AST_FUNC_FORK])
145
 
AC_DEFUN([AST_FUNC_FORK],
146
 
[AC_REQUIRE([AC_TYPE_PID_T])dnl
147
 
AC_CHECK_HEADERS(vfork.h)
148
 
AC_CHECK_FUNCS(fork vfork)
149
 
if test "x$ac_cv_func_fork" = xyes; then
150
 
  _AST_FUNC_FORK
151
 
else
152
 
  ac_cv_func_fork_works=$ac_cv_func_fork
153
 
fi
154
 
if test "x$ac_cv_func_fork_works" = xcross; then
155
 
  case $host in
156
 
    *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* )
157
 
      # Override, as these systems have only a dummy fork() stub
158
 
      ac_cv_func_fork_works=no
159
 
      ;;
160
 
    *)
161
 
      ac_cv_func_fork_works=yes
162
 
      ;;
163
 
  esac
164
 
  AC_MSG_WARN([result $ac_cv_func_fork_works guessed because of cross compilation])
165
 
fi
166
 
ac_cv_func_vfork_works=$ac_cv_func_vfork
167
 
if test "x$ac_cv_func_vfork" = xyes; then
168
 
  _AC_FUNC_VFORK
169
 
fi;
170
 
if test "x$ac_cv_func_fork_works" = xcross; then
171
 
  ac_cv_func_vfork_works=$ac_cv_func_vfork
172
 
  AC_MSG_WARN([result $ac_cv_func_vfork_works guessed because of cross compilation])
173
 
fi
174
 
 
175
 
if test "x$ac_cv_func_vfork_works" = xyes; then
176
 
  AC_DEFINE(HAVE_WORKING_VFORK, 1, [Define to 1 if `vfork' works.])
177
 
else
178
 
  AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
179
 
fi
180
 
if test "x$ac_cv_func_fork_works" = xyes; then
181
 
  AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.])
182
 
fi
183
 
])# AST_FUNC_FORK
184
 
 
185
 
 
186
 
# _AST_FUNC_FORK
187
 
# -------------
188
 
AC_DEFUN([_AST_FUNC_FORK],
189
 
  [AC_CACHE_CHECK(for working fork, ac_cv_func_fork_works,
190
 
    [AC_RUN_IFELSE(
191
 
      [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
192
 
        [
193
 
          /* By Ruediger Kuhlmann. */
194
 
          return fork () < 0;
195
 
        ])],
196
 
      [ac_cv_func_fork_works=yes],
197
 
      [ac_cv_func_fork_works=no],
198
 
      [ac_cv_func_fork_works=cross])])]
199
 
)# _AST_FUNC_FORK