diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-13 12:35:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:23:01 -0500 |
commit | 833842f0aae4f61dd2f72c4f86526c3716dba79b (patch) | |
tree | d8fae8ac03b4b24e6105060d0081ebffee6b4f7b | |
parent | 3c079cd58dbbd1dbc4053d4990d1e74e862c2f80 (diff) | |
download | samba-833842f0aae4f61dd2f72c4f86526c3716dba79b.tar.gz samba-833842f0aae4f61dd2f72c4f86526c3716dba79b.tar.bz2 samba-833842f0aae4f61dd2f72c4f86526c3716dba79b.zip |
r8424: bring in some more of heimdals m4 macros, and remove the hard-coding of several test
results
(This used to be commit b173c938b2ced061ee341831e96001455fbf83d1)
-rw-r--r-- | source4/heimdal_build/config.h | 8 | ||||
-rw-r--r-- | source4/heimdal_build/config.m4 | 62 |
2 files changed, 62 insertions, 8 deletions
diff --git a/source4/heimdal_build/config.h b/source4/heimdal_build/config.h index 541729f7ad..02b3705ba1 100644 --- a/source4/heimdal_build/config.h +++ b/source4/heimdal_build/config.h @@ -36,15 +36,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } /* these should be done with configure tests */ #define KRB5 -#define HAVE_INET_ATON #define HAVE_LONG_LONG -#define HAVE_GETHOSTNAME -#define HAVE_SOCKLEN_T -#define HAVE_GETNAMEINFO -#define HAVE_STRUCT_WINSIZE -#define HAVE_STRUCT_SOCKADDR_STORAGE -#define HAVE_STRUCT_ADDRINFO -#define HAVE_GAI_STRERROR #include <sys/types.h> #include <stdarg.h> diff --git a/source4/heimdal_build/config.m4 b/source4/heimdal_build/config.m4 index 5e70e0b76e..4e521e4cfd 100644 --- a/source4/heimdal_build/config.m4 +++ b/source4/heimdal_build/config.m4 @@ -61,6 +61,10 @@ AC_CHECK_FUNCS([ \ atexit \ cgetent \ inet_ntop \ + inet_aton \ + gethostname \ + getnameinfo \ + gai_strerror \ iruserok \ putenv \ rcmd \ @@ -93,6 +97,64 @@ love_FIND_FUNC(bswap32, [#ifdef HAVE_SYS_BSWAP_H #endif], 0) +dnl AC_HAVE_TYPE(TYPE,INCLUDES) +AC_DEFUN([AC_HAVE_TYPE], [ +AC_REQUIRE([AC_HEADER_STDC]) +cv=`echo "$1" | sed 'y%./+- %__p__%'` +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL([ac_cv_type_$cv], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +$2]], +[[$1 foo;]])], +[eval "ac_cv_type_$cv=yes"], +[eval "ac_cv_type_$cv=no"]))dnl +ac_foo=`eval echo \\$ac_cv_type_$cv` +AC_MSG_RESULT($ac_foo) +if test "$ac_foo" = yes; then + ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'` +if false; then + AC_CHECK_TYPES($1) +fi + AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1']) +fi +]) + +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>]) +AC_HAVE_TYPE([struct ifaddrs], [#include <ifaddrs.h>]) + + +AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [ +AC_MSG_CHECKING(for struct winsize) +AC_CACHE_VAL(ac_cv_struct_winsize, [ +ac_cv_struct_winsize=no +for i in sys/termios.h sys/ioctl.h; do +AC_EGREP_HEADER( +struct[[ ]]*winsize,dnl +$i, ac_cv_struct_winsize=yes; break)dnl +done +]) +if test "$ac_cv_struct_winsize" = "yes"; then + AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h]) +fi +AC_MSG_RESULT($ac_cv_struct_winsize) +AC_EGREP_HEADER(ws_xpixel, termios.h, + AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel])) +AC_EGREP_HEADER(ws_ypixel, termios.h, + AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel])) +]) + +AC_KRB_STRUCT_WINSIZE + + AC_CHECK_DECL(h_errno, [AC_DEFINE(HAVE_DECL_H_ERRNO,1,whether h_errno is declared)], [], [ #ifdef HAVE_SYS_TYPES_H |