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>
116 dnl AC_HAVE_TYPE(TYPE,INCLUDES)
117 AC_DEFUN([AC_HAVE_TYPE], [
118 AC_REQUIRE([AC_HEADER_STDC])
119 cv=`echo "$1" | sed 'y%./+- %__p__%'`
120 AC_MSG_CHECKING(for $1)
121 AC_CACHE_VAL([ac_cv_type_$cv],
122 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
126 [eval "ac_cv_type_$cv=yes"],
127 [eval "ac_cv_type_$cv=no"]))dnl
128 ac_foo=`eval echo \\$ac_cv_type_$cv`
129 AC_MSG_RESULT($ac_foo)
130 if test "$ac_foo" = yes; then
131 ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
135 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
139 AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
140 AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
141 AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
142 AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
143 AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>])
144 AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
147 AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [
148 AC_MSG_CHECKING(for struct winsize)
149 AC_CACHE_VAL(ac_cv_struct_winsize, [
150 ac_cv_struct_winsize=no
151 for i in sys/termios.h sys/ioctl.h; do
153 struct[[ ]]*winsize,dnl
154 $i, ac_cv_struct_winsize=yes; break)dnl
157 if test "$ac_cv_struct_winsize" = "yes"; then
158 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
160 AC_MSG_RESULT($ac_cv_struct_winsize)
161 AC_EGREP_HEADER(ws_xpixel, termios.h,
162 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
163 AC_EGREP_HEADER(ws_ypixel, termios.h,
164 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
167 AC_KRB_STRUCT_WINSIZE
170 if test "$ac_cv_type_signal" = "void" ; then
171 AC_DEFINE(VOID_RETSIGTYPE, 1, [Define if signal handlers return void.])
173 AC_SUBST(VOID_RETSIGTYPE)
176 m4_include(heimdal/cf/check-var.m4)
178 rk_CHECK_VAR(h_errno,
179 [#ifdef HAVE_SYS_TYPES_H
180 #include <sys/types.h>
186 m4_include(heimdal/cf/find-func.m4)
187 m4_include(heimdal/cf/find-func-no-libs.m4)
188 m4_include(heimdal/cf/find-func-no-libs2.m4)
189 m4_include(heimdal/cf/resolv.m4)
195 dnl This fills in the global LIBS...
198 dnl AC_CHECK_LIB_EXT(resolv, RESOLV_LIBS, res_search)
199 SMB_ENABLE(RESOLV,YES)
201 if test x"$LIBS" != "x"; then
207 SMB_EXT_LIB(RESOLV,[${RESOLV_LIBS}],[${RESOLV_CFLAGS}],[${RESOLV_CPPFLAGS}],[${RESOLV_LDFLAGS}])
210 # these are disabled unless heimdal is found below
211 SMB_ENABLE(KERBEROS_LIB, NO)
212 SMB_ENABLE(asn1_compile, NO)
213 SMB_ENABLE(compile_et, NO)
218 # Portions of heimdal kerberos are unpacked into source/heimdal
219 # of the samba source tree.
221 # if we ever get to using a host kerberos, we might add conditionals here
222 AC_DEFINE(HAVE_KRB5,1,[Whether kerberos is available])
224 SMB_ENABLE(KERBEROS_LIB, YES)
225 SMB_ENABLE(asn1_compile, YES)
226 SMB_ENABLE(compile_et, YES)
228 # only add closefrom if needed
229 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, NO)
230 if test t$ac_cv_func_closefrom != tyes; then
231 SMB_ENABLE(HEIMDAL_ROKEN_CLOSEFROM, YES)
234 # only add getprogname if needed
235 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, NO)
236 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, NO)
237 if test t$ac_cv_func_getprogname != tyes; then
238 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME, YES)
239 SMB_ENABLE(HEIMDAL_ROKEN_GETPROGNAME_H, YES)