📄 aclocal.m4
字号:
ac_cv_lbl_unaligned_fail=yes else ./conftest >conftest.out if test ! -s conftest.out ; then ac_cv_lbl_unaligned_fail=yes else ac_cv_lbl_unaligned_fail=no fi fi rm -f conftest* core core.conftest ;; esac]) AC_MSG_RESULT($ac_cv_lbl_unaligned_fail) if test $ac_cv_lbl_unaligned_fail = yes ; then AC_DEFINE(LBL_ALIGN) fi])dnldnl If using gcc and the file .devel exists:dnl Compile with -g (if supported) and -Walldnl If using gcc 2, do extra prototype checkingdnl If an os prototype include exists, symlink os-proto.h to itdnldnl usage:dnldnl AC_LBL_DEVEL(copt)dnldnl results:dnldnl $1 (copt appended)dnl HAVE_OS_PROTO_H (defined)dnl os-proto.h (symlinked)dnlAC_DEFUN(AC_LBL_DEVEL, [rm -f os-proto.h if test "${LBL_CFLAGS+set}" = set; then $1="$$1 ${LBL_CFLAGS}" fi if test -f .devel ; then if test "$GCC" = yes ; then if test "${LBL_CFLAGS+set}" != set; then if test "$ac_cv_prog_cc_g" = yes ; then $1="-g $$1" fi $1="$$1 -Wall" if test $ac_cv_lbl_gcc_vers -gt 1 ; then $1="$$1 -Wmissing-prototypes -Wstrict-prototypes" fi fi else case "$target_os" in irix6*) V_CCOPT="$V_CCOPT -n32" ;; *) ;; esac fi os=`echo $target_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'` name="lbl/os-$os.h" if test -f $name ; then ln -s $name os-proto.h AC_DEFINE(HAVE_OS_PROTO_H) else AC_MSG_WARN(can't find $name) fi fi])dnldnl Improved version of AC_CHECK_LIBdnldnl Thanks to John Hawkinson (jhawk@mit.edu)dnldnl usage:dnldnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])dnldnl results:dnldnl LIBSdnldefine(AC_LBL_CHECK_LIB,[AC_MSG_CHECKING([for $2 in -l$1])dnl Use a cache variable name containing both the library and function name,dnl because the test really is for library $1 defining function $2, notdnl just for library $1. Separate tests with the same $1 and different $2'sdnl may have different results.ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,[ac_save_LIBS="$LIBS"LIBS="-l$1 $5 $LIBS"AC_TRY_LINK(dnlifelse([$2], [main], , dnl Avoid conflicting decl of main.[/* Override any gcc2 internal prototype to avoid an error. */]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplusextern "C"#endif])dnl[/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */char $2();]), [$2()], eval "ac_cv_lbl_lib_$ac_lib_var=yes", eval "ac_cv_lbl_lib_$ac_lib_var=no")LIBS="$ac_save_LIBS"])dnlif eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], ,[changequote(, )dnl ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-l$1 $LIBS"], [$3])else AC_MSG_RESULT(no)ifelse([$4], , , [$4])dnlfi])dnldnl AC_LBL_LIBRARY_NETdnldnl This test is for network applications that need socket() anddnl gethostbyname() -ish functions. Under Solaris, those applicationsdnl need to link with "-lsocket -lnsl". Under IRIX, they need to linkdnl with "-lnsl" but should *not* link with "-lsocket" becausednl libsocket.a breaks a number of things (for instance:dnl gethostbyname() under IRIX 5.2, and snoop sockets under mostdnl versions of IRIX).dnldnl Unfortunately, many application developers are not aware of this,dnl and mistakenly write tests that cause -lsocket to be used underdnl IRIX. It is also easy to write tests that cause -lnsl to be useddnl under operating systems where neither are necessary (or useful),dnl such as SunOS 4.1.4, which uses -lnsl for TLI.dnldnl This test exists so that every application developer does not testdnl this in a different, and subtly broken fashion.dnl It has been argued that this test should be broken up into twodnl seperate tests, one for the resolver libraries, and one for thednl libraries necessary for using Sockets API. Unfortunately, the twodnl are carefully intertwined and allowing the autoconf user to usednl them independantly potentially results in unfortunate orderingdnl dependancies -- as such, such component macros would have todnl carefully use indirection and be aware if the other components werednl executed. Since other autoconf macros do not go to this trouble,dnl and almost no applications use sockets without the resolver, thisdnl complexity has not been implemented.dnldnl The check for libresolv is in case you are attempting to linkdnl statically and happen to have a libresolv.a lying around (and nodnl libnsl.a).dnlAC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , # Some OSes (eg. Solaris) place it in libnsl: AC_LBL_CHECK_LIB(nsl, gethostbyname, , # Some strange OSes (SINIX) have it in libsocket: AC_LBL_CHECK_LIB(socket, gethostbyname, , # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: AC_LBL_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", AC_CHECK_LIB(resolv, gethostbyname), -lnsl)))) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_CHECK_LIB(str, putmsg) ])dnl Copyright (c) 1999 WIDE Project. All rights reserved.dnldnl Redistribution and use in source and binary forms, with or withoutdnl modification, are permitted provided that the following conditionsdnl are met:dnl 1. Redistributions of source code must retain the above copyrightdnl notice, this list of conditions and the following disclaimer.dnl 2. Redistributions in binary form must reproduce the above copyrightdnl notice, this list of conditions and the following disclaimer in thednl documentation and/or other materials provided with the distribution.dnl 3. Neither the name of the project nor the names of its contributorsdnl may be used to endorse or promote products derived from this softwarednl without specific prior written permission.dnl dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' ANDdnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEdnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEdnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLEdnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALdnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODSdnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTdnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAYdnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OFdnl SUCH DAMAGE.dnldnl Checks to see if AF_INET6 is definedAC_DEFUN(AC_CHECK_AF_INET6, [ AC_MSG_CHECKING(for AF_INET6) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <sys/socket.h>], [int a = AF_INET6], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes ; then AC_DEFINE(HAVE_AF_INET6) fi])dnldnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len memberdnl borrowed from LBL libpcapAC_DEFUN(AC_CHECK_SA_LEN, [ AC_MSG_CHECKING(if sockaddr struct has sa_len member) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <sys/socket.h>], [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])dnldnl Checks for portable prototype declaration macroAC_DEFUN(AC_CHECK_PORTABLE_PROTO, [ AC_MSG_CHECKING(for __P) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <unistd.h>], [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_tAC_DEFUN(AC_CHECK_BITTYPES, [ $1=yesdnl check for u_int8_t AC_MSG_CHECKING(for u_int8_t) AC_CACHE_VAL(ac_cv_u_int8_t, AC_TRY_COMPILE([# include <sys/types.h>], [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 fidnl check for u_int16_t AC_MSG_CHECKING(for u_int16_t) AC_CACHE_VAL(ac_cv_u_int16_t, AC_TRY_COMPILE([# include <sys/types.h>], [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 fidnl check for u_int32_t AC_MSG_CHECKING(for u_int32_t) AC_CACHE_VAL(ac_cv_u_int32_t, AC_TRY_COMPILE([# include <sys/types.h>], [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])dnldnl Checks for addrinfo structureAC_DEFUN(AC_STRUCT_ADDRINFO, [ AC_MSG_CHECKING(for addrinfo) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <netdb.h>], [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])dnldnl Checks for NI_MAXSERVAC_DEFUN(AC_NI_MAXSERV, [ AC_MSG_CHECKING(for NI_MAXSERV) AC_CACHE_VAL($1, AC_EGREP_CPP(yes, [#include <netdb.h>#ifdef NI_MAXSERVyes#endif], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 != yes; then AC_DEFINE(NEED_ADDRINFO_H) fi])dnldnl Checks for NI_NAMEREQDAC_DEFUN(AC_NI_NAMEREQD, [ AC_MSG_CHECKING(for NI_NAMEREQD) AC_CACHE_VAL($1, AC_EGREP_CPP(yes, [#include <netdb.h>#ifdef NI_NOFQDNyes#endif], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 != yes; then AC_DEFINE(NEED_ADDRINFO_H) fi])dnldnl Checks for sockaddr_storage structureAC_DEFUN(AC_STRUCT_SA_STORAGE, [ AC_MSG_CHECKING(for sockaddr_storage) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <sys/socket.h>], [struct sockaddr_storage s], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_SOCKADDR_STORAGE) fi])dnldnl Checks for macro of IP address sizeAC_DEFUN(AC_CHECK_ADDRSZ, [ $1=yesdnl check for INADDRSZ AC_MSG_CHECKING(for INADDRSZ) AC_CACHE_VAL(ac_cv_inaddrsz, AC_TRY_COMPILE([# include <arpa/nameser.h>], [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 fidnl check for IN6ADDRSZ AC_MSG_CHECKING(for IN6ADDRSZ) AC_CACHE_VAL(ac_cv_in6addrsz, AC_TRY_COMPILE([# include <arpa/nameser.h>], [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])dnldnl check for RES_USE_INET6AC_DEFUN(AC_CHECK_RES_USE_INET6, [ AC_MSG_CHECKING(for RES_USE_INET6) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <netinet/in.h># include <resolv.h>], [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])dnldnl check for AAAAAC_DEFUN(AC_CHECK_AAAA, [ AC_MSG_CHECKING(for AAAA) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <arpa/nameser.h>], [int a = T_AAAA], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_AAAA) fi])dnldnl check for struct res_state_extAC_DEFUN(AC_STRUCT_RES_STATE_EXT, [ AC_MSG_CHECKING(for res_state_ext) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <netinet/in.h># include <netinet6/in6.h># include <resolv.h>], [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])dnldnl check for struct res_state_extAC_DEFUN(AC_STRUCT_RES_STATE, [ AC_MSG_CHECKING(for nsort in res_state) AC_CACHE_VAL($1, AC_TRY_COMPILE([# include <sys/types.h># include <netinet/in.h># include <netinet6/in6.h># include <resolv.h>], [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])dnldnl check for h_errnoAC_DEFUN(AC_VAR_H_ERRNO, [ AC_MSG_CHECKING(for h_errno) AC_CACHE_VAL(ac_cv_var_h_errno, AC_TRY_COMPILE([# include <sys/types.h># include <netdb.h>], [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])dnldnl Test for __attribute__dnlAC_DEFUN(AC_C___ATTRIBUTE__, [AC_MSG_CHECKING(for __attribute__)AC_CACHE_VAL(ac_cv___attribute__, [AC_TRY_COMPILE([#include <stdlib.h>],[static void foo(void) __attribute__ ((noreturn));static voidfoo(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__])fiAC_MSG_RESULT($ac_cv___attribute__)])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -