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"
191 LEX_BASENAME=`basename "$LEX"`
192 if test x"$LEX_BASENAME" = x"flex"; then
194 FLEX_VERSION=`$LEX --version | cut -d ' ' -f2`
195 AC_MSG_CHECKING(flex version)
196 AC_MSG_RESULT($FLEX_VERSION)
197 FLEX_MAJOR=`echo $FLEX_VERSION | cut -d '.' -f1`
198 FLEX_MINOR=`echo $FLEX_VERSION | cut -d '.' -f2`
199 FLEX_RELEASE=`echo $FLEX_VERSION | cut -d '.' -f3`
201 LEX_VERSION="flex-$FLEX_MAJOR.$FLEX_MINOR.$FLEX_RELEASE"
205 YACC_BASENAME=`basename "$YACC"`
206 if test x"$YACC_BASENAME" = x"bison -y"; then
207 # bison (GNU Bison) 2.3
208 BISON_VERSION=`$YACC --version | head -1 | cut -d ' ' -f4`
209 AC_MSG_CHECKING(bison version)
210 AC_MSG_RESULT($BISON_VERSION)
211 BISON_MAJOR=`echo $BISON_VERSION | cut -d '.' -f1`
212 BISON_MINOR=`echo $BISON_VERSION | cut -d '.' -f2`
214 YACC_VERSION="bison-$BISON_MAJOR.$BISON_MINOR"
217 AC_MSG_CHECKING(working LEX YACC combination)
219 if test x"$LEX_VERSION" != x"" -a x"$YACC_VERSION" != x""; then
220 V="$LEX_VERSION:$YACC_VERSION"
221 for C in $LEX_YACC_COMBINATIONS; do
222 if test x"$V" = x"$C"; then
228 if test x"$LEX_YACC" = x"no"; then
232 AC_MSG_RESULT($LEX_YACC)
234 # Portions of heimdal kerberos are unpacked into source/heimdal
235 # of the samba source tree.
237 # if we ever get to using a host kerberos, we might add conditionals here
238 AC_DEFINE(HAVE_KRB5,1,[Whether kerberos is available])
240 SMB_ENABLE(KERBEROS_LIB, YES)
241 SMB_ENABLE(asn1_compile, YES)
242 SMB_ENABLE(compile_et, YES)
244 # only add closefrom if needed
245 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, NO)
246 if test t$ac_cv_func_closefrom != tyes; then
247 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, YES)
250 # only add getprogname if needed
251 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, NO)
252 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, NO)
253 if test t$ac_cv_func_getprogname != tyes; then
254 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, YES)
255 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, YES)