📄 configure.in
字号:
[AC_TRY_RUN([main(){ exit(0); (void) XOpenDisplay("foobar");}], rxvt_cv_R=yes, rxvt_cv_R=no, rxvt_cv_R=no)]) if test x$rxvt_cv_R != xyes; then LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" fifiAC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer,[AC_TRY_COMPILE([#include <X11/Xlib.h>], [XPointer dummy;],rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)])if test x$rxvt_cv_xpointer = xyes; then AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef)fiLIBS=$ac_save_LIBSCFLAGS=$ac_save_CFLAGSAC_C_CONSTAC_C_INLINEdnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow.dnl# --------------------------------------------------------------------------dnl# CHECKING FOR MISSING TYPEDEFSdnl# --------------------------------------------------------------------------dnl# Missing typedefs and replacementsAC_TYPE_MODE_Tdnl> AC_CHECK_TYPE(umode_t, int)dnl> AC_CHECK_TYPE(off_t, long)AC_TYPE_PID_TAC_TYPE_UID_TAC_CHECK_SIZEOF(char, 1)AC_CHECK_SIZEOF(short, 2)AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(long, 4)AC_CHECK_SIZEOF(long long, 8)AC_CHECK_SIZEOF(int *, 4)dnl# see usage belowAC_DEFUN(RXVT_CHECK_SIZE, [AC_CACHE_CHECK([for $2], $1, [AC_TRY_COMPILE([#include <sys/types.h>], $2 dummy;, [$1=yes], [dnlif test $ac_cv_sizeof_char -ge $3; then $1="$4 char"else if test $ac_cv_sizeof_short -ge $3; then $1="$4 short" else if test $ac_cv_sizeof_int -ge $3; then $1="$4 int" else if test $ac_cv_sizeof_long -ge $3; then $1="$4 long" else if test $ac_cv_sizeof_long_long -ge $3; then $1="$4 long long" else $1="$4 $5" # we _must_ have a (possibly wrong) default fi fi fi fifi])])]if test x"$$1" != xyes; then $6="typedef $$1 $2;"else if test x"$4" = x; then $6="/* typedef $5 $2; */" else $6="/* typedef $4 $5 $2; */" fifi dnl)dnl#dnl# Look for types the system may know about anyway.dnl#RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , short, rxvt_int16_typedef)AC_SUBST(rxvt_int16_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int16_t, u_int16_t, 2, unsigned, short, rxvt_u_int16_typedef)AC_SUBST(rxvt_u_int16_typedef)RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , int, rxvt_int32_typedef)AC_SUBST(rxvt_int32_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int32_t, u_int32_t, 4, unsigned, int, rxvt_u_int32_typedef)AC_SUBST(rxvt_u_int32_typedef)RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , long long, rxvt_int64_typedef)AC_SUBST(rxvt_int64_typedef)RXVT_CHECK_SIZE(rxvt_cv_u_int64_t, u_int64_t, 8, unsigned, long long, rxvt_u_int64_typedef)AC_SUBST(rxvt_u_int64_typedef)dnl#dnl# Now look for another we usednl#if test $ac_cv_sizeof_int_p -eq 8; then rxvt_intp_define="#define intp_t int64_t" rxvt_u_intp_define="#define u_intp_t u_int64_t"else if test $ac_cv_sizeof_int_p -eq 4; then rxvt_intp_define="#define intp_t int32_t" rxvt_u_intp_define="#define u_intp_t u_int32_t" else if test $ac_cv_sizeof_int_p -eq 2; then rxvt_intp_define="#define intp_t int16_t" rxvt_u_intp_define="#define u_intp_t u_int16_t" else rxvt_intp_define="#error set intp_t" rxvt_u_intp_define="#error set u_intp_t" fi fifiAC_SUBST(rxvt_intp_define)AC_SUBST(rxvt_u_intp_define)dnl# --------------------------------------------------------------------------dnl# CHECKING FOR LIBRARY FUNCTIONSdnl# --------------------------------------------------------------------------AC_TYPE_SIGNALdnl> AC_FUNC_VPRINTFdnl# Note: On Ultrix, setsid() does weirdo stuff, disable itcase "$host_alias" in *ultrix) ac_cv_func_setsid='no' ;; *) break;;esacAC_CHECK_FUNCS( \ atexit \ revoke \ unsetenv \ setutent \ seteuid \ setreuid \ setsid \ setpgrp \ setpgid \ openpty \ _getpty \ grantpt \ unlockpt \ isastream \ on_exit \ nanosleep \ updwtmp \ ttyslot \)dnl# Note: On NetBSD, openpty() exists in libutil. Don't pull it indnl# --------------------------------------------------------------------------dnl# DO ALL UTMP AND WTMP CHECKINGdnl# --------------------------------------------------------------------------dnl# check for host field in utmp structurednl# --------------------------------------------AC_CHECK_HEADER(utmp.h,[AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmp.h>],[struct utmp ut;],rxvt_cv_struct_utmp=yes, rxvt_cv_struct_utmp=no)])if test x$rxvt_cv_struct_utmp = xyes; then AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)fi]AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmp.h>],[struct utmp ut; ut.ut_host;],rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)])if test x$rxvt_cv_struct_utmp_host = xyes; then AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)fiAC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmp.h>],[struct utmp ut; ut.ut_pid;],rxvt_cv_struct_utmp_pid=yes, rxvt_cv_struct_utmp_pid=no)])if test x$rxvt_cv_struct_utmp_pid = xyes; then AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)fi) dnl# AC_CHECK_HEADER(utmp.hdnl# --------------------------------------------AC_CHECK_HEADER(utmpx.h,[AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmpx.h>],[struct utmpx ut;],rxvt_cv_struct_utmpx=yes, rxvt_cv_struct_utmpx=no)])if test x$rxvt_cv_struct_utmpx = xyes; then AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)fi]AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmpx.h>],[struct utmpx utx; utx.ut_host;],rxvt_cv_struct_utmpx_host=yes, rxvt_cv_struct_utmpx_host=no)])if test x$rxvt_cv_struct_utmpx_host = xyes; then AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)fi) dnl# AC_CHECK_HEADER(utmpx.hdnl# --------------------------------------------------------------------------dnl# check for struct lastlogAC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmp.h>#ifdef HAVE_LASTLOG_H#include <lastlog.h>#endif],[struct lastlog ll;],rxvt_cv_struct_lastlog=yes, rxvt_cv_struct_lastlog=no)])if test x$rxvt_cv_struct_lastlog = xyes; then AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)fidnl# check for struct lastlogxAC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx,[AC_TRY_COMPILE([#include <sys/types.h>#include <utmpx.h>#ifdef HAVE_LASTLOG_H#include <lastlog.h>#endif],[struct lastlogx ll;],rxvt_cv_struct_lastlogx=yes, rxvt_cv_struct_lastlogx=no)])if test x$rxvt_cv_struct_lastlogx = xyes; then AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)fidnl# --------------------------------------------------------------------------dnl# FIND FILESdnl# --------------------------------------------------------------------------dnl# find utmpAC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp,[AC_TRY_RUN([#include <stdio.h>#include <sys/types.h>#include <utmp.h>#include <errno.h>main(){ char **u, *utmplist[] = { "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1);#ifdef UTMP_FILE fprintf(f, "%s\n", UTMP_FILE); exit(0);#endif#ifdef _PATH_UTMP fprintf(f, "%s\n", _PATH_UTMP); exit(0);#endif for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *u); exit(0); } } exit(0);}], rxvt_cv_path_utmp=`cat conftestval`, rxvt_cv_path_utmp=, dnl AC_MSG_WARN([Define RXVT_UTMP_FILE in config.h manually]))])if test x$rxvt_cv_path_utmp != x; then AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp)fidnl# --------------------------------------------------------------------------dnl# find utmpx - if a utmp file exists at the same location and is more thandnl# a day newer, then dump the utmpx. People leave lots of junk around.AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx,[AC_TRY_RUN([#include <stdio.h>#include <sys/types.h>#include <utmpx.h>#include <errno.h>#include <sys/stat.h>#ifdef HAVE_STRING_H#include <string.h>#endifmain(){ char **u, *p, *utmplist[] = {#ifdef UTMPX_FILE UTMPX_FILE,#endif#ifdef _PATH_UTMPX _PATH_UTMPX,#endif "/var/adm/utmpx", "/etc/utmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); struct stat statu, statux; if (!f) exit(1); for (u = utmplist; *u; u++) { if ((a = fopen(*u, "r")) != NULL || errno == EACCES) { if (stat(*u, &statux) < 0) continue; p = strdup(*u); p[strlen(p) - 1] = '\0'; if (stat(p, &statu) >= 0 && (statu.st_mtime - statux.st_mtime > 86400)) continue; fprintf(f, "%s\n", *u); exit(0); } } exit(0);}], rxvt_cv_path_utmpx=`cat conftestval`, rxvt_cv_path_utmpx=, dnl AC_MSG_WARN([Define RXVT_UTMPX_FILE in config.h manually]))])if test x$rxvt_cv_path_utmpx != x; then AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx)fidnl# --------------------------------------------------------------------------dnl# find wtmpAC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp,[AC_TRY_RUN([#include <stdio.h>#include <sys/types.h>#ifdef HAVE_UTMP_H#include <utmp.h>#endif#include <errno.h>main(){ char **w, *wtmplist[] = { "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1);#ifdef WTMP_FILE fprintf(f, "%s\n", WTMP_FILE); exit(0);#endif#ifdef _PATH_WTMP fprintf(f, "%s\n", _PATH_WTMP); exit(0);#endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0);}], rxvt_cv_path_wtmp=`cat conftestval`, rxvt_cv_path_wtmp=, dnl AC_MSG_WARN([Define RXVT_WTMP_FILE in config.h manually]))])if test x$rxvt_cv_path_wtmp != x; then AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp)fidnl# --------------------------------------------------------------------------dnl# find wtmpxAC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx,[AC_TRY_RUN([#include <stdio.h>#ifdef HAVE_UTMPX_H#include <utmpx.h>#endif#include <errno.h>main(){ char **w, *wtmplist[] = { "/var/log/wtmpx", "/var/adm/wtmpx", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1);#ifdef WTMPX_FILE fprintf(f, "%s\n", WTMPX_FILE); exit(0);#endif#ifdef _PATH_WTMPX fprintf(f, "%s\n", _PATH_WTMPX); exit(0);#endif for (w = wtmplist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0);}], rxvt_cv_path_wtmpx=`cat conftestval`, rxvt_cv_path_wtmpx=, dnl AC_MSG_WARN([Define RXVT_WTMPX_FILE in config.h manually]))])if test x$rxvt_cv_path_wtmpx != x; then AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx)fidnl# --------------------------------------------------------------------------dnl# find lastlogAC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog,[AC_TRY_RUN([#include <stdio.h>#include <sys/types.h>#ifdef HAVE_UTMPX_H#include <utmpx.h>#elif defined(HAVE_UTMP_H)#include <utmp.h>#endif#ifdef HAVE_LASTLOG_H#include <lastlog.h>#endif#include <errno.h>main(){ char **w, *lastloglist[] = { "/var/log/lastlog", NULL }; FILE *a, *f=fopen("conftestval", "w"); if (!f) exit(1);#ifdef LASTLOG_FILE fprintf(f, "%s\n", LASTLOG_FILE); exit(0);#endif#ifdef _PATH_LASTLOG fprintf(f, "%s\n", _PATH_LASTLOG); exit(0);#endif for (w = lastloglist; *w; w++) { if ((a = fopen(*w, "r")) != NULL || errno == EACCES) { fprintf(f, "%s\n", *w); exit(0); } } exit(0);}], rxvt_cv_path_lastlog=`cat conftestval`, rxvt_cv_path_lastlog=, dnl AC_MSG_WARN([Define RXVT_LASTLOG_FILE in config.h manually]))])if test x$rxvt_cv_path_lastlog != x; then AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog) if test -d "$rxvt_cv_path_lastlog"; then AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory) fifidnl# --------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -