other roken tests
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8703 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
500
cf/roken-frag.m4
Normal file
500
cf/roken-frag.m4
Normal file
@@ -0,0 +1,500 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl some code to get roken working
|
||||
dnl
|
||||
dnl rk_ROKEN(subdir)
|
||||
dnl
|
||||
AC_DEFUN(rk_ROKEN, [
|
||||
|
||||
DIR_roken=roken
|
||||
LIB_roken='$(top_builddir)/lib/roken/libroken.la'
|
||||
CPPFLAGS_roken='-I$(top_builddir)/lib/roken -I$(top_srcdir)/lib/roken'
|
||||
|
||||
AC_REQUIRE([rk_DB])
|
||||
|
||||
dnl Checks for programs
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_AWK])
|
||||
AC_REQUIRE([AC_OBJEXT])
|
||||
AC_REQUIRE([AC_EXEEXT])
|
||||
AC_REQUIRE([AC_PROG_LIBTOOL])
|
||||
|
||||
AC_REQUIRE([AC_MIPS_ABI])
|
||||
|
||||
dnl C characteristics
|
||||
|
||||
AC_REQUIRE([AC_C___ATTRIBUTE__])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_CONST])
|
||||
AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)
|
||||
|
||||
dnl C types
|
||||
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])
|
||||
AC_CHECK_TYPE_EXTRA(ssize_t, int, [#include <unistd.h>])
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
AC_REQUIRE([AC_TYPE_UID_T])
|
||||
AC_HAVE_TYPE([long long])
|
||||
|
||||
AC_REQUIRE([rk_RETSIGTYPE])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
|
||||
AC_CHECK_HEADERS([\
|
||||
arpa/inet.h \
|
||||
arpa/nameser.h \
|
||||
config.h \
|
||||
crypt.h \
|
||||
dbm.h \
|
||||
db.h \
|
||||
dirent.h \
|
||||
errno.h \
|
||||
err.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
ndbm.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
netinet/in6.h \
|
||||
netinet/in_systm.h \
|
||||
netinet6/in6.h \
|
||||
paths.h \
|
||||
pwd.h \
|
||||
resolv.h \
|
||||
rpcsvc/dbm.h \
|
||||
rpcsvc/ypclnt.h \
|
||||
shadow.h \
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/proc.h \
|
||||
sys/resource.h \
|
||||
sys/socket.h \
|
||||
sys/stat.h \
|
||||
sys/sysctl.h \
|
||||
sys/time.h \
|
||||
sys/tty.h \
|
||||
sys/types.h \
|
||||
sys/uio.h \
|
||||
sys/utsname.h \
|
||||
sys/wait.h \
|
||||
syslog.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
userconf.h \
|
||||
usersec.h \
|
||||
winsock.h \
|
||||
])
|
||||
|
||||
AC_REQUIRE([CHECK_NETINET_IP_AND_TCP])
|
||||
|
||||
AM_CONDITIONAL(have_err_h, test "$ac_cv_header_err_h" = yes)
|
||||
AM_CONDITIONAL(have_fnmatch_h, test "$ac_cv_header_fnmatch_h" = yes)
|
||||
|
||||
dnl Check for functions and libraries
|
||||
|
||||
AC_KRB_IPV6
|
||||
|
||||
AC_FIND_FUNC(socket, socket)
|
||||
AC_FIND_FUNC(gethostbyname, nsl)
|
||||
AC_FIND_FUNC(syslog, syslog)
|
||||
AC_FIND_FUNC(gethostbyname2, inet6 ip6)
|
||||
|
||||
AC_FIND_FUNC(res_search, resolv,
|
||||
[
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_RESOLV_H
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
],
|
||||
[0,0,0,0,0])
|
||||
|
||||
AC_FIND_FUNC(dn_expand, resolv,
|
||||
[
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_RESOLV_H
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
],
|
||||
[0,0,0,0,0])
|
||||
|
||||
AC_BROKEN_SNPRINTF
|
||||
AC_BROKEN_VSNPRINTF
|
||||
|
||||
AC_BROKEN_GLOB
|
||||
if test "$ac_cv_func_glob_working" != yes; then
|
||||
LIBOBJS="$LIBOBJS glob.o"
|
||||
fi
|
||||
AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
|
||||
|
||||
|
||||
AC_CHECK_FUNCS([ \
|
||||
asnprintf \
|
||||
asprintf \
|
||||
cgetent \
|
||||
getconfattr \
|
||||
getrlimit \
|
||||
getspnam \
|
||||
sysconf \
|
||||
sysctl \
|
||||
uname \
|
||||
vasnprintf \
|
||||
vasprintf \
|
||||
])
|
||||
|
||||
if test "$ac_cv_func_cgetent" = no; then
|
||||
LIBOBJS="$LIBOBJS getcap.o"
|
||||
fi
|
||||
|
||||
AC_REQUIRE([AC_FUNC_GETLOGIN])
|
||||
|
||||
AC_FIND_FUNC_NO_LIBS(getsockopt,,
|
||||
[#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif],
|
||||
[0,0,0,0,0])
|
||||
AC_FIND_FUNC_NO_LIBS(setsockopt,,
|
||||
[#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif],
|
||||
[0,0,0,0,0])
|
||||
|
||||
AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
|
||||
[#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif],
|
||||
17)
|
||||
if test "$ac_cv_func_hstrerror" = yes; then
|
||||
AC_NEED_PROTO([
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif],
|
||||
hstrerror)
|
||||
fi
|
||||
|
||||
dnl sigh, wish this could be done in a loop
|
||||
if test "$ac_cv_func_asprintf" = yes; then
|
||||
AC_NEED_PROTO([
|
||||
#include <stdio.h>
|
||||
#include <string.h>],
|
||||
asprintf)dnl
|
||||
fi
|
||||
if test "$ac_cv_func_vasprintf" = yes; then
|
||||
AC_NEED_PROTO([
|
||||
#include <stdio.h>
|
||||
#include <string.h>],
|
||||
vasprintf)dnl
|
||||
fi
|
||||
if test "$ac_cv_func_asnprintf" = yes; then
|
||||
AC_NEED_PROTO([
|
||||
#include <stdio.h>
|
||||
#include <string.h>],
|
||||
asnprintf)dnl
|
||||
fi
|
||||
if test "$ac_cv_func_vasnprintf" = yes; then
|
||||
AC_NEED_PROTO([
|
||||
#include <stdio.h>
|
||||
#include <string.h>],
|
||||
vasnprintf)dnl
|
||||
fi
|
||||
|
||||
AC_BROKEN([ \
|
||||
chown \
|
||||
copyhostent \
|
||||
daemon \
|
||||
err \
|
||||
errx \
|
||||
fchown \
|
||||
flock \
|
||||
fnmatch \
|
||||
freeaddrinfo \
|
||||
freehostent \
|
||||
gai_strerror \
|
||||
getaddrinfo \
|
||||
getcwd \
|
||||
getdtablesize \
|
||||
getegid \
|
||||
geteuid \
|
||||
getgid \
|
||||
gethostname \
|
||||
getipnodebyaddr \
|
||||
getipnodebyname \
|
||||
getnameinfo \
|
||||
getopt \
|
||||
gettimeofday \
|
||||
getuid \
|
||||
getusershell \
|
||||
inet_aton \
|
||||
inet_ntop \
|
||||
inet_pton \
|
||||
initgroups \
|
||||
innetgr \
|
||||
iruserok \
|
||||
lstat \
|
||||
memmove \
|
||||
mkstemp \
|
||||
putenv \
|
||||
rcmd \
|
||||
readv \
|
||||
recvmsg \
|
||||
sendmsg \
|
||||
setegid \
|
||||
setenv \
|
||||
seteuid \
|
||||
strcasecmp \
|
||||
strdup \
|
||||
strerror \
|
||||
strftime \
|
||||
strlcat \
|
||||
strlcpy \
|
||||
strlwr \
|
||||
strncasecmp \
|
||||
strndup \
|
||||
strnlen \
|
||||
strptime \
|
||||
strsep \
|
||||
strsep_copy \
|
||||
strtok_r \
|
||||
strupr \
|
||||
swab \
|
||||
unsetenv \
|
||||
verr \
|
||||
verrx \
|
||||
vsyslog \
|
||||
vwarn \
|
||||
vwarnx \
|
||||
warn \
|
||||
warnx \
|
||||
writev \
|
||||
])
|
||||
|
||||
AC_NEED_PROTO([#include <stdlib.h>], setenv)
|
||||
AC_NEED_PROTO([#include <stdlib.h>], unsetenv)
|
||||
AC_NEED_PROTO([#include <unistd.h>], gethostname)
|
||||
AC_NEED_PROTO([#include <unistd.h>], mkstemp)
|
||||
AC_NEED_PROTO([#include <unistd.h>], getusershell)
|
||||
|
||||
AC_NEED_PROTO([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif],
|
||||
inet_aton)
|
||||
|
||||
AC_FIND_FUNC_NO_LIBS(crypt, crypt)dnl
|
||||
|
||||
AC_REQUIRE([rk_BROKEN_REALLOC])dnl
|
||||
|
||||
dnl AC_KRB_FUNC_GETCWD_BROKEN
|
||||
|
||||
dnl
|
||||
dnl Checks for prototypes and declarations
|
||||
dnl
|
||||
|
||||
AC_PROTO_COMPAT([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
],
|
||||
gethostbyname, struct hostent *gethostbyname(const char *))
|
||||
|
||||
AC_PROTO_COMPAT([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
],
|
||||
gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
|
||||
|
||||
AC_PROTO_COMPAT([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
],
|
||||
getservbyname, struct servent *getservbyname(const char *, const char *))
|
||||
|
||||
AC_PROTO_COMPAT([
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
],
|
||||
openlog, void openlog(const char *, int, int))
|
||||
|
||||
AC_NEED_PROTO([
|
||||
#ifdef HAVE_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
],
|
||||
crypt)
|
||||
|
||||
AC_NEED_PROTO([
|
||||
#include <string.h>
|
||||
],
|
||||
strtok_r)
|
||||
|
||||
AC_NEED_PROTO([
|
||||
#include <string.h>
|
||||
],
|
||||
strsep)
|
||||
|
||||
dnl variables
|
||||
|
||||
rk_CHECK_VAR(h_errno,
|
||||
[#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif])
|
||||
|
||||
rk_CHECK_VAR(h_errlist,
|
||||
[#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif])
|
||||
|
||||
rk_CHECK_VAR(h_nerr,
|
||||
[#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif])
|
||||
|
||||
rk_CHECK_VAR([__progname],
|
||||
[#ifdef HAVE_ERR_H
|
||||
#include <err.h>
|
||||
#endif])
|
||||
|
||||
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif], optarg)
|
||||
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif], optind)
|
||||
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif], opterr)
|
||||
AC_CHECK_DECLARATION([#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif], optopt)
|
||||
|
||||
AC_CHECK_DECLARATION([#include <stdlib.h>], environ)
|
||||
|
||||
dnl
|
||||
dnl Check for fields in struct tm
|
||||
dnl
|
||||
|
||||
AC_HAVE_STRUCT_FIELD(struct tm, tm_gmtoff, [#include <time.h>])
|
||||
AC_HAVE_STRUCT_FIELD(struct tm, tm_zone, [#include <time.h>])
|
||||
|
||||
dnl
|
||||
dnl or do we have a variable `timezone' ?
|
||||
dnl
|
||||
|
||||
rk_CHECK_VAR(timezone,[#include <time.h>])
|
||||
|
||||
AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
|
||||
AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
|
||||
AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
|
||||
AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
|
||||
AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
|
||||
|
||||
dnl
|
||||
dnl Check for struct winsize
|
||||
dnl
|
||||
|
||||
AC_KRB_STRUCT_WINSIZE
|
||||
|
||||
dnl
|
||||
dnl Check for struct spwd
|
||||
dnl
|
||||
|
||||
AC_KRB_STRUCT_SPWD
|
||||
|
||||
dnl
|
||||
dnl Check for sa_len in struct sockaddr
|
||||
dnl
|
||||
|
||||
AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
|
||||
#include <sys/socket.h>])
|
||||
|
||||
dnl AC_CONFIG_FILES($1/Makefile) dnl breaks automake
|
||||
|
||||
LIB_roken="${LIB_roken} \$(LIB_crypt) \$(LIB_dbopen)"
|
||||
|
||||
AC_SUBST(DIR_roken)dnl
|
||||
AC_SUBST(LIB_roken)dnl
|
||||
AC_SUBST(CPPFLAGS_roken)dnl
|
||||
])
|
Reference in New Issue
Block a user