On Wed, Jul 10, 2013 at 01:30:23AM -0700, Philip Guenther wrote:
> On Wed, Jul 10, 2013 at 1:19 AM, Philip Guenther <guent...@gmail.com> wrote:
> > Looks like a race in luit's startup, due to how it handles the
> > ttys/ptys.  To work around the problem, invoke it with the -p
> > option...but I don't know how you can convince xterm to do that.
> 
> Ha!  I believe this bug is a result of posix_openpt() being
> implemented in 5.3 and the luit configure script picking that instead
> of openpty(), as the code for the former results in the client side
> being opened (by PTMGET), then closed, then reopened by name, which
> leaves a window where the master will read EOF.
> 
> Naddy, can you coerce configure into ignoring posix_openpt()?
Can you check the patch below ? 
(sorry it's huge since it regenerates autotools files)

Index: Makefile.in
===================================================================
RCS file: /cvs/xenocara/app/luit/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- Makefile.in 10 Feb 2013 15:38:36 -0000      1.6
+++ Makefile.in 11 Jul 2013 21:40:11 -0000
@@ -252,6 +252,8 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
Index: aclocal.m4
===================================================================
RCS file: /cvs/xenocara/app/luit/aclocal.m4,v
retrieving revision 1.10
diff -u -r1.10 aclocal.m4
--- aclocal.m4  10 Feb 2013 15:38:36 -0000      1.10
+++ aclocal.m4  11 Jul 2013 21:40:13 -0000
@@ -20,6 +20,7 @@
 To do so, use the procedure documented by the package, typically 
'autoreconf'.])])
 
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
 # 
 # Copyright © 2004 Scott James Remnant <sc...@netsplit.com>.
 #
@@ -46,8 +47,12 @@
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search 
path])
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 fi
@@ -60,7 +65,6 @@
                AC_MSG_RESULT([no])
                PKG_CONFIG=""
        fi
-               
 fi[]dnl
 ])# PKG_PROG_PKG_CONFIG
 
@@ -69,34 +73,32 @@
 # Check to see whether a particular set of modules exists.  Similar
 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
 #
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
 # --------------------------------------------------------------
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_ifval([$2], [$2], [:])
+  m4_default([$2], [:])
 m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
-
 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 # ---------------------------------------------
 m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
-    if test -n "$$1"; then
-        pkg_cv_[]$1="$$1"
-    else
-        PKG_CHECK_EXISTS([$3],
-                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
-                        [pkg_failed=yes])
-    fi
-else
-       pkg_failed=untried
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
 fi[]dnl
 ])# _PKG_CONFIG
 
@@ -138,16 +140,17 @@
 See the pkg-config man page for more details.])
 
 if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout 
--print-errors "$2"`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "$2" 2>&1`
         else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors 
"$2"`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
-       ifelse([$4], , [AC_MSG_ERROR(dnl
+       m4_default([$4], [AC_MSG_ERROR(
 [Package requirements ($2) were not met:
 
 $$1_PKG_ERRORS
@@ -155,27 +158,66 @@
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT
-])],
-               [AC_MSG_RESULT([no])
-                $4])
+_PKG_TEXT])[]dnl
+        ])
 elif test $pkg_failed = untried; then
-       ifelse([$4], , [AC_MSG_FAILURE(dnl
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
 [The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
-               [$4])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
 else
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
         AC_MSG_RESULT([yes])
-       ifelse([$3], , :, [$3])
+       $3
 fi[]dnl
 ])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
 
 # Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
Index: configure
===================================================================
RCS file: /cvs/xenocara/app/luit/configure,v
retrieving revision 1.11
diff -u -r1.11 configure
--- configure   10 Feb 2013 15:38:36 -0000      1.11
+++ configure   11 Jul 2013 21:40:20 -0000
@@ -658,6 +658,8 @@
 build_cpu
 build
 INSTALL_CMD
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
 PKG_CONFIG
 CHANGELOG_CMD
 STRICT_CFLAGS
@@ -767,6 +769,8 @@
 CPPFLAGS
 CPP
 PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
 LUIT_CFLAGS
 LUIT_LIBS'
 
@@ -1420,6 +1424,10 @@
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
   LUIT_CFLAGS C compiler flags for LUIT, overriding pkg-config
   LUIT_LIBS   linker flags for LUIT, overriding pkg-config
 
@@ -4393,6 +4401,11 @@
 
 
 
+
+
+
+
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a 
program name with args.
@@ -4505,7 +4518,6 @@
 $as_echo "no" >&6; }
                PKG_CONFIG=""
        fi
-
 fi
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -10512,46 +10524,46 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUIT" >&5
 $as_echo_n "checking for LUIT... " >&6; }
 
-if test -n "$PKG_CONFIG"; then
-    if test -n "$LUIT_CFLAGS"; then
-        pkg_cv_LUIT_CFLAGS="$LUIT_CFLAGS"
-    else
-        if test -n "$PKG_CONFIG" && \
+if test -n "$LUIT_CFLAGS"; then
+    pkg_cv_LUIT_CFLAGS="$LUIT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"fontenc\""; } >&5
   ($PKG_CONFIG --exists --print-errors "fontenc") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_LUIT_CFLAGS=`$PKG_CONFIG --cflags "fontenc" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
-    fi
-else
-       pkg_failed=untried
+ else
+    pkg_failed=untried
 fi
-if test -n "$PKG_CONFIG"; then
-    if test -n "$LUIT_LIBS"; then
-        pkg_cv_LUIT_LIBS="$LUIT_LIBS"
-    else
-        if test -n "$PKG_CONFIG" && \
+if test -n "$LUIT_LIBS"; then
+    pkg_cv_LUIT_LIBS="$LUIT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
     { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"fontenc\""; } >&5
   ($PKG_CONFIG --exists --print-errors "fontenc") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_LUIT_LIBS=`$PKG_CONFIG --libs "fontenc" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
-    fi
-else
-       pkg_failed=untried
+ else
+    pkg_failed=untried
 fi
 
 
 
 if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
         _pkg_short_errors_supported=yes
@@ -10559,9 +10571,9 @@
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               LUIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout 
--print-errors "fontenc"`
+               LUIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "fontenc" 2>&1`
         else
-               LUIT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors 
"fontenc"`
+               LUIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"fontenc" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$LUIT_PKG_ERRORS" >&5
@@ -10575,9 +10587,10 @@
 
 Alternatively, you may set the environment variables LUIT_CFLAGS
 and LUIT_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-" "$LINENO" 5
+See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "The pkg-config script could not be found or is too old.  Make 
sure it
@@ -10588,14 +10601,14 @@
 and LUIT_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
-To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details" "$LINENO" 5; }
 else
        LUIT_CFLAGS=$pkg_cv_LUIT_CFLAGS
        LUIT_LIBS=$pkg_cv_LUIT_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       :
+
 fi
 
 # We don't link against libX11, just use its locale.alias data file
@@ -10642,6 +10655,11 @@
 
         OS_CFLAGS="-D_XOPEN_SOURCE=500"
         ;;
+    openbsd*)
+        # grantpt() support is broken on OpenBSD
+       ac_cv_func_grantpt=no
+       unset HAVE_GRANTPT
+       ;;
     *)
         for ac_header in poll.h
 do :
@@ -10684,7 +10702,7 @@
 
 done
 
-for ac_func in grantpt putenv select strdup
+for ac_func in putenv select strdup
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Index: configure.ac
===================================================================
RCS file: /cvs/xenocara/app/luit/configure.ac,v
retrieving revision 1.6
diff -u -r1.6 configure.ac
--- configure.ac        10 Feb 2013 15:38:37 -0000      1.6
+++ configure.ac        11 Jul 2013 21:40:21 -0000
@@ -64,6 +64,11 @@
         AC_CHECK_FUNCS([poll])
         OS_CFLAGS="-D_XOPEN_SOURCE=500"
         ;;
+    openbsd*)
+        # grantpt() support is broken on OpenBSD
+       ac_cv_func_grantpt=no
+       unset HAVE_GRANTPT
+       ;;
     *)
         AC_CHECK_HEADERS([poll.h])
         AC_CHECK_FUNCS([poll])
@@ -73,7 +78,7 @@
 AC_SUBST(OS_CFLAGS)
 
 AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h 
sys/select.h sys/time.h termios.h]) 
-AC_CHECK_FUNCS([grantpt putenv select strdup])
+AC_CHECK_FUNCS([putenv select strdup])
 
 if test "x$ac_cv_func_grantpt" != "xyes" ; then
         AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
Index: man/Makefile.in
===================================================================
RCS file: /cvs/xenocara/app/luit/man/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- man/Makefile.in     10 Feb 2013 15:38:37 -0000      1.1
+++ man/Makefile.in     11 Jul 2013 21:40:22 -0000
@@ -197,6 +197,8 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@


-- 
Matthieu Herrb

Reply via email to