1 m4_define([upcase],`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
3 m4_ifndef([AC_WARNING_ENABLE],[AC_DEFUN([AC_WARNING_ENABLE],[])])
5 dnl love_FIND_FUNC(func, includes, arguments)
6 dnl kind of like AC_CHECK_FUNC, but with headerfiles
7 AC_DEFUN([love_FIND_FUNC], [
9 AC_MSG_CHECKING([for $1])
10 AC_CACHE_VAL(ac_cv_love_func_$1,
12 AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]],[[$1($3)]])],
13 [eval "ac_cv_love_func_$1=yes"],[eval "ac_cv_love_func_$1=no"])])
15 eval "ac_res=\$ac_cv_love_func_$1"
21 eval "ac_tr_func=HAVE_[]upcase($1)"
25 AC_DEFINE_UNQUOTED($ac_tr_func)
36 dnl Not all systems have err.h, so we provide a replacement. Heimdal
37 dnl unconditionally #includes <err.h>, so we need to create an err.h,
38 dnl but we can't just have a static one because we don't want to use
39 dnl it on systems that have a real err.h. If the system has a real
40 dnl err.h, we should use that (eg. on Darwin, the declarations get
41 dnl linker attributes added, so we can't guarantee that our local
42 dnl declarations will be correct). Phew!
43 AC_CHECK_HEADERS([err.h], [],
44 [ cp heimdal/lib/roken/err.hin heimdal_build/err.h ])
110 love_FIND_FUNC(bswap16, [#ifdef HAVE_SYS_BSWAP_H
111 #include <sys/bswap.h>
114 love_FIND_FUNC(bswap32, [#ifdef HAVE_SYS_BSWAP_H
115 #include <sys/bswap.h>
118 AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [
119 AC_MSG_CHECKING(for struct winsize)
120 AC_CACHE_VAL(ac_cv_struct_winsize, [
121 ac_cv_struct_winsize=no
122 for i in sys/termios.h sys/ioctl.h; do
124 struct[[ ]]*winsize,dnl
125 $i, ac_cv_struct_winsize=yes; break)dnl
128 if test "$ac_cv_struct_winsize" = "yes"; then
129 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
131 AC_MSG_RESULT($ac_cv_struct_winsize)
132 AC_EGREP_HEADER(ws_xpixel, termios.h,
133 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
134 AC_EGREP_HEADER(ws_ypixel, termios.h,
135 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
138 AC_KRB_STRUCT_WINSIZE
141 if test "$ac_cv_type_signal" = "void" ; then
142 AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
144 AC_SUBST(VOID_RETSIGTYPE)
147 m4_include(heimdal/cf/check-var.m4)
149 rk_CHECK_VAR(h_errno,
150 [#ifdef HAVE_SYS_TYPES_H
151 #include <sys/types.h>
157 m4_include(heimdal/cf/find-func.m4)
158 m4_include(heimdal/cf/find-func-no-libs.m4)
159 m4_include(heimdal/cf/find-func-no-libs2.m4)
160 m4_include(heimdal/cf/resolv.m4)
163 AC_CHECK_LIB_EXT(util, OPENPTY_LIBS, openpty)
165 SMB_ENABLE(OPENPTY,YES)
167 SMB_EXT_LIB(OPENPTY,[${OPENPTY_LIBS}],[${OPENPTY_CFLAGS}],[${OPENPTY_CPPFLAGS}],[${OPENPTY_LDFLAGS}])
173 dnl This fills in the global LIBS...
176 dnl AC_CHECK_LIB_EXT(resolv, RESOLV_LIBS, res_search)
177 SMB_ENABLE(RESOLV,YES)
179 if test x"$LIBS" != "x"; then
185 SMB_EXT_LIB(RESOLV,[${RESOLV_LIBS}],[${RESOLV_CFLAGS}],[${RESOLV_CPPFLAGS}],[${RESOLV_LDFLAGS}])
188 # these are disabled unless heimdal is found below
189 SMB_ENABLE(KERBEROS_LIB, NO)
190 SMB_ENABLE(asn1_compile, NO)
191 SMB_ENABLE(compile_et, NO)
194 # We need bison -y and flex in new versions
195 # Otherwise we get random runtime failures
197 LEX_YACC_COMBINATIONS=""
198 LEX_YACC_COMBINATIONS="$LEX_YACC_COMBINATIONS flex-2.5.33:bison-2.3"
199 LEX_YACC_COMBINATIONS="$LEX_YACC_COMBINATIONS flex-2.5.34:bison-2.3"
202 LEX_BASENAME=`basename "$LEX"`
203 if test x"$LEX_BASENAME" = x"flex"; then
205 FLEX_VERSION=`$LEX --version | cut -d ' ' -f2`
206 AC_MSG_CHECKING(flex version)
207 AC_MSG_RESULT($FLEX_VERSION)
208 FLEX_MAJOR=`echo $FLEX_VERSION | cut -d '.' -f1`
209 FLEX_MINOR=`echo $FLEX_VERSION | cut -d '.' -f2`
210 FLEX_RELEASE=`echo $FLEX_VERSION | cut -d '.' -f3`
212 LEX_VERSION="flex-$FLEX_MAJOR.$FLEX_MINOR.$FLEX_RELEASE"
216 YACC_BASENAME=`basename "$YACC"`
217 if test x"$YACC_BASENAME" = x"bison -y"; then
218 # bison (GNU Bison) 2.3
219 BISON_VERSION=`$YACC --version | head -1 | cut -d ' ' -f4`
220 AC_MSG_CHECKING(bison version)
221 AC_MSG_RESULT($BISON_VERSION)
222 BISON_MAJOR=`echo $BISON_VERSION | cut -d '.' -f1`
223 BISON_MINOR=`echo $BISON_VERSION | cut -d '.' -f2`
225 YACC_VERSION="bison-$BISON_MAJOR.$BISON_MINOR"
228 AC_MSG_CHECKING(working LEX YACC combination)
230 if test x"$LEX_VERSION" != x"" -a x"$YACC_VERSION" != x""; then
231 V="$LEX_VERSION:$YACC_VERSION"
232 for C in $LEX_YACC_COMBINATIONS; do
233 if test x"$V" = x"$C"; then
239 if test x"$LEX_YACC" = x"no"; then
243 AC_MSG_RESULT($LEX_YACC)
245 # Portions of heimdal kerberos are unpacked into source/heimdal
246 # of the samba source tree.
248 # if we ever get to using a host kerberos, we might add conditionals here
249 AC_DEFINE(HAVE_COM_ERR,1,[Whether com_err is available])
251 AC_DEFINE(HAVE_KRB5,1,[Whether kerberos is available])
253 AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])
255 SMB_ENABLE(KERBEROS_LIB, YES)
256 SMB_ENABLE(asn1_compile, YES)
257 SMB_ENABLE(compile_et, YES)
259 # only add closefrom if needed
260 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, NO)
261 if test t$ac_cv_func_closefrom != tyes; then
262 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, YES)
265 # only add getprogname if needed
266 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, NO)
267 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, NO)
268 if test t$ac_cv_func_getprogname != tyes; then
269 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, YES)
270 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, YES)
273 VPATH="$VPATH:\$(HEIMDAL_VPATH)"
275 AC_DEFINE(SAMBA4_INTERNAL_HEIMDAL,1,[Whether we use in internal heimdal build])
277 SMB_INCLUDE_MK(heimdal_build/internal.mk)