Author: metze Date: 2007-10-18 08:34:19 +0000 (Thu, 18 Oct 2007) New Revision: 25695
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25695 Log: [libreplace] fix the standalone build of libreplace all configure results which are used in replace.h or any system/*.h should be in the in the libreplace *.m4 files! metze Modified: branches/SAMBA_4_0/source/heimdal_build/config.m4 branches/SAMBA_4_0/source/lib/replace/libreplace.m4 branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 Changeset: Modified: branches/SAMBA_4_0/source/heimdal_build/config.m4 =================================================================== --- branches/SAMBA_4_0/source/heimdal_build/config.m4 2007-10-18 05:47:11 UTC (rev 25694) +++ branches/SAMBA_4_0/source/heimdal_build/config.m4 2007-10-18 08:34:19 UTC (rev 25695) @@ -112,38 +112,6 @@ #include <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([[ -AC_INCLUDES_DEFAULT -$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([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_HAVE_TYPE([socklen_t],[#include <sys/socket.h>]) - - AC_DEFUN([AC_KRB_STRUCT_WINSIZE], [ AC_MSG_CHECKING(for struct winsize) AC_CACHE_VAL(ac_cv_struct_winsize, [ Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4 =================================================================== --- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2007-10-18 05:47:11 UTC (rev 25694) +++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2007-10-18 08:34:19 UTC (rev 25695) @@ -137,23 +137,20 @@ AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced]) fi -dnl test for struct addrinfo -AC_CACHE_CHECK([for struct addrinfo],samba_cv_HAVE_STRUCT_ADDRINFO,[ -AC_TRY_COMPILE([ +AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>]) +AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>]) +AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>]) +AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>]) +AC_HAVE_TYPE([struct sockaddr_storage], [ +#include <sys/socket.h> #include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif +#include <netinet/in.h> +]) +AC_HAVE_TYPE([struct sockaddr_in6], [ #include <sys/socket.h> -#include <netdb.h>], -[ -struct addrinfo ai; -], -samba_cv_HAVE_STRUCT_ADDRINFO=yes,samba_cv_HAVE_STRUCT_ADDRINFO=no)]) -if test x"$samba_cv_HAVE_STRUCT_ADDRINFO" = x"yes"; then - AC_DEFINE(HAVE_STRUCT_ADDRINFO,1,[Whether the system has struct addrinfo]) -fi +#include <sys/types.h> +#include <netinet/in.h> +]) dnl test for getaddrinfo/getnameinfo AC_CACHE_CHECK([for getaddrinfo],samba_cv_HAVE_GETADDRINFO,[ @@ -185,18 +182,6 @@ AC_DEFINE(HAVE_GAI_STRERROR,1,[Whether the system has gai_strerror]) fi - -dnl Provided by replace.c: -AC_TRY_COMPILE([ -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -#include <sys/socket.h>], -[socklen_t foo;],, -[AC_DEFINE(socklen_t, int,[Socket length type])]) - AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror) AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename) AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup) Modified: branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 =================================================================== --- branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 2007-10-18 05:47:11 UTC (rev 25694) +++ branches/SAMBA_4_0/source/lib/replace/libreplace_macros.m4 2007-10-18 08:34:19 UTC (rev 25695) @@ -314,4 +314,25 @@ ) ]) - +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([[ +AC_INCLUDES_DEFAULT +$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 +])