done
-UTMP_CHECK
+
+
+
+
+for ac_func in \
+ ttyslot \
+ updwtmp \
+ updwtmpx \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+for ac_header in \
+ utmp.h \
+ utmpx.h \
+ lastlog.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+if test "${ac_cv_header_utmp_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for utmp.h" >&5
+echo $ECHO_N "checking for utmp.h... $ECHO_C" >&6
+if test "${ac_cv_header_utmp_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_utmp_h" >&5
+echo "${ECHO_T}$ac_cv_header_utmp_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking utmp.h usability" >&5
+echo $ECHO_N "checking utmp.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <utmp.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking utmp.h presence" >&5
+echo $ECHO_N "checking utmp.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <utmp.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: utmp.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: utmp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: utmp.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: utmp.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: utmp.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: utmp.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: utmp.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: utmp.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: utmp.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmp.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: utmp.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for utmp.h" >&5
+echo $ECHO_N "checking for utmp.h... $ECHO_C" >&6
+if test "${ac_cv_header_utmp_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_utmp_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_utmp_h" >&5
+echo "${ECHO_T}$ac_cv_header_utmp_h" >&6
+
+fi
+if test $ac_cv_header_utmp_h = yes; then
+ echo "$as_me:$LINENO: checking for struct utmp" >&5
+echo $ECHO_N "checking for struct utmp... $ECHO_C" >&6
+if test "${struct_utmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmp.h>
+int
+main ()
+{
+struct utmp ut;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmp=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmp=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmp" >&5
+echo "${ECHO_T}$struct_utmp" >&6
+if test x$struct_utmp = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_UTMP 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for ut_host in utmp struct" >&5
+echo $ECHO_N "checking for ut_host in utmp struct... $ECHO_C" >&6
+if test "${struct_utmp_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmp.h>
+int
+main ()
+{
+struct utmp ut; ut.ut_host;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmp_host=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmp_host=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmp_host" >&5
+echo "${ECHO_T}$struct_utmp_host" >&6
+if test x$struct_utmp_host = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTMP_HOST 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for ut_pid in utmp struct" >&5
+echo $ECHO_N "checking for ut_pid in utmp struct... $ECHO_C" >&6
+if test "${struct_utmp_pid+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmp.h>
+int
+main ()
+{
+struct utmp ut; ut.ut_pid;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmp_pid=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmp_pid=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmp_pid" >&5
+echo "${ECHO_T}$struct_utmp_pid" >&6
+if test x$struct_utmp_pid = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTMP_PID 1
+_ACEOF
+
+fi
+
+fi
+
+
+
+if test "${ac_cv_header_utmpx_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for utmpx.h" >&5
+echo $ECHO_N "checking for utmpx.h... $ECHO_C" >&6
+if test "${ac_cv_header_utmpx_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_utmpx_h" >&5
+echo "${ECHO_T}$ac_cv_header_utmpx_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking utmpx.h usability" >&5
+echo $ECHO_N "checking utmpx.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <utmpx.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking utmpx.h presence" >&5
+echo $ECHO_N "checking utmpx.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <utmpx.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: utmpx.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: utmpx.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: utmpx.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: utmpx.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: utmpx.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: utmpx.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: utmpx.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: utmpx.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: utmpx.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for utmpx.h" >&5
+echo $ECHO_N "checking for utmpx.h... $ECHO_C" >&6
+if test "${ac_cv_header_utmpx_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_utmpx_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_utmpx_h" >&5
+echo "${ECHO_T}$ac_cv_header_utmpx_h" >&6
+
+fi
+if test $ac_cv_header_utmpx_h = yes; then
+ echo "$as_me:$LINENO: checking for struct utmpx" >&5
+echo $ECHO_N "checking for struct utmpx... $ECHO_C" >&6
+if test "${struct_utmpx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmpx.h>
+int
+main ()
+{
+struct utmpx ut;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmpx=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmpx=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmpx" >&5
+echo "${ECHO_T}$struct_utmpx" >&6
+if test x$struct_utmpx = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_UTMPX 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for host in utmpx struct" >&5
+echo $ECHO_N "checking for host in utmpx struct... $ECHO_C" >&6
+if test "${struct_utmpx_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmpx.h>
+int
+main ()
+{
+struct utmpx utx; utx.ut_host;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmpx_host=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmpx_host=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmpx_host" >&5
+echo "${ECHO_T}$struct_utmpx_host" >&6
+if test x$struct_utmpx_host = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTMPX_HOST 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for session in utmpx struct" >&5
+echo $ECHO_N "checking for session in utmpx struct... $ECHO_C" >&6
+if test "${struct_utmpx_session+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmpx.h>
+int
+main ()
+{
+struct utmpx utx; utx.ut_session;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_utmpx_session=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_utmpx_session=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_utmpx_session" >&5
+echo "${ECHO_T}$struct_utmpx_session" >&6
+if test x$struct_utmpx_session = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTMPX_SESSION 1
+_ACEOF
+
+fi
+
+fi
+
+
+echo "$as_me:$LINENO: checking for struct lastlog" >&5
+echo $ECHO_N "checking for struct lastlog... $ECHO_C" >&6
+if test "${struct_lastlog+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmp.h>
+#ifdef HAVE_LASTLOG_H
+#include <lastlog.h>
+#endif
+
+int
+main ()
+{
+struct lastlog ll;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_lastlog=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_lastlog=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_lastlog" >&5
+echo "${ECHO_T}$struct_lastlog" >&6
+if test x$struct_lastlog = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_LASTLOG 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for struct lastlogx" >&5
+echo $ECHO_N "checking for struct lastlogx... $ECHO_C" >&6
+if test "${struct_lastlogx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <utmpx.h>
+#ifdef HAVE_LASTLOG_H
+#include <lastlog.h>
+#endif
+
+int
+main ()
+{
+struct lastlogx ll;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ struct_lastlogx=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+struct_lastlogx=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $struct_lastlogx" >&5
+echo "${ECHO_T}$struct_lastlogx" >&6
+if test x$struct_lastlogx = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_LASTLOGX 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking where utmp is located" >&5
+echo $ECHO_N "checking where utmp is located... $ECHO_C" >&6
+if test "${path_utmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define UTMP_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define UTMP_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_utmp=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_utmp=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_utmp" >&5
+echo "${ECHO_T}$path_utmp" >&6
+if test x$path_utmp != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define UTMP_FILE "$path_utmp"
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking where utmpx is located" >&5
+echo $ECHO_N "checking where utmpx is located... $ECHO_C" >&6
+if test "${path_utmpx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define UTMPX_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define UTMPX_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#include <sys/types.h>
+#include <utmpx.h>
+#include <errno.h>
+#include <sys/stat.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+main()
+{
+ 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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_utmpx=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_utmpx=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_utmpx" >&5
+echo "${ECHO_T}$path_utmpx" >&6
+if test x$path_utmpx != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define UTMPX_FILE "$path_utmpx"
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking where wtmp is located" >&5
+echo $ECHO_N "checking where wtmp is located... $ECHO_C" >&6
+if test "${path_wtmp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define WTMP_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define WTMP_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_wtmp=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_wtmp=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_wtmp" >&5
+echo "${ECHO_T}$path_wtmp" >&6
+if test x$path_wtmp != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define WTMP_FILE "$path_wtmp"
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking where wtmpx is located" >&5
+echo $ECHO_N "checking where wtmpx is located... $ECHO_C" >&6
+if test "${path_wtmpx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define WTMPX_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define WTMPX_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_wtmpx=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_wtmpx=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_wtmpx" >&5
+echo "${ECHO_T}$path_wtmpx" >&6
+if test x$path_wtmpx != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define WTMPX_FILE "$path_wtmpx"
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking where lastlog is located" >&5
+echo $ECHO_N "checking where lastlog is located... $ECHO_C" >&6
+if test "${path_lastlog+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define LASTLOG_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define LASTLOG_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_lastlog=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_lastlog=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_lastlog" >&5
+echo "${ECHO_T}$path_lastlog" >&6
+if test x$path_lastlog != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define LASTLOG_FILE "$path_lastlog"
+_ACEOF
+
+ if test -d "$path_lastlog"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LASTLOG_IS_DIR 1
+_ACEOF
+
+ fi
+fi
+
+echo "$as_me:$LINENO: checking where lastlogx is located" >&5
+echo $ECHO_N "checking where lastlogx is located... $ECHO_C" >&6
+if test "${path_lastlogx+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define LASTLOGX_FILE in config.h manually" >&5
+echo "$as_me: WARNING: Define LASTLOGX_FILE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif
+#include <errno.h>
+main()
+{
+ char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
+ FILE *a, *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+#ifdef LASTLOGX_FILE
+ fprintf(f, "%s\n", LASTLOGX_FILE);
+ exit(0);
+#endif
+#ifdef _PATH_LASTLOGX
+ fprintf(f, "%s\n", _PATH_LASTLOGX);
+ 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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ path_lastlogx=`cat conftestval`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+path_lastlogx=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $path_lastlogx" >&5
+echo "${ECHO_T}$path_lastlogx" >&6
+if test x$path_lastlogx != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define LASTLOGX_FILE "$path_lastlogx"
+_ACEOF
+
+fi
+
echo "$as_me:$LINENO: checking where ttys/ttytab is located" >&5
if test "${rxvt_cv_path_ttytab+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- for ttys_file in /etc/ttys /etc/ttytab;
-do
- if test -f "$ttys_file" ; then
- rxvt_cv_path_ttytab=$ttys_file
- break
- fi
-done
+ for ttys_file in /etc/ttys /etc/ttytab;
+do
+ if test -f "$ttys_file" ; then
+ rxvt_cv_path_ttytab=$ttys_file
+ break
+ fi
+done
+
+fi
+echo "$as_me:$LINENO: result: $rxvt_cv_path_ttytab" >&5
+echo "${ECHO_T}$rxvt_cv_path_ttytab" >&6
+if test x$rxvt_cv_path_ttytab != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define TTYTAB_FILENAME "$rxvt_cv_path_ttytab"
+_ACEOF
+
+fi
+
+
+ac_save_LIBS=$LIBS
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $X_CFLAGS"
+LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
+if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
+ LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
+fi
+echo "$as_me:$LINENO: checking for working Xlocale" >&5
+echo $ECHO_N "checking for working Xlocale... $ECHO_C" >&6
+if test "${rxvt_cv_func_xlocale+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "$as_me:$LINENO: WARNING: Define NO_XLOCALE in config.h manually" >&5
+echo "$as_me: WARNING: Define NO_XLOCALE in config.h manually" >&2;}
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+main() {
+char *p;
+if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
+exit (XSupportsLocale() ? 0 : 1);
+else
+exit (1);}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ rxvt_cv_func_xlocale=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+rxvt_cv_func_xlocale=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $rxvt_cv_func_xlocale" >&5
+echo "${ECHO_T}$rxvt_cv_func_xlocale" >&6
+if test x$rxvt_cv_func_xlocale = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XLOCALE 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for working X setlocale" >&5
+echo $ECHO_N "checking for working X setlocale... $ECHO_C" >&6
+if test "${rxvt_cv_func_xsetlocale+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define X_LOCALE 1
+#include <X11/Xlocale.h>
+int
+main ()
+{
+setlocale(LC_CTYPE, "");
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ rxvt_cv_func_xsetlocale=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+rxvt_cv_func_xsetlocale=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $rxvt_cv_func_xsetlocale" >&5
+echo "${ECHO_T}$rxvt_cv_func_xsetlocale" >&6
+if test x$rxvt_cv_func_xsetlocale = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XSETLOCALE 1
+_ACEOF
+
+fi
+LIBS=$ac_save_LIBS
+CFLAGS=$ac_save_CFLAGS
+
+echo "$as_me:$LINENO: checking for working plain setlocale" >&5
+echo $ECHO_N "checking for working plain setlocale... $ECHO_C" >&6
+if test "${rxvt_cv_func_setlocale+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <clocale>
+int
+main ()
+{
+setlocale(LC_CTYPE, "");
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ rxvt_cv_func_setlocale=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+rxvt_cv_func_setlocale=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $rxvt_cv_func_setlocale" >&5
+echo "${ECHO_T}$rxvt_cv_func_setlocale" >&6
+if test x$rxvt_cv_func_setlocale = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SETLOCALE 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for working nl_langinfo" >&5
+echo $ECHO_N "checking for working nl_langinfo... $ECHO_C" >&6
+if test "${rxvt_cv_func_nl_langinfo+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ rxvt_cv_func_nl_langinfo=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+rxvt_cv_func_nl_langinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $rxvt_cv_func_nl_langinfo" >&5
+echo "${ECHO_T}$rxvt_cv_func_nl_langinfo" >&6
+if test x$rxvt_cv_func_nl_langinfo = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NL_LANGINFO 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for unix-compliant filehandle passing ability" >&5
+echo $ECHO_N "checking for unix-compliant filehandle passing ability... $ECHO_C" >&6
+if test "${can_pass_fds+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <cstddef> // broken bsds (is that redundant) need this
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+
+int
+main ()
+{
+
+{
+ msghdr msg;
+ iovec iov;
+ char buf [100];
+ char data = 0;
+
+ iov.iov_base = &data;
+ iov.iov_len = 1;
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = buf;
+ msg.msg_controllen = sizeof buf;
+
+ cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ cmsg->cmsg_len = 100;
+
+ *(int *)CMSG_DATA (cmsg) = 5;
+
+ return sendmsg (3, &msg, 0);
+}
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ can_pass_fds=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+can_pass_fds=no
fi
-echo "$as_me:$LINENO: result: $rxvt_cv_path_ttytab" >&5
-echo "${ECHO_T}$rxvt_cv_path_ttytab" >&6
-if test x$rxvt_cv_path_ttytab != x; then
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $can_pass_fds" >&5
+echo "${ECHO_T}$can_pass_fds" >&6
+if test x$can_pass_fds = xyes; then
-cat >>confdefs.h <<_ACEOF
-#define TTYTAB_FILENAME "$rxvt_cv_path_ttytab"
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UNIX_FDPASS 1
_ACEOF
+else
+ { { echo "$as_me:$LINENO: error: libptytty requires unix-compliant filehandle passing ability" >&5
+echo "$as_me: error: libptytty requires unix-compliant filehandle passing ability" >&2;}
+ { (exit 1); exit 1; }; }
fi
-ac_save_LIBS=$LIBS
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS $X_CFLAGS"
-LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
-if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
- LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
-fi
-echo "$as_me:$LINENO: checking for working Xlocale" >&5
-echo $ECHO_N "checking for working Xlocale... $ECHO_C" >&6
-if test "${rxvt_cv_func_xlocale+set}" = set; then
+echo "$as_me:$LINENO: checking for broken XIM callback" >&5
+echo $ECHO_N "checking for broken XIM callback... $ECHO_C" >&6
+if test "${rxvt_broken_ximcb+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- { echo "$as_me:$LINENO: WARNING: Define NO_XLOCALE in config.h manually" >&5
-echo "$as_me: WARNING: Define NO_XLOCALE in config.h manually" >&2;}
else
cat >conftest.$ac_ext <<_ACEOF
+
+#include <X11/Xlib.h>
+
+void im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3);
+
+void f() {
+ XIMCallback cb;
+ cb.callback = im_destroy_cb;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ rxvt_broken_ximcb=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+rxvt_broken_ximcb=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $rxvt_broken_ximcb" >&5
+echo "${ECHO_T}$rxvt_broken_ximcb" >&6
+
+if test x$rxvt_broken_ximcb = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define XIMCB_PROTO_BROKEN 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+for ac_header in \
+ pty.h \
+ util.h \
+ libutil.h \
+ sys/ioctl.h \
+ sys/stropts.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
-main() {
-char *p;
-if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
-exit (XSupportsLocale() ? 0 : 1);
-else
-exit (1);}
+$ac_includes_default
+#include <$ac_header>
_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- rxvt_cv_func_xlocale=yes
+ ac_header_compiler=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+ echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-rxvt_cv_func_xlocale=no
+ac_header_compiler=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-echo "$as_me:$LINENO: result: $rxvt_cv_func_xlocale" >&5
-echo "${ECHO_T}$rxvt_cv_func_xlocale" >&6
-if test x$rxvt_cv_func_xlocale = xyes; then
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XLOCALE 1
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
-echo "$as_me:$LINENO: checking for working X setlocale" >&5
-echo $ECHO_N "checking for working X setlocale... $ECHO_C" >&6
-if test "${rxvt_cv_func_xsetlocale+set}" = set; then
+done
+
+
+
+
+
+
+
+for ac_func in \
+ revoke \
+ _getpty \
+ getpt \
+ posix_openpt \
+ isastream \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#define X_LOCALE 1
-#include <X11/Xlocale.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
int
main ()
{
-setlocale(LC_CTYPE, "");
+return f != $ac_func;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- rxvt_cv_func_xsetlocale=yes
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-rxvt_cv_func_xsetlocale=no
+eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $rxvt_cv_func_xsetlocale" >&5
-echo "${ECHO_T}$rxvt_cv_func_xsetlocale" >&6
-if test x$rxvt_cv_func_xsetlocale = xyes; then
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+have_clone=no
+
+echo "$as_me:$LINENO: checking for /dev/ptym/clone" >&5
+echo $ECHO_N "checking for /dev/ptym/clone... $ECHO_C" >&6
+if test -e /dev/ptym/clone; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
cat >>confdefs.h <<\_ACEOF
-#define HAVE_XSETLOCALE 1
+#define HAVE_DEV_CLONE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CLONE_DEVICE "/dev/ptym/clone"
_ACEOF
+ have_clone=yes
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-LIBS=$ac_save_LIBS
-CFLAGS=$ac_save_CFLAGS
-echo "$as_me:$LINENO: checking for working plain setlocale" >&5
-echo $ECHO_N "checking for working plain setlocale... $ECHO_C" >&6
-if test "${rxvt_cv_func_setlocale+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for /dev/ptc" >&5
+echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6
+if test -e /dev/ptc; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DEV_PTC 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CLONE_DEVICE "/dev/ptc"
+_ACEOF
+
+ have_clone=yes
else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+case $host in
+ *-*-cygwin*)
+ have_clone=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define CLONE_DEVICE "/dev/ptmx"
+_ACEOF
+
+ ;;
+ *)
+ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5
+echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6
+ if test -e /dev/ptmx; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DEV_PTMX 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CLONE_DEVICE "/dev/ptmx"
+_ACEOF
+
+ have_clone=yes
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ fi
+ ;;
+esac
+
+if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
+ echo "$as_me:$LINENO: checking for UNIX98 ptys" >&5
+echo $ECHO_N "checking for UNIX98 ptys... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <clocale>
+#include <stdlib.h>
int
main ()
{
-setlocale(LC_CTYPE, "");
+grantpt(0);unlockpt(0);ptsname(0);
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- rxvt_cv_func_setlocale=yes
+ unix98_pty=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define UNIX98_PTY 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-rxvt_cv_func_setlocale=no
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $rxvt_cv_func_setlocale" >&5
-echo "${ECHO_T}$rxvt_cv_func_setlocale" >&6
-if test x$rxvt_cv_func_setlocale = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SETLOCALE 1
-_ACEOF
-fi
+if test -z "$unix98_pty"; then
-echo "$as_me:$LINENO: checking for working nl_langinfo" >&5
-echo $ECHO_N "checking for working nl_langinfo... $ECHO_C" >&6
-if test "${rxvt_cv_func_nl_langinfo+set}" = set; then
+for ac_func in openpty
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <langinfo.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
int
main ()
{
-nl_langinfo(CODESET);
+return f != $ac_func;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- rxvt_cv_func_nl_langinfo=yes
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-rxvt_cv_func_nl_langinfo=no
+eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $rxvt_cv_func_nl_langinfo" >&5
-echo "${ECHO_T}$rxvt_cv_func_nl_langinfo" >&6
-if test x$rxvt_cv_func_nl_langinfo = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_NL_LANGINFO 1
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-fi
-
-SCM_RIGHTS_CHECK
-
-echo "$as_me:$LINENO: checking for broken XIM callback" >&5
-echo $ECHO_N "checking for broken XIM callback... $ECHO_C" >&6
-if test "${rxvt_broken_ximcb+set}" = set; then
+else
+ echo "$as_me:$LINENO: checking for openpty in -lutil" >&5
+echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
+if test "${ac_cv_lib_util_openpty+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-
-#include <X11/Xlib.h>
-
-void im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3);
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-void f() {
- XIMCallback cb;
- cb.callback = im_destroy_cb;
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char openpty ();
+int
+main ()
+{
+openpty ();
+ ;
+ return 0;
}
-
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- rxvt_broken_ximcb=yes
+ ac_cv_lib_util_openpty=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-rxvt_broken_ximcb=no
+ac_cv_lib_util_openpty=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:$LINENO: result: $rxvt_broken_ximcb" >&5
-echo "${ECHO_T}$rxvt_broken_ximcb" >&6
-
-if test x$rxvt_broken_ximcb = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define XIMCB_PROTO_BROKEN 1
+echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5
+echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
+if test $ac_cv_lib_util_openpty = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENPTY 1
_ACEOF
+ LIBS="$LIBS -lutil"
+fi
+
+fi
+done
fi
-PTY_CHECK
if test x$support_xft = xyes; then
# Extract the first word of "pkg-config", so it can be a program name with args.
--- /dev/null
+AC_DEFUN([PTY_CHECK],
+[
+AC_CHECK_HEADERS( \
+ pty.h \
+ util.h \
+ libutil.h \
+ sys/ioctl.h \
+ sys/stropts.h \
+)
+
+AC_CHECK_FUNCS( \
+ revoke \
+ _getpty \
+ getpt \
+ posix_openpt \
+ isastream \
+)
+
+have_clone=no
+
+AC_MSG_CHECKING(for /dev/ptym/clone)
+if test -e /dev/ptym/clone; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DEV_CLONE, 1, [Define to 1 if you have /dev/ptym/clone])
+ AC_DEFINE(CLONE_DEVICE, "/dev/ptym/clone", [clone device filename])
+ have_clone=yes
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING(for /dev/ptc)
+if test -e /dev/ptc; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DEV_PTC, 1, [Define to 1 if you have /dev/ptc])
+ AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename])
+ have_clone=yes
+else
+ AC_MSG_RESULT(no)
+fi
+
+case $host in
+ *-*-cygwin*)
+ have_clone=yes
+ AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename])
+ ;;
+ *)
+ AC_MSG_CHECKING(for /dev/ptmx)
+ if test -e /dev/ptmx; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if you have /dev/ptmx])
+ AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename])
+ have_clone=yes
+ else
+ AC_MSG_RESULT(no)
+ fi
+ ;;
+esac
+
+if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
+ AC_MSG_CHECKING(for UNIX98 ptys)
+ AC_TRY_LINK([#include <stdlib.h>],
+ [grantpt(0);unlockpt(0);ptsname(0);],
+ [unix98_pty=yes
+ AC_DEFINE(UNIX98_PTY, 1, "")
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+fi
+
+if test -z "$unix98_pty"; then
+ AC_CHECK_FUNCS(openpty, [], [AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])])
+fi
+])
+
+AC_DEFUN([UTMP_CHECK],
+[
+AC_CHECK_FUNCS( \
+ ttyslot \
+ updwtmp \
+ updwtmpx \
+)
+
+AC_CHECK_HEADERS( \
+ utmp.h \
+ utmpx.h \
+ lastlog.h \
+)
+
+dnl# --------------------------------------------------------------------------
+dnl# DO ALL UTMP AND WTMP CHECKING
+dnl# --------------------------------------------------------------------------
+dnl# check for host field in utmp structure
+
+dnl# --------------------------------------------
+AC_CHECK_HEADER(utmp.h,
+[AC_CACHE_CHECK([for struct utmp], struct_utmp,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmp.h>]], [[struct utmp ut;]])],[struct_utmp=yes],[struct_utmp=no])])
+if test x$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, struct_utmp_host,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[struct_utmp_host=yes],[struct_utmp_host=no])])
+if test x$struct_utmp_host = xyes; then
+ AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
+fi
+
+AC_CACHE_CHECK(for ut_pid in utmp struct, struct_utmp_pid,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[struct_utmp_pid=yes],[struct_utmp_pid=no])])
+if test x$struct_utmp_pid = xyes; then
+ AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
+fi
+) dnl# AC_CHECK_HEADER(utmp.h
+
+dnl# --------------------------------------------
+
+AC_CHECK_HEADER(utmpx.h,
+[AC_CACHE_CHECK([for struct utmpx], struct_utmpx,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmpx.h>]], [[struct utmpx ut;]])],[struct_utmpx=yes],[struct_utmpx=no])])
+if test x$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, struct_utmpx_host,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[struct_utmpx_host=yes],[struct_utmpx_host=no])])
+if test x$struct_utmpx_host = xyes; then
+ AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
+fi
+
+AC_CACHE_CHECK(for session in utmpx struct, struct_utmpx_session,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <utmpx.h>],
+[struct utmpx utx; utx.ut_session;],
+struct_utmpx_session=yes, struct_utmpx_session=no)])
+if test x$struct_utmpx_session = xyes; then
+ AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
+fi
+) dnl# AC_CHECK_HEADER(utmpx.h
+
+dnl# --------------------------------------------------------------------------
+dnl# check for struct lastlog
+AC_CACHE_CHECK(for struct lastlog, struct_lastlog,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmp.h>
+#ifdef HAVE_LASTLOG_H
+#include <lastlog.h>
+#endif
+]], [[struct lastlog ll;]])],[struct_lastlog=yes],[struct_lastlog=no])])
+if test x$struct_lastlog = xyes; then
+ AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
+fi
+
+dnl# check for struct lastlogx
+AC_CACHE_CHECK(for struct lastlogx, struct_lastlogx,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <utmpx.h>
+#ifdef HAVE_LASTLOG_H
+#include <lastlog.h>
+#endif
+]], [[struct lastlogx ll;]])],[struct_lastlogx=yes],[struct_lastlogx=no])])
+if test x$struct_lastlogx = xyes; then
+ AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
+fi
+
+dnl# --------------------------------------------------------------------------
+dnl# FIND FILES
+dnl# --------------------------------------------------------------------------
+
+dnl# find utmp
+AC_CACHE_CHECK(where utmp is located, path_utmp,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#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);
+}]])],[path_utmp=`cat conftestval`],[path_utmp=],[dnl
+ AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
+if test x$path_utmp != x; then
+ AC_DEFINE_UNQUOTED(UTMP_FILE, "$path_utmp", Define location of utmp)
+fi
+
+dnl# --------------------------------------------------------------------------
+
+dnl# find utmpx - if a utmp file exists at the same location and is more than
+dnl# a day newer, then dump the utmpx. People leave lots of junk around.
+AC_CACHE_CHECK(where utmpx is located, path_utmpx,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+#include <sys/types.h>
+#include <utmpx.h>
+#include <errno.h>
+#include <sys/stat.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+main()
+{
+ 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);
+}]])],[path_utmpx=`cat conftestval`],[path_utmpx=],[dnl
+ AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
+if test x$path_utmpx != x; then
+ AC_DEFINE_UNQUOTED(UTMPX_FILE, "$path_utmpx", Define location of utmpx)
+fi
+
+dnl# --------------------------------------------------------------------------
+
+dnl# find wtmp
+AC_CACHE_CHECK(where wtmp is located, path_wtmp,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#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);
+}]])],[path_wtmp=`cat conftestval`],[path_wtmp=],[dnl
+ AC_MSG_WARN(Define WTMP_FILE in config.h manually)])])
+if test x$path_wtmp != x; then
+ AC_DEFINE_UNQUOTED(WTMP_FILE, "$path_wtmp", Define location of wtmp)
+fi
+dnl# --------------------------------------------------------------------------
+
+dnl# find wtmpx
+AC_CACHE_CHECK(where wtmpx is located, path_wtmpx,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#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);
+}]])],[path_wtmpx=`cat conftestval`],[path_wtmpx=],[dnl
+ AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])])
+if test x$path_wtmpx != x; then
+ AC_DEFINE_UNQUOTED(WTMPX_FILE, "$path_wtmpx", Define location of wtmpx)
+fi
+dnl# --------------------------------------------------------------------------
+
+dnl# find lastlog
+AC_CACHE_CHECK(where lastlog is located, path_lastlog,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#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);
+}]])],[path_lastlog=`cat conftestval`],[path_lastlog=],[dnl
+ AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
+if test x$path_lastlog != x; then
+ AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$path_lastlog", Define location of lastlog)
+ if test -d "$path_lastlog"; then
+ AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory)
+ fi
+fi
+dnl# --------------------------------------------------------------------------
+
+dnl# find lastlogx
+AC_CACHE_CHECK(where lastlogx is located, path_lastlogx,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif
+#include <errno.h>
+main()
+{
+ char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
+ FILE *a, *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+#ifdef LASTLOGX_FILE
+ fprintf(f, "%s\n", LASTLOGX_FILE);
+ exit(0);
+#endif
+#ifdef _PATH_LASTLOGX
+ fprintf(f, "%s\n", _PATH_LASTLOGX);
+ 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);
+}]])],[path_lastlogx=`cat conftestval`],[path_lastlogx=],[dnl
+ AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
+if test x$path_lastlogx != x; then
+ AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$path_lastlogx", Define location of lastlogx)
+fi
+])
+
+AC_DEFUN([SCM_RIGHTS_CHECK],
+[
+AC_CACHE_CHECK(for unix-compliant filehandle passing ability, can_pass_fds,
+[AC_TRY_LINK([
+#include <cstddef> // broken bsds (is that redundant) need this
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+],[
+{
+ msghdr msg;
+ iovec iov;
+ char buf [100];
+ char data = 0;
+
+ iov.iov_base = &data;
+ iov.iov_len = 1;
+
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = buf;
+ msg.msg_controllen = sizeof buf;
+
+ cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ cmsg->cmsg_len = 100;
+
+ *(int *)CMSG_DATA (cmsg) = 5;
+
+ return sendmsg (3, &msg, 0);
+}
+],[can_pass_fds=yes],[can_pass_fds=no])])
+if test x$can_pass_fds = xyes; then
+ AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
+else
+ AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
+fi
+])