From b2e05b12e9e4933a16941658a692d86ec357c3d5 Mon Sep 17 00:00:00 2001 From: Michael Darling Date: Thu, 16 Jul 2015 22:38:18 -0400 Subject: [PATCH] [13/14] Completes renaming of configure.in files to .ac Combined builds has been broken for about 10 months, because some binutils configure.in files were renamed to configure.ac, but gcc's references to them were not updated. Fixing gcc's references to them is much easier by renaming the few straggling configure.in files to configure.ac. gcc's configure.in files were entirely renamed to configure.ac some time ago. There are corresponding patches submitted to gcc, which updates all references to binutils-gdb configure.in files to configure.ac, which is what ultimately fixes combined builds. See PR binutils-gdb/binutils/18450 and gcc/other/66259. Signed-off by: Michael Darling --- readline/ChangeLog.gdb | 10 + readline/INSTALL | 6 +- readline/MANIFEST | 4 +- readline/Makefile.in | 2 +- readline/aclocal.m4 | 12 +- readline/configure | 2 +- readline/configure.ac | 304 +++++++++++++++++++++++++ readline/configure.in | 304 ------------------------- readline/doc/ChangeLog.gdb | 5 + readline/doc/texi2html | 2 +- readline/examples/rlfe/ChangeLog | 6 + readline/examples/rlfe/Makefile.in | 4 +- readline/examples/rlfe/configure.ac | 442 ++++++++++++++++++++++++++++++++++++ readline/examples/rlfe/configure.in | 442 ------------------------------------ 14 files changed, 783 insertions(+), 762 deletions(-) create mode 100644 readline/configure.ac delete mode 100644 readline/configure.in create mode 100644 readline/examples/rlfe/configure.ac delete mode 100644 readline/examples/rlfe/configure.in diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index 43abd19..48a3b9c 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,3 +1,13 @@ +2015-07-16 Micahel Darling + + PR binutils/18450 + * INSTALL: Reflects renaming of configure.in to configure.ac + * MANIFEST: Likewise + * Makefile.in: Likewise + * aclocal.m4: Likewise + * configure: Likewise + * configure.ac: Renamed from configure.in + 2014-12-30 Eli Zaretskii * complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on diff --git a/readline/INSTALL b/readline/INSTALL index a0b0976..625e690 100644 --- a/readline/INSTALL +++ b/readline/INSTALL @@ -51,10 +51,10 @@ be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. -The file `configure.in' is used to create `configure' by a -program called `autoconf'. You only need `configure.in' if you +The file `configure.ac' is used to create `configure' by a +program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version -of `autoconf'. The readline `configure.in' requires autoconf +of `autoconf'. The readline `configure.ac' requires autoconf version 2.50 or newer. Compilers and Options diff --git a/readline/MANIFEST b/readline/MANIFEST index 8972bdd..ab3c223 100644 --- a/readline/MANIFEST +++ b/readline/MANIFEST @@ -18,7 +18,7 @@ USAGE f aclocal.m4 f config.h.in f configure f -configure.in f +configure.ac f Makefile.in f ansi_stdlib.h f chardefs.h f @@ -126,7 +126,7 @@ examples/rlfe/Makefile.in f examples/rlfe/README f examples/rlfe/config.h.in f examples/rlfe/configure f -examples/rlfe/configure.in f +examples/rlfe/configure.ac f examples/rlfe/extern.h f examples/rlfe/os.h f examples/rlfe/pty.c f diff --git a/readline/Makefile.in b/readline/Makefile.in index f4ed811..1436664 100644 --- a/readline/Makefile.in +++ b/readline/Makefile.in @@ -193,7 +193,7 @@ stamp-h: config.status $(srcdir)/config.h.in CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status echo > $@ -#$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution +#$(srcdir)/configure: $(srcdir)/configure.ac ## Comment-me-out in distribution # cd $(srcdir) && autoconf ## Comment-me-out in distribution diff --git a/readline/aclocal.m4 b/readline/aclocal.m4 index 716a043..6e87227 100644 --- a/readline/aclocal.m4 +++ b/readline/aclocal.m4 @@ -2107,7 +2107,7 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then - dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. @@ -2329,7 +2329,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) - dnl For backward compatibility. Some configure.ins may be using this. + dnl For backward compatibility. Some configure.acs may be using this. nls_cv_header_intl= nls_cv_header_libgt= @@ -2748,8 +2748,8 @@ dnl the same distribution terms as the rest of that program. # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX +# configure.ac:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.ac:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) @@ -3775,14 +3775,14 @@ AC_DEFUN([AM_PO_SUBDIRS], if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.ac is obsolete" || echo "setting ALL_LINGUAS in configure.ac is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else - # The set of available languages was given in configure.in. + # The set of available languages was given in configure.ac. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi case "$ac_given_srcdir" in diff --git a/readline/configure b/readline/configure index 09de45d..ef83595 100755 --- a/readline/configure +++ b/readline/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in for Readline 6.2, version 2.67. +# From configure.ac for Readline 6.2, version 2.67. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.64 for readline 6.2. # diff --git a/readline/configure.ac b/readline/configure.ac new file mode 100644 index 0000000..b395af4 --- /dev/null +++ b/readline/configure.ac @@ -0,0 +1,304 @@ +dnl +dnl Configure script for readline library +dnl +dnl report bugs to chet@po.cwru.edu +dnl +dnl Process this file with autoconf to produce a configure script. + +# Copyright (C) 1987-2009 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +AC_REVISION([for Readline 6.2, version 2.67]) + +m4_include([../config/override.m4]) + +AC_INIT(readline, 6.2, bug-readline@gnu.org) + +dnl make sure we are using a recent autoconf version +AC_PREREQ(2.50) + +AC_CONFIG_SRCDIR(readline.h) +dnl GDB LOCAL +dnl AC_CONFIG_AUX_DIR(./support) +AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..) +AC_CONFIG_HEADERS(config.h) + +dnl update the value of RL_READLINE_VERSION in readline.h when this changes +LIBVERSION=6.2 + +AC_CANONICAL_HOST +AC_CANONICAL_BUILD + +dnl configure defaults +opt_curses=no +opt_purify=no + +dnl arguments to configure +AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) +AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) + +if test "$opt_curses" = "yes"; then + prefer_curses=yes +fi + +if test "$opt_purify" = yes; then + PURIFY="purify" +else + PURIFY= +fi + +dnl option parsing for optional features +opt_multibyte=yes +opt_static_libs=yes +opt_shared_libs=no + +AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval) +dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval) +AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval) + +if test $opt_multibyte = no; then +AC_DEFINE(NO_MULTIBYTE_SUPPORT) +fi + +dnl load up the cross-building cache file -- add more cases and cache +dnl files as necessary + +dnl Note that host and target machine are the same, and different than the +dnl build machine. + +CROSS_COMPILE= +if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin*) + cross_cache=${srcdir}/cross-build/cygwin.cache + ;; + *-mingw*) + cross_cache=${srcdir}/cross-build/mingw.cache + ;; + i[[3456]]86-*-beos*) + cross_cache=${srcdir}/cross-build/x86-beos.cache + ;; + *) echo "configure: cross-compiling for $host is not supported" >&2 + ;; + esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + CROSS_COMPILE='-DCROSS_COMPILING' + AC_SUBST(CROSS_COMPILE) +fi + +echo "" +echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}" +echo "" + +# We want these before the checks, so the checks can modify their values. +test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 + +AC_PROG_MAKE_SET +AC_PROG_CC +dnl AC_AIX +AC_MINIX + +# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. +test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" + +AC_PROG_GCC_TRADITIONAL +AC_PROG_INSTALL +AC_CHECK_PROG(AR, ar, , ar) +dnl Set default for ARFLAGS, since autoconf does not have a macro for it. +dnl This allows people to set it when running configure or make +test -n "$ARFLAGS" || ARFLAGS="cr" +AC_PROG_RANLIB + +MAKE_SHELL=/bin/sh +AC_SUBST(MAKE_SHELL) + +AC_C_CONST +AC_C_PROTOTYPES +AC_C_CHAR_UNSIGNED +AC_C_VOLATILE + +AC_TYPE_SIGNAL + +AC_TYPE_SIZE_T +AC_CHECK_TYPE(ssize_t, int) + +AC_HEADER_STDC + +AC_HEADER_STAT +AC_HEADER_DIRENT + +AC_CHECK_FUNCS(fcntl kill lstat) +AC_CHECK_FUNCS(memmove putenv select setenv setlocale \ + strcasecmp strpbrk tcgetattr vsnprintf) +AC_CHECK_FUNCS(isascii isxdigit) +AC_CHECK_FUNCS(getpwent getpwnam getpwuid) + +AC_FUNC_STRCOLL + +AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ + limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h) +AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h) + +AC_CHECK_HEADERS(sys/ptem.h,,, +[[ +#if HAVE_SYS_STREAM_H +# include +#endif +]]) + +AC_SYS_LARGEFILE + +BASH_SYS_SIGNAL_VINTAGE +BASH_SYS_REINSTALL_SIGHANDLERS + +BASH_FUNC_POSIX_SETJMP +BASH_FUNC_LSTAT +BASH_FUNC_STRCOLL +BASH_FUNC_CTYPE_NONASCII + +BASH_CHECK_GETPW_FUNCS + +AC_HEADER_TIOCGWINSZ + +BASH_TYPE_SIG_ATOMIC_T +BASH_TYPE_SIGHANDLER + +BASH_HAVE_TIOCSTAT +BASH_HAVE_FIONREAD +BASH_CHECK_SPEED_T +BASH_STRUCT_WINSIZE +BASH_STRUCT_DIRENT_D_INO +BASH_STRUCT_DIRENT_D_FILENO + +dnl yuck +case "$host_os" in +aix*) prefer_curses=yes ;; +esac +BASH_CHECK_LIB_TERMCAP +if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then + if test "$prefer_curses" = yes; then + TERMCAP_LIB=-lcurses + else + TERMCAP_LIB=-ltermcap #default + fi +fi + +BASH_CHECK_MULTIBYTE + +case "$host_cpu" in +*cray*) LOCAL_CFLAGS=-DCRAY ;; +*s390*) LOCAL_CFLAGS=-fsigned-char ;; +esac + +case "$host_os" in +isc*) LOCAL_CFLAGS=-Disc386 ;; +esac + +# shared library configuration section +# +# Shared object configuration section. These values are generated by +# ${srcdir}/support/shobj-conf +# +if test -f ${srcdir}/support/shobj-conf; then + AC_MSG_CHECKING(configuration for building shared libraries) + eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + +# case "$SHLIB_LIBS" in +# *curses*|*termcap*|*termlib*) ;; +# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; +# esac + + AC_SUBST(SHOBJ_CC) + AC_SUBST(SHOBJ_CFLAGS) + AC_SUBST(SHOBJ_LD) + AC_SUBST(SHOBJ_LDFLAGS) + AC_SUBST(SHOBJ_XLDFLAGS) + AC_SUBST(SHOBJ_LIBS) + AC_SUBST(SHOBJ_STATUS) + AC_SUBST(SHLIB_STATUS) + AC_SUBST(SHLIB_XLDFLAGS) + AC_SUBST(SHLIB_DOT) + AC_SUBST(SHLIB_LIBPREF) + AC_SUBST(SHLIB_LIBSUFF) + AC_SUBST(SHLIB_LIBVERSION) + AC_SUBST(SHLIB_DLLVERSION) + AC_SUBST(SHLIB_LIBS) + AC_MSG_RESULT($SHLIB_STATUS) + + # SHLIB_STATUS is either `supported' or `unsupported'. If it's + # `unsupported', turn off any default shared library building + if test "$SHLIB_STATUS" = 'unsupported'; then + opt_shared_libs=no + fi + + # shared library versioning + # quoted for m4 so I can use character classes + SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`] + SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`] + AC_SUBST(SHLIB_MAJOR) + AC_SUBST(SHLIB_MINOR) +fi + +if test "$opt_static_libs" = "yes"; then + STATIC_TARGET=static + STATIC_INSTALL_TARGET=install-static +fi +if test "$opt_shared_libs" = "yes"; then + SHARED_TARGET=shared + SHARED_INSTALL_TARGET=install-shared +fi + +AC_SUBST(STATIC_TARGET) +AC_SUBST(SHARED_TARGET) +AC_SUBST(STATIC_INSTALL_TARGET) +AC_SUBST(SHARED_INSTALL_TARGET) + +case "$build_os" in +msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file +*) BUILD_DIR=`pwd` ;; +esac + +case "$BUILD_DIR" in +*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; +*) ;; +esac + +AC_SUBST(PURIFY) +AC_SUBST(BUILD_DIR) + +AC_SUBST(CFLAGS) +AC_SUBST(LOCAL_CFLAGS) +AC_SUBST(LOCAL_LDFLAGS) +AC_SUBST(LOCAL_DEFS) + +AC_SUBST(AR) +AC_SUBST(ARFLAGS) + +AC_SUBST(host_cpu) +AC_SUBST(host_os) + +AC_SUBST(LIBVERSION) + +AC_SUBST(TERMCAP_LIB) + +AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile], +[ +# Makefile uses this timestamp file to record whether config.h is up to date. +echo > stamp-h +]) diff --git a/readline/configure.in b/readline/configure.in deleted file mode 100644 index b395af4..0000000 --- a/readline/configure.in +++ /dev/null @@ -1,304 +0,0 @@ -dnl -dnl Configure script for readline library -dnl -dnl report bugs to chet@po.cwru.edu -dnl -dnl Process this file with autoconf to produce a configure script. - -# Copyright (C) 1987-2009 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -AC_REVISION([for Readline 6.2, version 2.67]) - -m4_include([../config/override.m4]) - -AC_INIT(readline, 6.2, bug-readline@gnu.org) - -dnl make sure we are using a recent autoconf version -AC_PREREQ(2.50) - -AC_CONFIG_SRCDIR(readline.h) -dnl GDB LOCAL -dnl AC_CONFIG_AUX_DIR(./support) -AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..) -AC_CONFIG_HEADERS(config.h) - -dnl update the value of RL_READLINE_VERSION in readline.h when this changes -LIBVERSION=6.2 - -AC_CANONICAL_HOST -AC_CANONICAL_BUILD - -dnl configure defaults -opt_curses=no -opt_purify=no - -dnl arguments to configure -AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) -AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) - -if test "$opt_curses" = "yes"; then - prefer_curses=yes -fi - -if test "$opt_purify" = yes; then - PURIFY="purify" -else - PURIFY= -fi - -dnl option parsing for optional features -opt_multibyte=yes -opt_static_libs=yes -opt_shared_libs=no - -AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval) -dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval) -AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval) - -if test $opt_multibyte = no; then -AC_DEFINE(NO_MULTIBYTE_SUPPORT) -fi - -dnl load up the cross-building cache file -- add more cases and cache -dnl files as necessary - -dnl Note that host and target machine are the same, and different than the -dnl build machine. - -CROSS_COMPILE= -if test "x$cross_compiling" = "xyes"; then - case "${host}" in - *-cygwin*) - cross_cache=${srcdir}/cross-build/cygwin.cache - ;; - *-mingw*) - cross_cache=${srcdir}/cross-build/mingw.cache - ;; - i[[3456]]86-*-beos*) - cross_cache=${srcdir}/cross-build/x86-beos.cache - ;; - *) echo "configure: cross-compiling for $host is not supported" >&2 - ;; - esac - if test -n "${cross_cache}" && test -r "${cross_cache}"; then - echo "loading cross-build cache file ${cross_cache}" - . ${cross_cache} - fi - unset cross_cache - CROSS_COMPILE='-DCROSS_COMPILING' - AC_SUBST(CROSS_COMPILE) -fi - -echo "" -echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}" -echo "" - -# We want these before the checks, so the checks can modify their values. -test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1 - -AC_PROG_MAKE_SET -AC_PROG_CC -dnl AC_AIX -AC_MINIX - -# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS. -test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" - -AC_PROG_GCC_TRADITIONAL -AC_PROG_INSTALL -AC_CHECK_PROG(AR, ar, , ar) -dnl Set default for ARFLAGS, since autoconf does not have a macro for it. -dnl This allows people to set it when running configure or make -test -n "$ARFLAGS" || ARFLAGS="cr" -AC_PROG_RANLIB - -MAKE_SHELL=/bin/sh -AC_SUBST(MAKE_SHELL) - -AC_C_CONST -AC_C_PROTOTYPES -AC_C_CHAR_UNSIGNED -AC_C_VOLATILE - -AC_TYPE_SIGNAL - -AC_TYPE_SIZE_T -AC_CHECK_TYPE(ssize_t, int) - -AC_HEADER_STDC - -AC_HEADER_STAT -AC_HEADER_DIRENT - -AC_CHECK_FUNCS(fcntl kill lstat) -AC_CHECK_FUNCS(memmove putenv select setenv setlocale \ - strcasecmp strpbrk tcgetattr vsnprintf) -AC_CHECK_FUNCS(isascii isxdigit) -AC_CHECK_FUNCS(getpwent getpwnam getpwuid) - -AC_FUNC_STRCOLL - -AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ - limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h) -AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h) - -AC_CHECK_HEADERS(sys/ptem.h,,, -[[ -#if HAVE_SYS_STREAM_H -# include -#endif -]]) - -AC_SYS_LARGEFILE - -BASH_SYS_SIGNAL_VINTAGE -BASH_SYS_REINSTALL_SIGHANDLERS - -BASH_FUNC_POSIX_SETJMP -BASH_FUNC_LSTAT -BASH_FUNC_STRCOLL -BASH_FUNC_CTYPE_NONASCII - -BASH_CHECK_GETPW_FUNCS - -AC_HEADER_TIOCGWINSZ - -BASH_TYPE_SIG_ATOMIC_T -BASH_TYPE_SIGHANDLER - -BASH_HAVE_TIOCSTAT -BASH_HAVE_FIONREAD -BASH_CHECK_SPEED_T -BASH_STRUCT_WINSIZE -BASH_STRUCT_DIRENT_D_INO -BASH_STRUCT_DIRENT_D_FILENO - -dnl yuck -case "$host_os" in -aix*) prefer_curses=yes ;; -esac -BASH_CHECK_LIB_TERMCAP -if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then - if test "$prefer_curses" = yes; then - TERMCAP_LIB=-lcurses - else - TERMCAP_LIB=-ltermcap #default - fi -fi - -BASH_CHECK_MULTIBYTE - -case "$host_cpu" in -*cray*) LOCAL_CFLAGS=-DCRAY ;; -*s390*) LOCAL_CFLAGS=-fsigned-char ;; -esac - -case "$host_os" in -isc*) LOCAL_CFLAGS=-Disc386 ;; -esac - -# shared library configuration section -# -# Shared object configuration section. These values are generated by -# ${srcdir}/support/shobj-conf -# -if test -f ${srcdir}/support/shobj-conf; then - AC_MSG_CHECKING(configuration for building shared libraries) - eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` - -# case "$SHLIB_LIBS" in -# *curses*|*termcap*|*termlib*) ;; -# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; -# esac - - AC_SUBST(SHOBJ_CC) - AC_SUBST(SHOBJ_CFLAGS) - AC_SUBST(SHOBJ_LD) - AC_SUBST(SHOBJ_LDFLAGS) - AC_SUBST(SHOBJ_XLDFLAGS) - AC_SUBST(SHOBJ_LIBS) - AC_SUBST(SHOBJ_STATUS) - AC_SUBST(SHLIB_STATUS) - AC_SUBST(SHLIB_XLDFLAGS) - AC_SUBST(SHLIB_DOT) - AC_SUBST(SHLIB_LIBPREF) - AC_SUBST(SHLIB_LIBSUFF) - AC_SUBST(SHLIB_LIBVERSION) - AC_SUBST(SHLIB_DLLVERSION) - AC_SUBST(SHLIB_LIBS) - AC_MSG_RESULT($SHLIB_STATUS) - - # SHLIB_STATUS is either `supported' or `unsupported'. If it's - # `unsupported', turn off any default shared library building - if test "$SHLIB_STATUS" = 'unsupported'; then - opt_shared_libs=no - fi - - # shared library versioning - # quoted for m4 so I can use character classes - SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`] - SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`] - AC_SUBST(SHLIB_MAJOR) - AC_SUBST(SHLIB_MINOR) -fi - -if test "$opt_static_libs" = "yes"; then - STATIC_TARGET=static - STATIC_INSTALL_TARGET=install-static -fi -if test "$opt_shared_libs" = "yes"; then - SHARED_TARGET=shared - SHARED_INSTALL_TARGET=install-shared -fi - -AC_SUBST(STATIC_TARGET) -AC_SUBST(SHARED_TARGET) -AC_SUBST(STATIC_INSTALL_TARGET) -AC_SUBST(SHARED_INSTALL_TARGET) - -case "$build_os" in -msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file -*) BUILD_DIR=`pwd` ;; -esac - -case "$BUILD_DIR" in -*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; -*) ;; -esac - -AC_SUBST(PURIFY) -AC_SUBST(BUILD_DIR) - -AC_SUBST(CFLAGS) -AC_SUBST(LOCAL_CFLAGS) -AC_SUBST(LOCAL_LDFLAGS) -AC_SUBST(LOCAL_DEFS) - -AC_SUBST(AR) -AC_SUBST(ARFLAGS) - -AC_SUBST(host_cpu) -AC_SUBST(host_os) - -AC_SUBST(LIBVERSION) - -AC_SUBST(TERMCAP_LIB) - -AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile], -[ -# Makefile uses this timestamp file to record whether config.h is up to date. -echo > stamp-h -]) diff --git a/readline/doc/ChangeLog.gdb b/readline/doc/ChangeLog.gdb index 5830e1b..f24e780 100644 --- a/readline/doc/ChangeLog.gdb +++ b/readline/doc/ChangeLog.gdb @@ -1,3 +1,8 @@ +2015-07-16 Micahel Darling + + PR binutils/18450 + * texi2html: Reflects renaming of configure.in to configure.ac + 2011-05-11 Jan Kratochvil * hsuser.texi (Using History Interactively): Disable !BashFeatures diff --git a/readline/doc/texi2html b/readline/doc/texi2html index 9f9c2eb..636d817 100755 --- a/readline/doc/texi2html +++ b/readline/doc/texi2html @@ -52,7 +52,7 @@ Maintained by: Olaf Bachmann Send bugs and suggestions to EOT -# Version: set in configure.in +# Version: set in configure.ac $THISVERSION = '1.64'; $THISPROG = "texi2html $THISVERSION"; # program name and version diff --git a/readline/examples/rlfe/ChangeLog b/readline/examples/rlfe/ChangeLog index ba41b2b..e1ce036 100644 --- a/readline/examples/rlfe/ChangeLog +++ b/readline/examples/rlfe/ChangeLog @@ -1,3 +1,9 @@ +2015-07-16 Michael Darling + + PR binutils/18450 + * Makefile.in: Reflects renaming of configure.in to configure.ac + * configure.ac: Renamed from configure.in + 2004-11-04 Per Bothner * pty.c: Import from screen-4.0.2. diff --git a/readline/examples/rlfe/Makefile.in b/readline/examples/rlfe/Makefile.in index 7d6fd53..702915c 100644 --- a/readline/examples/rlfe/Makefile.in +++ b/readline/examples/rlfe/Makefile.in @@ -43,7 +43,7 @@ SHELL=/bin/sh CFILES= rlfe.c pty.c HFILES= extern.h os.h screen.h -EXTRA_DIST=configure.in configure Makefile.in config.h.in ChangeLog README +EXTRA_DIST=configure.ac configure Makefile.in config.h.in ChangeLog README OFILES= rlfe.o pty.o all: rlfe @@ -175,7 +175,7 @@ Makefile makefile: config.status $(srcdir)/Makefile.in config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in +$(srcdir)/configure: $(srcdir)/configure.ac cd $(srcdir) && autoconf ############################################################################### diff --git a/readline/examples/rlfe/configure.ac b/readline/examples/rlfe/configure.ac new file mode 100644 index 0000000..108cd3f --- /dev/null +++ b/readline/examples/rlfe/configure.ac @@ -0,0 +1,442 @@ +dnl Process this file with autoconf to produce a configure script. + +m4_include([../../../config/override.m4]) + +AC_INIT(rlfe.c) +AC_CONFIG_HEADER(config.h) +VERSION=0.4 +AC_SUBST(VERSION) + +dnl +dnl Define some useful macros +dnl +AC_DEFUN([AC_PROGRAM_SOURCE], +[AC_REQUIRE([AC_PROG_CPP])AC_PROVIDE([$0])cat > conftest.c <&5 | sed -e '1,/_CUT_HERE_/d' -e 's/ //g' > conftest.out" +. ./conftest.out +rm -f conftest* +])dnl +dnl +define(AC_NOTE, +[echo "$1" 1>&AC_FD_MSG +])dnl + +old_CFLAGS="$CFLAGS" +AC_PROG_CC +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL +AC_ISC_POSIX + +AC_TRY_RUN(main(){exit(0);},,[ +if test $CC != cc ; then +AC_NOTE(Your $CC failed - restarting with CC=cc) +AC_NOTE() +CC=cc +export CC +exec $0 $configure_args +fi +]) + +AC_TRY_RUN(main(){exit(0);},, +exec 5>&2 +eval $ac_link +AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;) +AC_NOTE($ac_compile) +AC_MSG_ERROR(Can't run the compiler - sorry)) + +AC_TRY_RUN([ +main() +{ + int __something_strange_(); + __something_strange_(0); +} +],AC_MSG_ERROR(Your compiler does not set the exit status - sorry)) + +AC_PROG_AWK + +if test -f etc/toolcheck; then +AC_CHECKING(for buggy tools) +sh etc/toolcheck 1>&AC_FD_MSG +fi + +dnl +dnl **** special unix variants **** +dnl + +AC_CHECKING(for System V) +AC_TRY_COMPILE( +[#include +#include +#include ], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV)) + +AC_CHECKING(for Solaris 2.x) +AC_EGREP_CPP(yes, +[#if defined(SVR4) && defined(sun) + yes +#endif +], LIBS="$LIBS -lsocket -lnsl -lkstat") + +dnl +dnl **** select() **** +dnl + +AC_CHECKING(select) +AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, +LIBS="$LIBS -lnet -lnsl" +AC_CHECKING(select with $LIBS) +AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, +AC_MSG_ERROR(!!! no select - no screen)) +) +dnl +dnl **** check the select implementation **** +dnl + +AC_CHECKING(select return value) +AC_TRY_RUN([ +#include +#include +#include + +char *nam = "/tmp/conftest$$"; + +#ifdef NAMEDPIPE + +#ifndef O_NONBLOCK +#define O_NONBLOCK O_NDELAY +#endif +#ifndef S_IFIFO +#define S_IFIFO 0010000 +#endif + + +main() +{ +#ifdef FD_SET + fd_set f; +#else + int f; +#endif + +#ifdef __FreeBSD__ +/* From Andrew A. Chernov (ache@astral.msk.su): + * opening RDWR fifo fails in BSD 4.4, but select return values are + * right. + */ + exit(0); +#endif + (void)alarm(5); +#ifdef POSIX + if (mkfifo(nam, 0777)) +#else + if (mknod(nam, S_IFIFO|0777, 0)) +#endif + exit(1); + close(0); + if (open(nam, O_RDWR | O_NONBLOCK)) + exit(1); + if (write(0, "TEST", 4) == -1) + exit(1); + +#else + +#include +#include +#include + +main() +{ + int s1, s2, l; + struct sockaddr_un a; +#ifdef FD_SET + fd_set f; +#else + int f; +#endif + + (void)alarm(5); + if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) + exit(1); + a.sun_family = AF_UNIX; + strcpy(a.sun_path, nam); + (void) unlink(nam); + if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1) + exit(1); + if (listen(s1, 2)) + exit(1); + if (fork() == 0) + { + if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) + kill(getppid(), 3); + (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2); + if (write(s2, "HELLO", 5) == -1) + kill(getppid(), 3); + exit(0); + } + l = sizeof(a); + close(0); + if (accept(s1, (struct sockaddr *)&a, &l)) + exit(1); +#endif + + +#ifdef FD_SET + FD_SET(0, &f); +#else + f = 1; +#endif + if (select(1, &f, 0, 0, 0) == -1) + exit(1); + if (select(1, &f, &f, 0, 0) != 2) + exit(1); + exit(0); +} +],AC_NOTE(- select is ok), +AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN)) + +dnl +dnl **** termcap or terminfo **** +dnl +AC_CHECKING(for tgetent) +AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +olibs="$LIBS" +LIBS="-lcurses $olibs" +AC_CHECKING(libcurses) +AC_TRY_LINK(,[ +#ifdef __hpux +__sorry_hpux_libcurses_is_totally_broken_in_10_10(); +#else +tgetent((char *)0, (char *)0); +#endif +],, +LIBS="-ltermcap $olibs" +AC_CHECKING(libtermcap) +AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +LIBS="-ltermlib $olibs" +AC_CHECKING(libtermlib) +AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +LIBS="-lncurses $olibs" +AC_CHECKING(libncurses) +AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +AC_MSG_ERROR(!!! no tgetent - no screen)))))) + +AC_TRY_RUN([ +main() +{ + exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); +}], AC_NOTE(- you use the termcap database), +AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) +AC_CHECKING(ospeed) +AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) + +dnl +dnl **** PTY specific things **** +dnl +AC_CHECKING(for /dev/ptc) +if test -r /dev/ptc; then +AC_DEFINE(HAVE_DEV_PTC) +fi + +AC_CHECKING(for SVR4 ptys) +sysvr4ptys= +if test -c /dev/ptmx ; then +AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) +sysvr4ptys=1]) +fi + +AC_CHECK_FUNCS(getpt) + +dnl check for openpty() +if test -z "$sysvr4ptys"; then +AC_CHECK_FUNCS(openpty,, +[AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])]) +fi + +AC_CHECKING(for ptyranges) +if test -d /dev/ptym ; then +pdir='/dev/ptym' +else +pdir='/dev' +fi +dnl SCO uses ptyp%d +AC_EGREP_CPP(yes, +[#ifdef M_UNIX + yes; +#endif +], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`) +dnl if test -c /dev/ptyp19; then +dnl ptys=`echo /dev/ptyp??` +dnl else +dnl ptys=`echo $pdir/pty??` +dnl fi +if test "$ptys" != "$pdir/pty??" ; then +p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` +p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` +AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") +AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") +fi + +dnl **** pty mode/group handling **** +dnl +dnl support provided by Luke Mewburn , 931222 +AC_ARG_WITH(pty-mode, [ --with-pty-mode=mode default mode for ptys], [ ptymode="${withval}" ]) +AC_ARG_WITH(pty-group, [ --with-pty-group=group default group for ptys], [ ptygrp="${withval}" ]) +test -n "$ptymode" || ptymode=0620 +if test -n "$ptygrp" ; then +AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) +AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) +else + +AC_CHECKING(default tty permissions/group) +rm -f conftest_grp +AC_TRY_RUN([ +#include +#include +#include +main() +{ + struct stat sb; + char *x,*ttyname(); + int om, m; + FILE *fp; + + if (!(x = ttyname(0))) exit(1); + if (stat(x, &sb)) exit(1); + om = sb.st_mode; + if (om & 002) exit(0); + m = system("mesg y"); + if (m == -1 || m == 127) exit(1); + if (stat(x, &sb)) exit(1); + m = sb.st_mode; + if (chmod(x, om)) exit(1); + if (m & 002) exit(0); + if (sb.st_gid == getgid()) exit(1); + if (!(fp=fopen("conftest_grp", "w"))) + exit(1); + fprintf(fp, "%d\n", sb.st_gid); + fclose(fp); + exit(0); +} +],[ + if test -f conftest_grp; then + ptygrp=`cat conftest_grp` + AC_NOTE([- pty mode: $ptymode, group: $ptygrp]) + AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) + AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) + else + AC_NOTE(- ptys are world accessable) + fi +],[ + WRITEPATH='' + XTERMPATH='' + AC_PATH_PROG(WRITEPATH, write) + AC_PATH_PROG(XTERMPATH, xterm) + found= + if test -n "$WRITEPATH$XTERMPATH"; then + findfollow= + lsfollow= + found=`find $WRITEPATH $XTERMPATH -follow -print 2>/dev/null` + if test -n "$found"; then + findfollow=-follow + lsfollow=L + fi + if test -n "$XTERMPATH"; then + ptygrpn=`ls -l$lsfollow $XTERMPATH | sed -n -e 1p | $AWK '{print $4}'` + if test tty != "$ptygrpn"; then + XTERMPATH= + fi + fi + fi + if test -n "$WRITEPATH$XTERMPATH"; then + found=`find $WRITEPATH $XTERMPATH $findfollow -perm -2000 -print` + if test -n "$found"; then + ptygrp=`ls -ln$lsfollow $found | sed -n -e 1p | $AWK '{print $4}'` + AC_NOTE([- pty mode: $ptymode, group: $ptygrp]) + AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) + AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) + else + AC_NOTE(- ptys are world accessable) + fi + else + AC_NOTE(- can't determine - assume ptys are world accessable) + fi + ] +) +rm -f conftest_grp +fi + +dnl +dnl **** signal handling **** +dnl +if test -n "$posix" ; then + +dnl POSIX has reliable signals with void return type. +AC_NOTE(assuming posix signal definition) +AC_DEFINE(SIGVOID) + +else + +AC_CHECKING(return type of signal handlers) +AC_TRY_COMPILE( +[#include +#include +#ifdef signal +#undef signal +#endif +extern void (*signal ()) ();], [int i;], AC_DEFINE(SIGVOID)) +AC_CHECKING(sigset) +AC_TRY_LINK([ +#include +#include +],[ +#ifdef SIGVOID +sigset(0, (void (*)())0); +#else +sigset(0, (int (*)())0); +#endif +], AC_DEFINE(USESIGSET)) +AC_CHECKING(signal implementation) +AC_TRY_RUN([ +#include +#include + +#ifndef SIGCLD +#define SIGCLD SIGCHLD +#endif +#ifdef USESIGSET +#define signal sigset +#endif + +int got; + +#ifdef SIGVOID +void +#endif +hand() +{ + got++; +} + +main() +{ + /* on hpux we use sigvec to get bsd signals */ +#ifdef __hpux + (void)signal(SIGCLD, hand); + kill(getpid(), SIGCLD); + kill(getpid(), SIGCLD); + if (got < 2) + exit(1); +#endif + exit(0); +} +],,AC_DEFINE(SYSVSIGS)) + +fi + +AC_CHECK_HEADERS(sys/stropts.h sys/wait.h) + +AC_OUTPUT(Makefile) diff --git a/readline/examples/rlfe/configure.in b/readline/examples/rlfe/configure.in deleted file mode 100644 index 108cd3f..0000000 --- a/readline/examples/rlfe/configure.in +++ /dev/null @@ -1,442 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -m4_include([../../../config/override.m4]) - -AC_INIT(rlfe.c) -AC_CONFIG_HEADER(config.h) -VERSION=0.4 -AC_SUBST(VERSION) - -dnl -dnl Define some useful macros -dnl -AC_DEFUN([AC_PROGRAM_SOURCE], -[AC_REQUIRE([AC_PROG_CPP])AC_PROVIDE([$0])cat > conftest.c <&5 | sed -e '1,/_CUT_HERE_/d' -e 's/ //g' > conftest.out" -. ./conftest.out -rm -f conftest* -])dnl -dnl -define(AC_NOTE, -[echo "$1" 1>&AC_FD_MSG -])dnl - -old_CFLAGS="$CFLAGS" -AC_PROG_CC -AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL -AC_ISC_POSIX - -AC_TRY_RUN(main(){exit(0);},,[ -if test $CC != cc ; then -AC_NOTE(Your $CC failed - restarting with CC=cc) -AC_NOTE() -CC=cc -export CC -exec $0 $configure_args -fi -]) - -AC_TRY_RUN(main(){exit(0);},, -exec 5>&2 -eval $ac_link -AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;) -AC_NOTE($ac_compile) -AC_MSG_ERROR(Can't run the compiler - sorry)) - -AC_TRY_RUN([ -main() -{ - int __something_strange_(); - __something_strange_(0); -} -],AC_MSG_ERROR(Your compiler does not set the exit status - sorry)) - -AC_PROG_AWK - -if test -f etc/toolcheck; then -AC_CHECKING(for buggy tools) -sh etc/toolcheck 1>&AC_FD_MSG -fi - -dnl -dnl **** special unix variants **** -dnl - -AC_CHECKING(for System V) -AC_TRY_COMPILE( -[#include -#include -#include ], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV)) - -AC_CHECKING(for Solaris 2.x) -AC_EGREP_CPP(yes, -[#if defined(SVR4) && defined(sun) - yes -#endif -], LIBS="$LIBS -lsocket -lnsl -lkstat") - -dnl -dnl **** select() **** -dnl - -AC_CHECKING(select) -AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, -LIBS="$LIBS -lnet -lnsl" -AC_CHECKING(select with $LIBS) -AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, -AC_MSG_ERROR(!!! no select - no screen)) -) -dnl -dnl **** check the select implementation **** -dnl - -AC_CHECKING(select return value) -AC_TRY_RUN([ -#include -#include -#include - -char *nam = "/tmp/conftest$$"; - -#ifdef NAMEDPIPE - -#ifndef O_NONBLOCK -#define O_NONBLOCK O_NDELAY -#endif -#ifndef S_IFIFO -#define S_IFIFO 0010000 -#endif - - -main() -{ -#ifdef FD_SET - fd_set f; -#else - int f; -#endif - -#ifdef __FreeBSD__ -/* From Andrew A. Chernov (ache@astral.msk.su): - * opening RDWR fifo fails in BSD 4.4, but select return values are - * right. - */ - exit(0); -#endif - (void)alarm(5); -#ifdef POSIX - if (mkfifo(nam, 0777)) -#else - if (mknod(nam, S_IFIFO|0777, 0)) -#endif - exit(1); - close(0); - if (open(nam, O_RDWR | O_NONBLOCK)) - exit(1); - if (write(0, "TEST", 4) == -1) - exit(1); - -#else - -#include -#include -#include - -main() -{ - int s1, s2, l; - struct sockaddr_un a; -#ifdef FD_SET - fd_set f; -#else - int f; -#endif - - (void)alarm(5); - if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - exit(1); - a.sun_family = AF_UNIX; - strcpy(a.sun_path, nam); - (void) unlink(nam); - if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1) - exit(1); - if (listen(s1, 2)) - exit(1); - if (fork() == 0) - { - if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - kill(getppid(), 3); - (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2); - if (write(s2, "HELLO", 5) == -1) - kill(getppid(), 3); - exit(0); - } - l = sizeof(a); - close(0); - if (accept(s1, (struct sockaddr *)&a, &l)) - exit(1); -#endif - - -#ifdef FD_SET - FD_SET(0, &f); -#else - f = 1; -#endif - if (select(1, &f, 0, 0, 0) == -1) - exit(1); - if (select(1, &f, &f, 0, 0) != 2) - exit(1); - exit(0); -} -],AC_NOTE(- select is ok), -AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN)) - -dnl -dnl **** termcap or terminfo **** -dnl -AC_CHECKING(for tgetent) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, -olibs="$LIBS" -LIBS="-lcurses $olibs" -AC_CHECKING(libcurses) -AC_TRY_LINK(,[ -#ifdef __hpux -__sorry_hpux_libcurses_is_totally_broken_in_10_10(); -#else -tgetent((char *)0, (char *)0); -#endif -],, -LIBS="-ltermcap $olibs" -AC_CHECKING(libtermcap) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, -LIBS="-ltermlib $olibs" -AC_CHECKING(libtermlib) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, -LIBS="-lncurses $olibs" -AC_CHECKING(libncurses) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, -AC_MSG_ERROR(!!! no tgetent - no screen)))))) - -AC_TRY_RUN([ -main() -{ - exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); -}], AC_NOTE(- you use the termcap database), -AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) -AC_CHECKING(ospeed) -AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) - -dnl -dnl **** PTY specific things **** -dnl -AC_CHECKING(for /dev/ptc) -if test -r /dev/ptc; then -AC_DEFINE(HAVE_DEV_PTC) -fi - -AC_CHECKING(for SVR4 ptys) -sysvr4ptys= -if test -c /dev/ptmx ; then -AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) -sysvr4ptys=1]) -fi - -AC_CHECK_FUNCS(getpt) - -dnl check for openpty() -if test -z "$sysvr4ptys"; then -AC_CHECK_FUNCS(openpty,, -[AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])]) -fi - -AC_CHECKING(for ptyranges) -if test -d /dev/ptym ; then -pdir='/dev/ptym' -else -pdir='/dev' -fi -dnl SCO uses ptyp%d -AC_EGREP_CPP(yes, -[#ifdef M_UNIX - yes; -#endif -], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`) -dnl if test -c /dev/ptyp19; then -dnl ptys=`echo /dev/ptyp??` -dnl else -dnl ptys=`echo $pdir/pty??` -dnl fi -if test "$ptys" != "$pdir/pty??" ; then -p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'` -p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'` -AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0") -AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1") -fi - -dnl **** pty mode/group handling **** -dnl -dnl support provided by Luke Mewburn , 931222 -AC_ARG_WITH(pty-mode, [ --with-pty-mode=mode default mode for ptys], [ ptymode="${withval}" ]) -AC_ARG_WITH(pty-group, [ --with-pty-group=group default group for ptys], [ ptygrp="${withval}" ]) -test -n "$ptymode" || ptymode=0620 -if test -n "$ptygrp" ; then -AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) -AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) -else - -AC_CHECKING(default tty permissions/group) -rm -f conftest_grp -AC_TRY_RUN([ -#include -#include -#include -main() -{ - struct stat sb; - char *x,*ttyname(); - int om, m; - FILE *fp; - - if (!(x = ttyname(0))) exit(1); - if (stat(x, &sb)) exit(1); - om = sb.st_mode; - if (om & 002) exit(0); - m = system("mesg y"); - if (m == -1 || m == 127) exit(1); - if (stat(x, &sb)) exit(1); - m = sb.st_mode; - if (chmod(x, om)) exit(1); - if (m & 002) exit(0); - if (sb.st_gid == getgid()) exit(1); - if (!(fp=fopen("conftest_grp", "w"))) - exit(1); - fprintf(fp, "%d\n", sb.st_gid); - fclose(fp); - exit(0); -} -],[ - if test -f conftest_grp; then - ptygrp=`cat conftest_grp` - AC_NOTE([- pty mode: $ptymode, group: $ptygrp]) - AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) - AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) - else - AC_NOTE(- ptys are world accessable) - fi -],[ - WRITEPATH='' - XTERMPATH='' - AC_PATH_PROG(WRITEPATH, write) - AC_PATH_PROG(XTERMPATH, xterm) - found= - if test -n "$WRITEPATH$XTERMPATH"; then - findfollow= - lsfollow= - found=`find $WRITEPATH $XTERMPATH -follow -print 2>/dev/null` - if test -n "$found"; then - findfollow=-follow - lsfollow=L - fi - if test -n "$XTERMPATH"; then - ptygrpn=`ls -l$lsfollow $XTERMPATH | sed -n -e 1p | $AWK '{print $4}'` - if test tty != "$ptygrpn"; then - XTERMPATH= - fi - fi - fi - if test -n "$WRITEPATH$XTERMPATH"; then - found=`find $WRITEPATH $XTERMPATH $findfollow -perm -2000 -print` - if test -n "$found"; then - ptygrp=`ls -ln$lsfollow $found | sed -n -e 1p | $AWK '{print $4}'` - AC_NOTE([- pty mode: $ptymode, group: $ptygrp]) - AC_DEFINE_UNQUOTED(PTYMODE, $ptymode) - AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp) - else - AC_NOTE(- ptys are world accessable) - fi - else - AC_NOTE(- can't determine - assume ptys are world accessable) - fi - ] -) -rm -f conftest_grp -fi - -dnl -dnl **** signal handling **** -dnl -if test -n "$posix" ; then - -dnl POSIX has reliable signals with void return type. -AC_NOTE(assuming posix signal definition) -AC_DEFINE(SIGVOID) - -else - -AC_CHECKING(return type of signal handlers) -AC_TRY_COMPILE( -[#include -#include -#ifdef signal -#undef signal -#endif -extern void (*signal ()) ();], [int i;], AC_DEFINE(SIGVOID)) -AC_CHECKING(sigset) -AC_TRY_LINK([ -#include -#include -],[ -#ifdef SIGVOID -sigset(0, (void (*)())0); -#else -sigset(0, (int (*)())0); -#endif -], AC_DEFINE(USESIGSET)) -AC_CHECKING(signal implementation) -AC_TRY_RUN([ -#include -#include - -#ifndef SIGCLD -#define SIGCLD SIGCHLD -#endif -#ifdef USESIGSET -#define signal sigset -#endif - -int got; - -#ifdef SIGVOID -void -#endif -hand() -{ - got++; -} - -main() -{ - /* on hpux we use sigvec to get bsd signals */ -#ifdef __hpux - (void)signal(SIGCLD, hand); - kill(getpid(), SIGCLD); - kill(getpid(), SIGCLD); - if (got < 2) - exit(1); -#endif - exit(0); -} -],,AC_DEFINE(SYSVSIGS)) - -fi - -AC_CHECK_HEADERS(sys/stropts.h sys/wait.h) - -AC_OUTPUT(Makefile) -- 2.4.4