From 2dd23fa4a784abdf9121cf00824ca9cb0cb1b138 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 22 Jan 2002 08:33:12 +0000 Subject: [PATCH] * acinclude.m4: New file. * configure.in: Use macros coming from acinclude.m4. --- acinclude.m4 | 367 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 23 +--- 2 files changed, 370 insertions(+), 20 deletions(-) create mode 100644 acinclude.m4 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..3481856 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,367 @@ +dnl @(#) $Header: /opt/backups/cvs.m17n.org/root/starttls/Attic/acinclude.m4,v 1.2 2002-01-22 08:33:12 ueno Exp $ (LBL) +dnl +dnl Copyright (c) 1995, 1996, 1997, 1998 +dnl The Regents of the University of California. All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that: (1) source code distributions +dnl retain the above copyright notice and this paragraph in its entirety, (2) +dnl distributions including binary code include the above copyright notice and +dnl this paragraph in its entirety in the documentation or other materials +dnl provided with the distribution, and (3) all advertising materials mentioning +dnl features or use of this software display the following acknowledgement: +dnl ``This product includes software developed by the University of California, +dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +dnl the University nor the names of its contributors may be used to endorse +dnl or promote products derived from this software without specific prior +dnl written permission. +dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +dnl +dnl LBL autoconf macros +dnl + +dnl Copyright (c) 1999 WIDE Project. All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions +dnl are met: +dnl 1. Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl 2. Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl 3. Neither the name of the project nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND +dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +dnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE +dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +dnl SUCH DAMAGE. + +dnl +dnl Checks to see if AF_INET6 is defined +AC_DEFUN(AC_CHECK_AF_INET6, [ + AC_MSG_CHECKING(for AF_INET6) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include ], + [int a = AF_INET6], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes ; then + AC_DEFINE(HAVE_AF_INET6) + fi +]) + +dnl +dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member +dnl borrowed from LBL libpcap +AC_DEFUN(AC_CHECK_SA_LEN, [ + AC_MSG_CHECKING(if sockaddr struct has sa_len member) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include ], + [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes ; then + AC_DEFINE(HAVE_SOCKADDR_SA_LEN) + fi +]) + +dnl +dnl Checks for portable prototype declaration macro +AC_DEFUN(AC_CHECK_PORTABLE_PROTO, [ + AC_MSG_CHECKING(for __P) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include ], + [int f __P(())], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_PORTABLE_PROTOTYPE) + fi +]) + +dnl checks for u_intXX_t +AC_DEFUN(AC_CHECK_BITTYPES, [ + $1=yes +dnl check for u_int8_t + AC_MSG_CHECKING(for u_int8_t) + AC_CACHE_VAL(ac_cv_u_int8_t, + AC_TRY_COMPILE([ +# include ], + [u_int8_t i], + ac_cv_u_int8_t=yes, + ac_cv_u_int8_t=no)) + AC_MSG_RESULT($ac_cv_u_int8_t) + if test $ac_cv_u_int8_t = yes; then + AC_DEFINE(HAVE_U_INT8_T) + else + $1=no + fi +dnl check for u_int16_t + AC_MSG_CHECKING(for u_int16_t) + AC_CACHE_VAL(ac_cv_u_int16_t, + AC_TRY_COMPILE([ +# include ], + [u_int16_t i], + ac_cv_u_int16_t=yes, + ac_cv_u_int16_t=no)) + AC_MSG_RESULT($ac_cv_u_int16_t) + if test $ac_cv_u_int16_t = yes; then + AC_DEFINE(HAVE_U_INT16_T) + else + $1=no + fi +dnl check for u_int32_t + AC_MSG_CHECKING(for u_int32_t) + AC_CACHE_VAL(ac_cv_u_int32_t, + AC_TRY_COMPILE([ +# include ], + [u_int32_t i], + ac_cv_u_int32_t=yes, + ac_cv_u_int32_t=no)) + AC_MSG_RESULT($ac_cv_u_int32_t) + if test $ac_cv_u_int32_t = yes; then + AC_DEFINE(HAVE_U_INT32_T) + else + $1=no + fi +]) + +dnl +dnl Checks for addrinfo structure +AC_DEFUN(AC_STRUCT_ADDRINFO, [ + AC_MSG_CHECKING(for addrinfo) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include ], + [struct addrinfo a], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_ADDRINFO) + else + AC_DEFINE(NEED_ADDRINFO_H) + fi +]) + +dnl +dnl Checks for NI_MAXSERV +AC_DEFUN(AC_NI_MAXSERV, [ + AC_MSG_CHECKING(for NI_MAXSERV) + AC_CACHE_VAL($1, + AC_EGREP_CPP(yes, [#include +#ifdef NI_MAXSERV +yes +#endif], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 != yes; then + AC_DEFINE(NEED_ADDRINFO_H) + fi +]) + +dnl +dnl Checks for NI_NAMEREQD +AC_DEFUN(AC_NI_NAMEREQD, [ + AC_MSG_CHECKING(for NI_NAMEREQD) + AC_CACHE_VAL($1, + AC_EGREP_CPP(yes, [#include +#ifdef NI_NOFQDN +yes +#endif], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 != yes; then + AC_DEFINE(NEED_ADDRINFO_H) + fi +]) + +dnl +dnl Checks for sockaddr_storage structure +AC_DEFUN(AC_STRUCT_SA_STORAGE, [ + AC_MSG_CHECKING(for sockaddr_storage) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include ], + [struct sockaddr_storage s], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_SOCKADDR_STORAGE) + fi +]) + +dnl +dnl Checks for macro of IP address size +AC_DEFUN(AC_CHECK_ADDRSZ, [ + $1=yes +dnl check for INADDRSZ + AC_MSG_CHECKING(for INADDRSZ) + AC_CACHE_VAL(ac_cv_inaddrsz, + AC_TRY_COMPILE([ +# include ], + [int a = INADDRSZ], + ac_cv_inaddrsz=yes, + ac_cv_inaddrsz=no)) + AC_MSG_RESULT($ac_cv_inaddrsz) + if test $ac_cv_inaddrsz = yes; then + AC_DEFINE(HAVE_INADDRSZ) + else + $1=no + fi +dnl check for IN6ADDRSZ + AC_MSG_CHECKING(for IN6ADDRSZ) + AC_CACHE_VAL(ac_cv_in6addrsz, + AC_TRY_COMPILE([ +# include ], + [int a = IN6ADDRSZ], + ac_cv_in6addrsz=yes, + ac_cv_in6addrsz=no)) + AC_MSG_RESULT($ac_cv_in6addrsz) + if test $ac_cv_in6addrsz = yes; then + AC_DEFINE(HAVE_IN6ADDRSZ) + else + $1=no + fi +]) + +dnl +dnl check for RES_USE_INET6 +AC_DEFUN(AC_CHECK_RES_USE_INET6, [ + AC_MSG_CHECKING(for RES_USE_INET6) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include +# include ], + [int a = RES_USE_INET6], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_RES_USE_INET6) + fi +]) + +dnl +dnl check for AAAA +AC_DEFUN(AC_CHECK_AAAA, [ + AC_MSG_CHECKING(for AAAA) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include ], + [int a = T_AAAA], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_AAAA) + fi +]) + +dnl +dnl check for struct res_state_ext +AC_DEFUN(AC_STRUCT_RES_STATE_EXT, [ + AC_MSG_CHECKING(for res_state_ext) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include +# include +# include ], + [struct __res_state_ext e], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_RES_STATE_EXT) + fi +]) + +dnl +dnl check for struct res_state_ext +AC_DEFUN(AC_STRUCT_RES_STATE, [ + AC_MSG_CHECKING(for nsort in res_state) + AC_CACHE_VAL($1, + AC_TRY_COMPILE([ +# include +# include +# include +# include ], + [struct __res_state e; e.nsort = 0], + $1=yes, + $1=no)) + AC_MSG_RESULT($$1) + if test $$1 = yes; then + AC_DEFINE(HAVE_NEW_RES_STATE) + fi +]) + +dnl +dnl check for h_errno +AC_DEFUN(AC_VAR_H_ERRNO, [ + AC_MSG_CHECKING(for h_errno) + AC_CACHE_VAL(ac_cv_var_h_errno, + AC_TRY_COMPILE([ +# include +# include ], + [int foo = h_errno;], + ac_cv_var_h_errno=yes, + ac_cv_var_h_errno=no)) + AC_MSG_RESULT($ac_cv_var_h_errno) + if test "$ac_cv_var_h_errno" = "yes"; then + AC_DEFINE(HAVE_H_ERRNO) + fi +]) + +dnl +dnl Test for __attribute__ +dnl + +AC_DEFUN(AC_C___ATTRIBUTE__, [ +AC_MSG_CHECKING(for __attribute__) +AC_CACHE_VAL(ac_cv___attribute__, [ +AC_TRY_COMPILE([ +#include +], +[ +static void foo(void) __attribute__ ((noreturn)); + +static void +foo(void) +{ + exit(1); +} +], +ac_cv___attribute__=yes, +ac_cv___attribute__=no)]) +if test "$ac_cv___attribute__" = "yes"; then + AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) +fi +AC_MSG_RESULT($ac_cv___attribute__) +]) diff --git a/configure.in b/configure.in index 19fc59e..20c4b2d 100644 --- a/configure.in +++ b/configure.in @@ -17,32 +17,15 @@ AC_CHECK_TYPE(fd_set, int) AC_REPLACE_FUNCS(basename getaddrinfo) AC_CHECK_FUNC(poll) -AC_CACHE_CHECK([for struct addrinfo], ac_cv_struct_addrinfo, -[AC_TRY_COMPILE([#include -], [struct addrinfo a], -ac_cv_struct_addrinfo=yes, ac_cv_struct_addrinfo=no)]) +AC_STRUCT_ADDRINFO(ac_cv_struct_addrinfo) if test "$ac_cv_struct_addrinfo" = "yes"; then AC_DEFINE(HAVE_ADDRINFO) else AC_DEFINE(NEED_ADDRINFO_H) + AC_CHECK_BITTYPES(ac_cv_bittypes) + AC_STRUCT_SA_STORAGE(ac_cv_sa_storage) fi -AC_CACHE_CHECK([for NI_MAXSERV], ac_cv_ni_maxserv, -[AC_EGREP_CPP(yes, [#include -#ifdef NI_MAXSERV -yes -#endif -], ac_cv_ni_maxserv=yes, ac_cv_ni_maxserv=no)]) -test "$ac_cv_ni_maxserv" = "yes" || AC_DEFINE(NEED_ADDRINFO_H) - -AC_CACHE_CHECK([for NI_NOFQDN], ac_cv_ni_nofqdn, -[AC_EGREP_CPP(yes, [#include -#ifdef NI_NOFQDN -yes -#endif -], ac_cv_ni_nofqdn=yes, ac_cv_ni_nofqdn=no)]) -test "$ac_cv_ni_nofqdn" = "yes" || AC_DEFINE(NEED_ADDRINFO_H) - AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH]) if test -n "$with_openssl"; then -- 1.7.10.4