1 m4_define([upcase],`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
3 dnl love_FIND_FUNC(func, includes, arguments)
4 dnl kind of like AC_CHECK_FUNC, but with headerfiles
5 AC_DEFUN([love_FIND_FUNC], [
7 AC_MSG_CHECKING([for $1])
8 AC_CACHE_VAL(ac_cv_love_func_$1,
10 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[$1($3)]])],
11 [eval "ac_cv_love_func_$1=yes"],[eval "ac_cv_love_func_$1=no"])])
13 eval "ac_res=\$ac_cv_love_func_$1"
19 eval "ac_tr_func=HAVE_[]upcase($1)"
23 AC_DEFINE_UNQUOTED($ac_tr_func)
34 dnl Not all systems have err.h, so we provide a replacement. Heimdal
35 dnl unconditionally #includes <err.h>, so we need to create an err.h,
36 dnl but we can't just have a static one because we don't want to use
37 dnl it on systems that have a real err.h. If the system has a real
38 dnl err.h, we should use that (eg. on Darwin, the declarations get
39 dnl linker attributes added, so we can't guarantee that our local
40 dnl declarations will be correct). Phew!
41 AC_CHECK_HEADERS([err.h], [],
42 [ cp heimdal/lib/roken/err.hin heimdal_build/err.h ])
107 love_FIND_FUNC(bswap16, [#ifdef HAVE_SYS_BSWAP_H
108 #include <sys/bswap.h>
111 love_FIND_FUNC(bswap32, [#ifdef HAVE_SYS_BSWAP_H
112 #include <sys/bswap.h>
115 AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [
116 AC_MSG_CHECKING(for struct winsize)
117 AC_CACHE_VAL(ac_cv_struct_winsize, [
118 ac_cv_struct_winsize=no
119 for i in sys/termios.h sys/ioctl.h; do
121 struct[[ ]]*winsize,dnl
122 $i, ac_cv_struct_winsize=yes; break)dnl
125 if test "$ac_cv_struct_winsize" = "yes"; then
126 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
128 AC_MSG_RESULT($ac_cv_struct_winsize)
129 AC_EGREP_HEADER(ws_xpixel, termios.h,
130 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
131 AC_EGREP_HEADER(ws_ypixel, termios.h,
132 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
135 AC_KRB_STRUCT_WINSIZE
138 if test "$ac_cv_type_signal" = "void" ; then
139 AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
141 AC_SUBST(VOID_RETSIGTYPE)
144 m4_include(heimdal/cf/check-var.m4)
146 rk_CHECK_VAR(h_errno,
147 [#ifdef HAVE_SYS_TYPES_H
148 #include <sys/types.h>
154 m4_include(heimdal/cf/find-func.m4)
155 m4_include(heimdal/cf/find-func-no-libs.m4)
156 m4_include(heimdal/cf/find-func-no-libs2.m4)
157 m4_include(heimdal/cf/resolv.m4)
163 dnl This fills in the global LIBS...
166 dnl AC_CHECK_LIB_EXT(resolv, RESOLV_LIBS, res_search)
167 SMB_ENABLE(RESOLV,YES)
169 if test x"$LIBS" != "x"; then
175 SMB_EXT_LIB(RESOLV,[${RESOLV_LIBS}],[${RESOLV_CFLAGS}],[${RESOLV_CPPFLAGS}],[${RESOLV_LDFLAGS}])
178 # these are disabled unless heimdal is found below
179 SMB_ENABLE(KERBEROS_LIB, NO)
180 SMB_ENABLE(asn1_compile, NO)
181 SMB_ENABLE(compile_et, NO)
184 # We need bison -y and flex in new versions
185 # Otherwise we get random runtime failures
187 LEX_YACC_COMBINATIONS=""
188 LEX_YACC_COMBINATIONS="$LEX_YACC_COMBINATIONS flex-2.5.33:bison-2.3"
189 LEX_YACC_COMBINATIONS="$LEX_YACC_COMBINATIONS flex-2.5.34:bison-2.3"
192 LEX_BASENAME=`basename "$LEX"`
193 if test x"$LEX_BASENAME" = x"flex"; then
195 FLEX_VERSION=`$LEX --version | cut -d ' ' -f2`
196 AC_MSG_CHECKING(flex version)
197 AC_MSG_RESULT($FLEX_VERSION)
198 FLEX_MAJOR=`echo $FLEX_VERSION | cut -d '.' -f1`
199 FLEX_MINOR=`echo $FLEX_VERSION | cut -d '.' -f2`
200 FLEX_RELEASE=`echo $FLEX_VERSION | cut -d '.' -f3`
202 LEX_VERSION="flex-$FLEX_MAJOR.$FLEX_MINOR.$FLEX_RELEASE"
206 YACC_BASENAME=`basename "$YACC"`
207 if test x"$YACC_BASENAME" = x"bison -y"; then
208 # bison (GNU Bison) 2.3
209 BISON_VERSION=`$YACC --version | head -1 | cut -d ' ' -f4`
210 AC_MSG_CHECKING(bison version)
211 AC_MSG_RESULT($BISON_VERSION)
212 BISON_MAJOR=`echo $BISON_VERSION | cut -d '.' -f1`
213 BISON_MINOR=`echo $BISON_VERSION | cut -d '.' -f2`
215 YACC_VERSION="bison-$BISON_MAJOR.$BISON_MINOR"
218 AC_MSG_CHECKING(working LEX YACC combination)
220 if test x"$LEX_VERSION" != x"" -a x"$YACC_VERSION" != x""; then
221 V="$LEX_VERSION:$YACC_VERSION"
222 for C in $LEX_YACC_COMBINATIONS; do
223 if test x"$V" = x"$C"; then
229 if test x"$LEX_YACC" = x"no"; then
233 AC_MSG_RESULT($LEX_YACC)
235 # Portions of heimdal kerberos are unpacked into source/heimdal
236 # of the samba source tree.
238 # if we ever get to using a host kerberos, we might add conditionals here
239 AC_DEFINE(HAVE_KRB5,1,[Whether kerberos is available])
241 SMB_ENABLE(KERBEROS_LIB, YES)
242 SMB_ENABLE(asn1_compile, YES)
243 SMB_ENABLE(compile_et, YES)
245 # only add closefrom if needed
246 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, NO)
247 if test t$ac_cv_func_closefrom != tyes; then
248 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, YES)
251 # only add getprogname if needed
252 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, NO)
253 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, NO)
254 if test t$ac_cv_func_getprogname != tyes; then
255 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, YES)
256 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, YES)