📄 configure.ac
字号:
AC_CHECK_SIZEOF(char, 1)AC_CHECK_SIZEOF(short int, 2)AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(long int, 4)AC_CHECK_SIZEOF(long long int, 8)# Sanity check long long for some platforms (AIX)if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then ac_cv_sizeof_long_long_int=0fi# More checks for data typesAC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ AC_TRY_COMPILE( [ #include <sys/types.h> ], [ u_int a; a = 1;], [ ac_cv_have_u_int="yes" ], [ ac_cv_have_u_int="no" ] )])if test "x$ac_cv_have_u_int" = "xyes" ; then AC_DEFINE(HAVE_U_INT) have_u_int=1fiAC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ AC_TRY_COMPILE( [ #include <sys/types.h> ], [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], [ ac_cv_have_intxx_t="yes" ], [ ac_cv_have_intxx_t="no" ] )])if test "x$ac_cv_have_intxx_t" = "xyes" ; then AC_DEFINE(HAVE_INTXX_T) have_intxx_t=1fiif (test -z "$have_intxx_t" && \ test "x$ac_cv_header_stdint_h" = "xyes")then AC_MSG_CHECKING([for intXX_t types in stdint.h]) AC_TRY_COMPILE( [ #include <stdint.h> ], [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], [ AC_DEFINE(HAVE_INTXX_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiAC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ AC_TRY_COMPILE( [ #include <sys/types.h> ], [ int64_t a; a = 1;], [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" ] )])if test "x$ac_cv_have_int64_t" = "xyes" ; then AC_DEFINE(HAVE_INT64_T) have_int64_t=1fi if test -z "$have_int64_t" ; then AC_MSG_CHECKING([for int64_t type in sys/socket.h]) AC_TRY_COMPILE( [ #include <sys/socket.h> ], [ int64_t a; a = 1], [ AC_DEFINE(HAVE_INT64_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiif test -z "$have_int64_t" ; then AC_MSG_CHECKING([for int64_t type in sys/bitypes.h]) AC_TRY_COMPILE( [ #include <sys/bitypes.h> ], [ int64_t a; a = 1], [ AC_DEFINE(HAVE_INT64_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiAC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ AC_TRY_COMPILE( [ #include <sys/types.h> ], [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], [ ac_cv_have_u_intxx_t="yes" ], [ ac_cv_have_u_intxx_t="no" ] )])if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then AC_DEFINE(HAVE_U_INTXX_T) have_u_intxx_t=1fiif test -z "$have_u_intxx_t" ; then AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h]) AC_TRY_COMPILE( [ #include <sys/socket.h> ], [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], [ AC_DEFINE(HAVE_U_INTXX_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiAC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ AC_TRY_COMPILE( [ #include <sys/types.h> ], [ u_int64_t a; a = 1;], [ ac_cv_have_u_int64_t="yes" ], [ ac_cv_have_u_int64_t="no" ] )])if test "x$ac_cv_have_u_int64_t" = "xyes" ; then AC_DEFINE(HAVE_U_INT64_T) have_u_int64_t=1fiif test -z "$have_u_int64_t" ; then AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h]) AC_TRY_COMPILE( [ #include <sys/bitypes.h> ], [ u_int64_t a; a = 1], [ AC_DEFINE(HAVE_U_INT64_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiif test -z "$have_u_intxx_t" ; then AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], [ ac_cv_have_uintxx_t="yes" ], [ ac_cv_have_uintxx_t="no" ] ) ]) if test "x$ac_cv_have_uintxx_t" = "xyes" ; then AC_DEFINE(HAVE_UINTXX_T) fifiif test -z "$have_uintxx_t" ; then AC_MSG_CHECKING([for uintXX_t types in stdint.h]) AC_TRY_COMPILE( [ #include <stdint.h> ], [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], [ AC_DEFINE(HAVE_UINTXX_T) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] )fiif (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ test "x$ac_cv_header_sys_bitypes_h" = "xyes")then AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) AC_TRY_COMPILE( [#include <sys/bitypes.h> ], [ int8_t a; int16_t b; int32_t c; u_int8_t e; u_int16_t f; u_int32_t g; a = b = c = e = f = g = 1; ], [ AC_DEFINE(HAVE_U_INTXX_T) AC_DEFINE(HAVE_INTXX_T) AC_MSG_RESULT(yes) ], [AC_MSG_RESULT(no)] ) fiAC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ u_char foo; foo = 125; ], [ ac_cv_have_u_char="yes" ], [ ac_cv_have_u_char="no" ] )])if test "x$ac_cv_have_u_char" = "xyes" ; then AC_DEFINE(HAVE_U_CHAR)fiTYPE_SOCKLEN_TAC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ size_t foo; foo = 1235; ], [ ac_cv_have_size_t="yes" ], [ ac_cv_have_size_t="no" ] )])if test "x$ac_cv_have_size_t" = "xyes" ; then AC_DEFINE(HAVE_SIZE_T)fiAC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ ssize_t foo; foo = 1235; ], [ ac_cv_have_ssize_t="yes" ], [ ac_cv_have_ssize_t="no" ] )])if test "x$ac_cv_have_ssize_t" = "xyes" ; then AC_DEFINE(HAVE_SSIZE_T)fiAC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [ AC_TRY_COMPILE( [#include <time.h> ], [ clock_t foo; foo = 1235; ], [ ac_cv_have_clock_t="yes" ], [ ac_cv_have_clock_t="no" ] )])if test "x$ac_cv_have_clock_t" = "xyes" ; then AC_DEFINE(HAVE_CLOCK_T)fiAC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h> ], [ sa_family_t foo; foo = 1235; ], [ ac_cv_have_sa_family_t="yes" ], [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h> ], [ sa_family_t foo; foo = 1235; ], [ ac_cv_have_sa_family_t="yes" ], [ ac_cv_have_sa_family_t="no" ] )] )])if test "x$ac_cv_have_sa_family_t" = "xyes" ; then AC_DEFINE(HAVE_SA_FAMILY_T)fiAC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ pid_t foo; foo = 1235; ], [ ac_cv_have_pid_t="yes" ], [ ac_cv_have_pid_t="no" ] )])if test "x$ac_cv_have_pid_t" = "xyes" ; then AC_DEFINE(HAVE_PID_T)fiAC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ AC_TRY_COMPILE( [#include <sys/types.h> ], [ mode_t foo; foo = 1235; ], [ ac_cv_have_mode_t="yes" ], [ ac_cv_have_mode_t="no" ] )])if test "x$ac_cv_have_mode_t" = "xyes" ; then AC_DEFINE(HAVE_MODE_T)fiAC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h> ], [ struct sockaddr_storage s; ], [ ac_cv_have_struct_sockaddr_storage="yes" ], [ ac_cv_have_struct_sockaddr_storage="no" ] )])if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)fiAC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <netinet/in.h> ], [ struct sockaddr_in6 s; s.sin6_family = 0; ], [ ac_cv_have_struct_sockaddr_in6="yes" ], [ ac_cv_have_struct_sockaddr_in6="no" ] )])if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)fiAC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <netinet/in.h> ], [ struct in6_addr s; s.s6_addr[0] = 0; ], [ ac_cv_have_struct_in6_addr="yes" ], [ ac_cv_have_struct_in6_addr="no" ] )])if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_IN6_ADDR)fiAC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h>#include <netdb.h> ], [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], [ ac_cv_have_struct_addrinfo="yes" ], [ ac_cv_have_struct_addrinfo="no" ] )])if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_ADDRINFO)fiAC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [ AC_TRY_COMPILE( [ #include <sys/time.h> ], [ struct timeval tv; tv.tv_sec = 1;], [ ac_cv_have_struct_timeval="yes" ], [ ac_cv_have_struct_timeval="no" ] )])if test "x$ac_cv_have_struct_timeval" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_TIMEVAL) have_struct_timeval=1fi# If we don't have int64_t then we can't compile sftp-server. So don't# even attempt to do it. if test "x$ac_cv_have_int64_t" = "xno" -a \ "x$ac_cv_sizeof_long_int" != "x8" -a \ "x$ac_cv_sizeof_long_long_int" = "x0" ; then NO_SFTP='#'elsednl test snprintf (broken on SCO w/gcc) AC_TRY_RUN( [#include <stdio.h>#include <string.h>#ifdef HAVE_SNPRINTFmain(){ char buf[50]; char expected_out[50]; int mazsize = 50 ;#if (SIZEOF_LONG_INT == 8) long int num = 0x7fffffffffffffff;#else long long num = 0x7fffffffffffffffll;#endif strcpy(expected_out, "9223372036854775807"); snprintf(buf, mazsize, "%lld", num); if(strcmp(buf, expected_out) != 0) exit(1); exit(0);}#elsemain() { exit(0); }#endif ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] )fiAC_SUBST(NO_SFTP)dnl Checks for structure membersOSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)AC_CHECK_MEMBERS([struct stat.st_blksize])AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], ac_cv_have_ss_family_in_struct_ss, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h> ], [ struct sockaddr_storage s; s.ss_family = 1; ], [ ac_cv_have_ss_family_in_struct_ss="yes" ], [ ac_cv_have_ss_family_in_struct_ss="no" ], )])if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then AC_DEFINE(HAVE_SS_FAMILY_IN_SS)fiAC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], ac_cv_have___ss_family_in_struct_ss, [ AC_TRY_COMPILE( [#include <sys/types.h>#include <sys/socket.h> ], [ struct sockaddr_storage s; s.__ss_family = 1; ], [ ac_cv_have___ss_family_in_struct_ss="yes" ], [ ac_cv_have___ss_family_in_struct_ss="no" ] )])if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then AC_DEFINE(HAVE___SS_FAMILY_IN_SS)fiAC_CACHE_CHECK([for pw_class field in struct passwd], ac_cv_have_pw_class_in_struct_passwd, [ AC_TRY_COMPILE( [#include <pwd.h> ], [ struct passwd p; p.pw_class = 0; ], [ ac_cv_have_pw_class_in_struct_passwd="yes" ], [ ac_cv_have_pw_class_in_struct_passwd="no" ] )])if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -