Use rxvt_temp_buf in more places.
[dana/urxvt.git] / configure
index b8291eb..80b6de4 100755 (executable)
--- a/configure
+++ b/configure
@@ -1296,6 +1296,7 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-everything     enable standard non-multichoice features
                           NOTE: this option is order dependent
+  --enable-assert         enable assertions
   --enable-warnings       turn on g++ warnings
   --enable-unicode3       use 21 instead of 16 bits to represent unicode characters
   --enable-combining      enable composition of base and combining characters
@@ -4455,6 +4456,22 @@ if test "${enable_everything+set}" = set; then
 fi
 
 
+ASSERTIONS=no
+# Check whether --enable-assert was given.
+if test "${enable_assert+set}" = set; then
+  enableval=$enable_assert; if test x$enableval = xyes; then
+    ASSERTIONS=yes
+  fi
+fi
+
+if test x$ASSERTIONS = xno; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NDEBUG 1
+_ACEOF
+
+fi
+
 WARNINGS=no
 # Check whether --enable-warnings was given.
 if test "${enable_warnings+set}" = set; then
@@ -5326,7 +5343,8 @@ done
 
 
 
-for ac_header in sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h sys/eventfd.h
+
+for ac_header in sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -5473,7 +5491,8 @@ done
 
 
 
-for ac_func in inotify_init epoll_ctl kqueue port_create poll select eventfd
+
+for ac_func in inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -5652,7 +5671,63 @@ if test $ac_cv_func_clock_gettime = yes; then
   :
 else
 
-   if test -z "$LIBEV_M4_AVOID_LIBRT"; then
+      if test $(uname) = Linux; then
+      { echo "$as_me:$LINENO: checking for clock_gettime syscall" >&5
+echo $ECHO_N "checking for clock_gettime syscall... $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 <syscall.h>
+                       #include <time.h>
+int
+main ()
+{
+struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_have_clock_syscall=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CLOCK_SYSCALL 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
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+   fi
+   if test -z "$LIBEV_M4_AVOID_LIBRT" && test -z "$ac_have_clock_syscall"; then
 
 { echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
 echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6; }
@@ -6156,8 +6231,6 @@ fi
 
 
 
-
-
 # Extract the first word of "tic", so it can be a program name with args.
 set dummy tic; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8560,9 +8633,9 @@ fi
 
 
 for ac_func in \
-       ttyslot \
        updwtmp \
        updwtmpx \
+       updlastlogx \
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -8658,13 +8731,7 @@ done
 
 
 
-
-
-for ac_header in \
-       utmp.h \
-       utmpx.h \
-       lastlog.h \
-
+for ac_header in lastlog.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -8805,18 +8872,23 @@ 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
+
+for ac_header in utmp.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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; }
+{ 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
@@ -8824,7 +8896,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <utmp.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -8856,15 +8928,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 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; }
+{ 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 <utmp.h>
+#include <$ac_header>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -8897,41 +8969,45 @@ 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;}
+    { 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: 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;}
+    { 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;}
 
     ;;
 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 "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_utmp_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_utmp_h" >&5
-echo "${ECHO_T}$ac_cv_header_utmp_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
-if test $ac_cv_header_utmp_h = yes; then
-  { echo "$as_me:$LINENO: checking for struct utmp" >&5
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ { 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
@@ -9108,20 +9184,26 @@ fi
 
 fi
 
+done
+
 
 
-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
+for ac_header in utmpx.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&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; }
+{ 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
@@ -9129,7 +9211,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <utmpx.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -9161,15 +9243,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 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; }
+{ 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 <utmpx.h>
+#include <$ac_header>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -9202,41 +9284,45 @@ 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;}
+    { 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: 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;}
+    { 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;}
 
     ;;
 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 "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_utmpx_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_utmpx_h" >&5
-echo "${ECHO_T}$ac_cv_header_utmpx_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
-if test $ac_cv_header_utmpx_h = yes; then
-  { echo "$as_me:$LINENO: checking for struct utmpx" >&5
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ { 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
@@ -9413,6 +9499,7 @@ fi
 
 fi
 
+done
 
 { echo "$as_me:$LINENO: checking for struct lastlog" >&5
 echo $ECHO_N "checking for struct lastlog... $ECHO_C" >&6; }
@@ -9993,13 +10080,6 @@ 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