Check-in [f61c58e424]
Not logged in
Overview
SHA1:f61c58e4243a1769dcabdc8d2a628792a79c6cc1
Date: 2014-02-19 00:07:34
User: quentin@minster.io
Comment:Apply the Gentoo patchset Gentoo ebuild: dev-tcltk/tclreadline-2.1.0-r4 Fully applied patches: * direct sed patches from the ebuild * tclreadline-2.1.0-gold.patch * tclreadline-2.1.0-rl-executing-macro.patch * tclreadline-2.1.0-rl-history-expand.patch * tclreadline-2.1.0-rl-prompt.patch Partially applied patches: * tclreadline-2.1.0-alloc-free.patch
Timelines: family | ancestors | descendants | both | trunk | origin/devel
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-02-26
00:38
[5f3ab55c4a] Harmonize file headers, indent and whitespace in all files (user: quentin@minster.io, tags: trunk, origin/devel)
2014-02-19
00:07
[f61c58e424] Apply the Gentoo patchset Gentoo ebuild: dev-tcltk/tclreadline-2.1.0-r4 Fully applied patches: * direct sed patches from the ebuild * tclreadline-2.1.0-gold.patch * tclreadline-2.1.0-rl-executing-macro.patch * tclreadline-2.1.0-rl-history-expand.patch * tclreadline-2.1.0-rl-prompt.patch Partially applied patches: * tclreadline-2.1.0-alloc-free.patch (user: quentin@minster.io, tags: trunk, origin/devel)
2014-02-18
23:09
[41d16f099d] Apply the Debian patchset Debian source package: tcl-tclreadline 2.1.0-12 Fully applied patches: * complete_nontcl.patch * completion_matches.patch * completion_pbug.patch * memuse.patch * tclshpath.patch * varnames.patch Partially applied patches: * manpage.patch * tinfo.patch Dropped patches: * kfreebsd.patch * link.patch * tclrldir.patch (user: quentin@minster.io, tags: trunk, origin/devel)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified Makefile.am from [9010d007ac] to [e10a890a98].

    16     16   
    17     17   libtclreadline_la_SOURCES = config.h tclreadline.c tclreadline.h
    18     18   include_HEADERS = tclreadline.h
    19     19   
    20     20   INCLUDES = -I$(TCL_INCLUDE_DIR) -I$(READLINE_INCLUDE_DIR)
    21     21   
    22     22   ## libtclreadline_la_LIBADD = $(LIBS)
           23  +libtclreadline_la_LIBADD = $(TCL_LIB_SPEC) -lreadline
    23     24   libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
    24     25   
    25     26   tclrldir = @TCLRL_DIR@
    26     27   tclrl_SCRIPTS = pkgIndex.tcl tclreadlineCompleter.tcl tclreadlineInit.tcl tclreadlineSetup.tcl
    27     28   INSTALL_SCRIPT = ${INSTALL_DATA}
    28     29   
    29     30   EXTRA_DIST =                 \

Added configure.ac version [84c8e6ef95].

            1  +dnl -*- autoconf -*-
            2  +dnl FILE: "/home/joze/src/tclreadline/configure.in"
            3  +dnl LAST MODIFICATION: "Mit, 10 Jan 2001 06:26:43 +0100 (joze)"
            4  +dnl (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
            5  +dnl $Id$
            6  +dnl ---
            7  +dnl tclreadline -- gnu readline for tcl
            8  +dnl http://www.zellner.org/tclreadline/
            9  +dnl Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
           10  +dnl This software is copyright under the BSD license.
           11  +
           12  +AC_INIT(tclreadline.c)
           13  +AC_CONFIG_HEADERS(config.h)
           14  +AC_PREREQ(2.13)
           15  +AC_REVISION($Revision$)
           16  +AC_CONFIG_AUX_DIR(./aux)
           17  +
           18  +MAJOR=2
           19  +MINOR=1
           20  +PATCHLEVEL=1
           21  +VERSION=$MAJOR.$MINOR
           22  +PATCHLEVEL_STR=$VERSION.$PATCHLEVEL
           23  +
           24  +AC_SUBST(MAJOR)
           25  +AC_SUBST(MINOR)
           26  +AC_SUBST(PATCHLEVEL)
           27  +AC_SUBST(VERSION)
           28  +AC_SUBST(PATCHLEVEL_STR)
           29  +
           30  +AM_INIT_AUTOMAKE(tclreadline, $PATCHLEVEL_STR)
           31  +
           32  +
           33  +AC_PROG_MAKE_SET
           34  +
           35  +dnl AM_INIT_AUTOMAKE(tclreadline, $VERSION)
           36  +
           37  +AC_CANONICAL_HOST
           38  +AC_PROG_CC
           39  +AC_EXEEXT
           40  +dnl AC_LIBTOOL_DLOPEN
           41  +AM_PROG_LIBTOOL
           42  +AC_SUBST(LIBTOOL_DEPS)
           43  +
           44  +AC_C_CONST
           45  +AC_PROG_INSTALL
           46  +AC_PROG_RANLIB
           47  +AC_PROG_LN_S
           48  +
           49  +
           50  +# -- WHICH TCL TO USE
           51  +AC_ARG_WITH(
           52  +    tcl,
           53  +    [  --with-tcl=DIR          where to look for tclConfig.sh],
           54  +    tcl_search=$withval,
           55  +    tcl_search=""
           56  +)
           57  +
           58  +AC_MSG_CHECKING([which tclConfig.sh to use])
           59  +TCL_LIB_DIR=""
           60  +for dir in $tcl_search /usr/lib /usr/local/lib $exec_prefix/lib /usr/local/lib/unix /opt/tcl/lib; do
           61  +    if test -r $dir/tclConfig.sh; then
           62  +        TCL_LIB_DIR=$dir
           63  +        break
           64  +    fi
           65  +done
           66  +
           67  +if test -z "$TCL_LIB_DIR"; then
           68  +    AC_MSG_ERROR(Can't find Tcl libraries.  Use --with-tcl to specify the directory containing tclConfig.sh on your system.)
           69  +fi
           70  +
           71  +. $TCL_LIB_DIR/tclConfig.sh
           72  +AC_MSG_RESULT($TCL_LIB_DIR/tclConfig.sh)
           73  +AC_MSG_CHECKING([for your tcl version])
           74  +AC_MSG_RESULT([$TCL_VERSION, patchlevel $TCL_PATCH_LEVEL])
           75  +
           76  +# Check, if tcl_version is > 8.0
           77  +if test $TCL_MAJOR_VERSION -lt 8; then
           78  +    AC_MSG_ERROR(need tcl 8.0 or higher.)
           79  +fi
           80  +
           81  +
           82  +# -----------------------------------------------------------------------
           83  +#   Set up a new default --prefix.
           84  +# -----------------------------------------------------------------------
           85  +
           86  +# this is the default anyway:
           87  +# AC_PREFIX_DEFAULT(/usr/local)
           88  +
           89  +if test "${prefix}" = "NONE"; then
           90  +    prefix=$TCL_PREFIX
           91  +fi
           92  +TCLRL_LIBDIR="${prefix}/lib"
           93  +AC_SUBST(TCLRL_LIBDIR)
           94  +TCLRL_DIR="${TCLRL_LIBDIR}/tclreadline$VERSION"
           95  +AC_SUBST(TCLRL_DIR)
           96  +
           97  +# HEADERS
           98  +AC_HEADER_STDC
           99  +AC_CHECK_HEADERS(string.h)
          100  +
          101  +#--------------------------------------------------------------------
          102  +#   Check for tcl.h
          103  +#--------------------------------------------------------------------
          104  +
          105  +AC_ARG_WITH(tcl-includes,
          106  +            [  --with-tcl-includes=DIR where to look for tcl.h],
          107  +            tcl_includes=$withval, tcl_includes=$prefix/include)
          108  +
          109  +AC_MSG_CHECKING([where to look for tcl.h])
          110  +TCL_INCLUDE_DIR=""
          111  +for dir in $tcl_includes $prefix/include/ /usr/include; do
          112  +    if test -r $dir/tcl.h; then
          113  +        TCL_INCLUDE_DIR=$dir
          114  +        break
          115  +    fi
          116  +done
          117  +
          118  +if test -z "$TCL_INCLUDE_DIR"; then
          119  +    AC_MSG_ERROR([
          120  +  Can't find tcl.h.  Use --with-tcl-includes to specify the directory
          121  +  containing tcl.h on your system.])
          122  +else
          123  +    AC_MSG_RESULT($TCL_INCLUDE_DIR/tcl.h)
          124  +fi
          125  +#--------------------------------------------------------------------
          126  +#   Check for readline.h
          127  +#--------------------------------------------------------------------
          128  +
          129  +AC_ARG_WITH(readline-includes,
          130  +            [  --with-readline-includes=DIR readline include files in DIR],
          131  +            rl_includes=$withval, rl_includes="")
          132  +
          133  +dnl look for readline/readline.h
          134  +dnl          ^^^^^^^^
          135  +AC_MSG_CHECKING([where to look for readline.h])
          136  +READLINE_INCLUDE_DIR=""
          137  +for dir in $rl_includes /usr/local/include /usr/include ; do
          138  +    if test -r $dir/readline/readline.h; then
          139  +        READLINE_INCLUDE_DIR=$dir
          140  +        break
          141  +    fi
          142  +done
          143  +
          144  +dnl look directly in the include dirs for readline.h
          145  +if test -z "$READLINE_INCLUDE_DIR"; then
          146  +    for dir in $rl_includes /usr/local/include /usr/include ; do
          147  +	if test -r $dir/readline.h; then
          148  +	    READLINE_INCLUDE_DIR=$dir
          149  +	    AC_DEFINE_UNQUOTED(READLINE_LIBRARY, 1, [ Define if we have libreadline. ])
          150  +	    break
          151  +	fi
          152  +    done
          153  +fi
          154  +
          155  +if test -z "$READLINE_INCLUDE_DIR"; then
          156  +    AC_MSG_ERROR([
          157  +  Can't find readline.h.
          158  +  Use --with-readline-includes to specify the directory
          159  +  containing readline.h on your system.])
          160  +fi
          161  +
          162  +AC_ARG_WITH(readline-library,
          163  +    [  --with-readline-library=DIR
          164  +		  lib spec to readline (e.g. '-L/usr/local/lib -lreadline')],
          165  +    LIBS="$LIBS $withval",
          166  +    AC_SEARCH_LIBS(rl_callback_read_char, readline, ,
          167  +		AC_MSG_RESULT([
          168  +			Your readline version does not support readline's alternate interface.
          169  +			Please upgrade to readline >= 2.2 and retry.
          170  +		])
          171  +		exit
          172  +    )
          173  +)
          174  +
          175  +
          176  +
          177  +# check for readline's rl_executing_macro
          178  +# (could be macro.c's private variable _rl_executing_macro).
          179  +
          180  +AC_CHECK_DECL(rl_executing_macro
          181  +, AC_DEFINE(EXECUTING_MACRO_NAME, rl_executing_macro,
          182  +  [ Define the name of the executing macro variable in libreadline. ])
          183  +, AC_MSG_CHECKING([for _rl_executing_macro in -lreadline])
          184  +  AC_TRY_LINK(,[
          185  +    extern char* _rl_executing_macro;
          186  +    _rl_executing_macro = (char*) 0;
          187  +  ]
          188  +  , AC_MSG_RESULT(yes)
          189  +    AC_DEFINE(EXECUTING_MACRO_HACK, 1,
          190  +    [ Define if EXECUTING_MACRO_NAME is resolved in libreadline. ])
          191  +    AC_DEFINE(EXECUTING_MACRO_NAME, _rl_executing_macro,
          192  +    [ Define the name of the executing macro variable in libreadline. ])
          193  +  , AC_MSG_RESULT(no))
          194  +, [AC_INCLUDES_DEFAULT
          195  +#include "$READLINE_INCLUDE_DIR/readline.h"])
          196  +
          197  +# check for readline's rl_cleanup_after_signal
          198  +
          199  +AC_MSG_CHECKING([for rl_cleanup_after_signal() in -lreadline])
          200  +AC_TRY_LINK(,[
          201  +    extern void rl_cleanup_after_signal();
          202  +    rl_cleanup_after_signal();
          203  +],
          204  +    AC_MSG_RESULT(yes);
          205  +    AC_DEFINE(CLEANUP_AFER_SIGNAL, 1,
          206  +    [ Define if rl_cleanup_after_signal is resolved in libreadline. ]),
          207  +    AC_MSG_RESULT(no))
          208  +
          209  +
          210  +AC_MSG_CHECKING([for the readline version number])
          211  +AC_TRY_RUN([
          212  +#include <stdio.h>
          213  +int main () {
          214  +    FILE *fp = fopen("conftestversion", "w");
          215  +    extern char *rl_library_version;
          216  +    fprintf(fp, "%s", rl_library_version);
          217  +    close(fp);
          218  +    return 0;
          219  +}],
          220  +    READLINE_VERSION=`cat conftestversion`
          221  +    AC_MSG_RESULT($READLINE_VERSION),
          222  +    AC_MSG_RESULT(failed),
          223  +    AC_MSG_RESULT(no cross compiling)
          224  +)
          225  +
          226  +
          227  +AC_ARG_ENABLE(tclshrl,
          228  +    [  --enable-tclshrl        build statically linked tclshrl],
          229  +    [dnl action if given
          230  +	case "${enableval}" in
          231  +	    yes) enable_static=true ;;
          232  +	    no)  enable_static=false ;;
          233  +	    *)   AC_MSG_ERROR(bad value ${enableval} for --enable-static) ;;
          234  +	esac
          235  +    ],
          236  +    [dnl action if not given
          237  +	enable_static=false
          238  +    ]
          239  +)
          240  +AM_CONDITIONAL(STATIC_TCLSHRL, test x$enable_static = xtrue)
          241  +
          242  +AC_ARG_ENABLE(wishrl,
          243  +    [  --enable-wishrl         build statically linked wishrl],
          244  +    [dnl action if given
          245  +	case "${enableval}" in
          246  +	    yes)
          247  +		enable_static=true
          248  +		dnl source the tkConfig.sh which defines TK_LIB_SPEC
          249  +		. $TCL_LIB_DIR/tkConfig.sh
          250  +		AC_SUBST(TK_LIB_SPEC)
          251  +	    ;;
          252  +	    no)  enable_static=false ;;
          253  +	    *)   AC_MSG_ERROR(bad value ${enableval} for --enable-static) ;;
          254  +	esac
          255  +    ],
          256  +    [dnl action if not given
          257  +	enable_static=false
          258  +    ]
          259  +)
          260  +AM_CONDITIONAL(STATIC_WISHRL, test x$enable_static = xtrue)
          261  +
          262  +
          263  +AC_SUBST(TCL_INCLUDE_DIR)
          264  +AC_SUBST(TCL_LIB_SPEC)
          265  +AC_SUBST(READLINE_INCLUDE_DIR)
          266  +AC_OUTPUT(Makefile tclreadline.h tclreadlineInit.tcl tclreadlineSetup.tcl tclreadline.n pkgIndex.tcl)

Deleted configure.in version [72c6a348ad].

     1         -dnl -*- autoconf -*-
     2         -dnl FILE: "/home/joze/src/tclreadline/configure.in"
     3         -dnl LAST MODIFICATION: "Mit, 10 Jan 2001 06:26:43 +0100 (joze)"
     4         -dnl (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
     5         -dnl $Id$
     6         -dnl ---
     7         -dnl tclreadline -- gnu readline for tcl
     8         -dnl http://www.zellner.org/tclreadline/
     9         -dnl Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
    10         -dnl This software is copyright under the BSD license.
    11         -
    12         -AC_INIT(tclreadline.c)
    13         -AM_CONFIG_HEADER(config.h)
    14         -AC_PREREQ(2.13)
    15         -AC_REVISION($Revision$)
    16         -AC_CONFIG_AUX_DIR(./aux)
    17         -
    18         -MAJOR=2
    19         -MINOR=1
    20         -PATCHLEVEL=1
    21         -VERSION=$MAJOR.$MINOR
    22         -PATCHLEVEL_STR=$VERSION.$PATCHLEVEL
    23         -
    24         -AC_SUBST(MAJOR)
    25         -AC_SUBST(MINOR)
    26         -AC_SUBST(PATCHLEVEL)
    27         -AC_SUBST(VERSION)
    28         -AC_SUBST(PATCHLEVEL_STR)
    29         -
    30         -AM_INIT_AUTOMAKE(tclreadline, $PATCHLEVEL_STR)
    31         -
    32         -
    33         -AC_PROG_MAKE_SET
    34         -
    35         -dnl AM_INIT_AUTOMAKE(tclreadline, $VERSION)
    36         -
    37         -AC_CANONICAL_HOST
    38         -AC_PROG_CC
    39         -AC_EXEEXT
    40         -dnl AC_LIBTOOL_DLOPEN
    41         -AM_PROG_LIBTOOL
    42         -AC_SUBST(LIBTOOL_DEPS)
    43         -
    44         -AC_C_CONST
    45         -AC_PROG_INSTALL
    46         -AC_PROG_RANLIB
    47         -AC_PROG_LN_S
    48         -
    49         -
    50         -# -- WHICH TCL TO USE
    51         -AC_ARG_WITH(
    52         -    tcl,
    53         -    [  --with-tcl=DIR          where to look for tclConfig.sh],
    54         -    tcl_search=$withval,
    55         -    tcl_search=""
    56         -)
    57         -
    58         -AC_MSG_CHECKING([which tclConfig.sh to use])
    59         -TCL_LIB_DIR=""
    60         -for dir in $tcl_search /usr/lib /usr/local/lib $exec_prefix/lib /usr/local/lib/unix /opt/tcl/lib; do
    61         -    if test -r $dir/tclConfig.sh; then
    62         -        TCL_LIB_DIR=$dir
    63         -        break
    64         -    fi
    65         -done
    66         -
    67         -if test -z "$TCL_LIB_DIR"; then
    68         -    AC_MSG_ERROR(Can't find Tcl libraries.  Use --with-tcl to specify the directory containing tclConfig.sh on your system.)
    69         -fi
    70         -
    71         -. $TCL_LIB_DIR/tclConfig.sh
    72         -AC_MSG_RESULT($TCL_LIB_DIR/tclConfig.sh)
    73         -AC_MSG_CHECKING([for your tcl version])
    74         -AC_MSG_RESULT([$TCL_VERSION, patchlevel $TCL_PATCH_LEVEL])
    75         -
    76         -# Check, if tcl_version is > 8.0
    77         -if test $TCL_MAJOR_VERSION -lt 8; then
    78         -    AC_MSG_ERROR(need tcl 8.0 or higher.)
    79         -fi
    80         -
    81         -
    82         -# -----------------------------------------------------------------------
    83         -#   Set up a new default --prefix.
    84         -# -----------------------------------------------------------------------
    85         -
    86         -# this is the default anyway:
    87         -# AC_PREFIX_DEFAULT(/usr/local)
    88         -
    89         -if test "${prefix}" = "NONE"; then
    90         -    prefix=$TCL_PREFIX
    91         -fi
    92         -TCLRL_LIBDIR="${prefix}/lib"
    93         -AC_SUBST(TCLRL_LIBDIR)
    94         -TCLRL_DIR="${TCLRL_LIBDIR}/tclreadline$VERSION"
    95         -AC_SUBST(TCLRL_DIR)
    96         -
    97         -# HEADERS
    98         -AC_HEADER_STDC
    99         -AC_CHECK_HEADERS(string.h)
   100         -
   101         -#--------------------------------------------------------------------
   102         -#   Check for tcl.h
   103         -#--------------------------------------------------------------------
   104         -
   105         -AC_ARG_WITH(tcl-includes,
   106         -            [  --with-tcl-includes=DIR where to look for tcl.h],
   107         -            tcl_includes=$withval, tcl_includes=$prefix/include)
   108         -
   109         -AC_MSG_CHECKING([where to look for tcl.h])
   110         -TCL_INCLUDE_DIR=""
   111         -for dir in $tcl_includes $prefix/include/ /usr/include; do
   112         -    if test -r $dir/tcl.h; then
   113         -        TCL_INCLUDE_DIR=$dir
   114         -        break
   115         -    fi
   116         -done
   117         -
   118         -if test -z "$TCL_INCLUDE_DIR"; then
   119         -    AC_MSG_ERROR([
   120         -  Can't find tcl.h.  Use --with-tcl-includes to specify the directory
   121         -  containing tcl.h on your system.])
   122         -else
   123         -    AC_MSG_RESULT($TCL_INCLUDE_DIR/tcl.h)
   124         -fi
   125         -#--------------------------------------------------------------------
   126         -#   Check for readline.h
   127         -#--------------------------------------------------------------------
   128         -
   129         -AC_ARG_WITH(readline-includes,
   130         -            [  --with-readline-includes=DIR readline include files in DIR],
   131         -            rl_includes=$withval, rl_includes="")
   132         -
   133         -dnl look for readline/readline.h
   134         -dnl          ^^^^^^^^
   135         -AC_MSG_CHECKING([where to look for readline.h])
   136         -READLINE_INCLUDE_DIR=""
   137         -for dir in $rl_includes /usr/local/include /usr/include ; do
   138         -    if test -r $dir/readline/readline.h; then
   139         -        READLINE_INCLUDE_DIR=$dir
   140         -        break
   141         -    fi
   142         -done
   143         -
   144         -dnl look directly in the include dirs for readline.h
   145         -if test -z "$READLINE_INCLUDE_DIR"; then
   146         -    for dir in $rl_includes /usr/local/include /usr/include ; do
   147         -	if test -r $dir/readline.h; then
   148         -	    READLINE_INCLUDE_DIR=$dir
   149         -	    AC_DEFINE_UNQUOTED(READLINE_LIBRARY, 1, [ Define if we have libreadline. ])
   150         -	    break
   151         -	fi
   152         -    done
   153         -fi
   154         -
   155         -if test -z "$READLINE_INCLUDE_DIR"; then
   156         -    AC_MSG_ERROR([
   157         -  Can't find readline.h.
   158         -  Use --with-readline-includes to specify the directory
   159         -  containing readline.h on your system.])
   160         -fi
   161         -
   162         -AC_ARG_WITH(readline-library,
   163         -    [  --with-readline-library=DIR
   164         -		  lib spec to readline (e.g. '-L/usr/local/lib -lreadline')],
   165         -    LIBS="$LIBS $withval",
   166         -    AC_CHECK_LIB(readline, rl_callback_read_char, ,
   167         -	AC_MSG_RESULT([
   168         -	    Your readline version does not support readline's alternate interface.
   169         -	    Please upgrade to readline >= 2.2 and retry.
   170         -	])
   171         -	exit
   172         -    )
   173         -)
   174         -
   175         -
   176         -
   177         -# check for readline's (macro.c) private variable
   178         -# _rl_executing_macro.
   179         -
   180         -AC_MSG_CHECKING([for _rl_executing_macro in -lreadline])
   181         -AC_TRY_LINK(,[
   182         -    extern char* _rl_executing_macro;
   183         -    _rl_executing_macro = (char*) 0;
   184         -],
   185         -    AC_MSG_RESULT(yes);
   186         -    AC_DEFINE(EXECUTING_MACRO_HACK, 1,
   187         -    [ Define if _rl_executing_macro is resolved in libreadline. ]),
   188         -    AC_MSG_RESULT(no))
   189         -
   190         -# check for readline's rl_cleanup_after_signal
   191         -
   192         -AC_MSG_CHECKING([for rl_cleanup_after_signal() in -lreadline])
   193         -AC_TRY_LINK(,[
   194         -    extern void rl_cleanup_after_signal();
   195         -    rl_cleanup_after_signal();
   196         -],
   197         -    AC_MSG_RESULT(yes);
   198         -    AC_DEFINE(CLEANUP_AFER_SIGNAL, 1,
   199         -    [ Define if rl_cleanup_after_signal is resolved in libreadline. ]),
   200         -    AC_MSG_RESULT(no))
   201         -
   202         -
   203         -AC_MSG_CHECKING([for the readline version number])
   204         -AC_TRY_RUN([
   205         -#include <stdio.h>
   206         -int main () {
   207         -    FILE *fp = fopen("conftestversion", "w");
   208         -    extern char *rl_library_version;
   209         -    fprintf(fp, "%s", rl_library_version);
   210         -    close(fp);
   211         -    return 0;
   212         -}],
   213         -    READLINE_VERSION=`cat conftestversion`
   214         -    AC_MSG_RESULT($READLINE_VERSION),
   215         -    AC_MSG_RESULT(failed),
   216         -    AC_MSG_RESULT(no cross compiling)
   217         -)
   218         -
   219         -
   220         -AC_ARG_ENABLE(tclshrl,
   221         -    [  --enable-tclshrl        build statically linked tclshrl],
   222         -    [dnl action if given
   223         -	case "${enableval}" in
   224         -	    yes) enable_static=true ;;
   225         -	    no)  enable_static=false ;;
   226         -	    *)   AC_MSG_ERROR(bad value ${enableval} for --enable-static) ;;
   227         -	esac
   228         -    ],
   229         -    [dnl action if not given
   230         -	enable_static=false
   231         -    ]
   232         -)
   233         -AM_CONDITIONAL(STATIC_TCLSHRL, test x$enable_static = xtrue)
   234         -
   235         -AC_ARG_ENABLE(wishrl,
   236         -    [  --enable-wishrl         build statically linked wishrl],
   237         -    [dnl action if given
   238         -	case "${enableval}" in
   239         -	    yes)
   240         -		enable_static=true
   241         -		dnl source the tkConfig.sh which defines TK_LIB_SPEC
   242         -		. $TCL_LIB_DIR/tkConfig.sh
   243         -		AC_SUBST(TK_LIB_SPEC)
   244         -	    ;;
   245         -	    no)  enable_static=false ;;
   246         -	    *)   AC_MSG_ERROR(bad value ${enableval} for --enable-static) ;;
   247         -	esac
   248         -    ],
   249         -    [dnl action if not given
   250         -	enable_static=false
   251         -    ]
   252         -)
   253         -AM_CONDITIONAL(STATIC_WISHRL, test x$enable_static = xtrue)
   254         -
   255         -
   256         -AC_SUBST(TCL_INCLUDE_DIR)
   257         -AC_SUBST(TCL_LIB_SPEC)
   258         -AC_SUBST(READLINE_INCLUDE_DIR)
   259         -AC_OUTPUT(Makefile tclreadline.h tclreadlineInit.tcl tclreadlineSetup.tcl tclreadline.n pkgIndex.tcl)

Modified tclreadline.c from [8df3bd02ad] to [fb738417f9].

    37     37   
    38     38   #ifdef EXECUTING_MACRO_HACK
    39     39   /**
    40     40    * this prototype is private in readline's file `macro.c'.
    41     41    * We need it here to decide, if we should read more
    42     42    * characters from a macro. Dirty, but it should work.
    43     43    */
    44         -extern char* _rl_executing_macro;
           44  +extern char* EXECUTING_MACRO_NAME;
    45     45   #endif
    46     46   
    47     47   #include "tclreadline.h"
    48     48   static const char* tclrl_library = TCLRL_LIBRARY;
    49     49   static const char* tclrl_version_str = TCLRL_VERSION_STR;
    50     50   static const char* tclrl_patchlevel_str = TCLRL_PATCHLEVEL_STR;
    51     51   
................................................................................
   230    230   
   231    231       switch (obj_idx) {
   232    232   
   233    233   	case TCLRL_READ:
   234    234   
   235    235   	    rl_callback_handler_install(
   236    236   			       objc == 3 ? Tcl_GetStringFromObj(objv[2], 0)
   237         -			       : "%", TclReadlineLineCompleteHandler);
          237  +			       : "% ", TclReadlineLineCompleteHandler);
   238    238   
   239    239   	    Tcl_CreateFileHandler(0, TCL_READABLE,
   240    240   		TclReadlineReadHandler, (ClientData) NULL);
   241    241   
   242    242   	    /**
   243    243   	     * Main Loop.
   244    244   	     * XXX each modification of the global variables
................................................................................
   245    245   	     *     which terminates the main loop must call
   246    246   	     *     rl_callback_handler_remove() to leave
   247    247   	     *     readline in a defined state.          XXX
   248    248   	     */
   249    249   	    tclrl_state = LINE_PENDING;
   250    250   
   251    251   	    while (!TclReadlineLineComplete()) {
   252         -#ifdef EXECUTING_MACRO_HACK
          252  +#ifdef EXECUTING_MACRO_NAME
   253    253   		/**
   254    254   		 * check first, if more characters are
   255    255   		 * available from _rl_executing_macro,
   256    256   		 * because Tcl_DoOneEvent() will (naturally)
   257    257   		 * not detect this `event'.
   258    258   		 */
   259         -		if (_rl_executing_macro)
          259  +		if (EXECUTING_MACRO_NAME)
   260    260   		    TclReadlineReadHandler((ClientData) NULL, TCL_READABLE);
   261    261   		else
   262    262   #endif
   263    263   		    Tcl_DoOneEvent(TCL_ALL_EVENTS);
   264    264   	    }
   265    265   
   266    266   	    Tcl_DeleteFileHandler(0);
................................................................................
   464    464   
   465    465   }
   466    466   
   467    467   static void
   468    468   TclReadlineReadHandler(ClientData clientData, int mask)
   469    469   {
   470    470       if (mask & TCL_READABLE) {
   471         -#ifdef EXECUTING_MACRO_HACK
          471  +#ifdef EXECUTING_MACRO_NAME
   472    472   	do {
   473    473   #endif
   474    474   	    rl_callback_read_char();
   475         -#ifdef EXECUTING_MACRO_HACK
          475  +#ifdef EXECUTING_MACRO_NAME
   476    476   	    /**
   477    477   	     * check, if we're inside a macro and
   478    478   	     * if so, read all macro characters
   479    479   	     * until the next eol.
   480    480   	     */
   481         -	} while (_rl_executing_macro && !TclReadlineLineComplete());
          481  +	} while (EXECUTING_MACRO_NAME && !TclReadlineLineComplete());
   482    482   #endif
   483    483       }
   484    484   }
   485    485   
   486    486   static void
   487    487   TclReadlineLineCompleteHandler(char* ptr)
   488    488   {
................................................................................
   499    499   	 * The calling script is responsible for handling
   500    500   	 * empty strings.
   501    501   	 */
   502    502   
   503    503   	char* expansion = (char*) NULL;
   504    504   	int status = history_expand(ptr, &expansion);
   505    505   
   506         -	if (status >= 1) {
          506  +	if (status >= 2) {
   507    507   	    /* TODO: make this a valid tcl output */
   508    508   	    printf("%s\n", expansion);
   509         -	} else if (-1 == status) {
          509  +		free(ptr);
          510  +		free(expansion);
          511  +		return;
          512  +	} else if (status <= -1) {
   510    513   	    Tcl_AppendResult
   511         -	    (tclrl_interp, "error in history expansion\n", (char*) NULL);
          514  +	    (tclrl_interp, "error in history expansion: ", expansion, "\n", (char*) NULL);
   512    515   	    TclReadlineTerminate(TCL_ERROR);
   513         -	}
   514         -	/**
   515         -	 * TODO: status == 2 ...
   516         -	 */
          516  +		free(ptr);
          517  +		free(expansion);
          518  +		return;
          519  +	} else {
          520  +        Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
          521  +    }
   517    522   
   518         -	Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
   519         -
   520         -#ifdef EXECUTING_MACRO_HACK
          523  +#ifdef EXECUTING_MACRO_NAME
   521    524   	/**
   522    525   	 * don't stuff macro lines
   523    526   	 * into readline's history.
   524    527   	 */
   525         -	if(!_rl_executing_macro) {
          528  +	if(!EXECUTING_MACRO_NAME) {
   526    529   #endif
   527    530   	    /**
   528    531   	     * don't stuff empty lines
   529    532   	     * into readline's history.
   530    533   	     * don't stuff twice the same
   531    534   	     * line into readline's history.
   532    535   	     */
................................................................................
   533    536   	    if (expansion && *expansion && (!tclrl_last_line ||
   534    537   		    strcmp(tclrl_last_line, expansion))) {
   535    538   		add_history(expansion);
   536    539   	    }
   537    540   	    if (tclrl_last_line)
   538    541   		free(tclrl_last_line);
   539    542   	    tclrl_last_line = strdup(expansion);
   540         -#ifdef EXECUTING_MACRO_HACK
          543  +#ifdef EXECUTING_MACRO_NAME
   541    544   	}
   542    545   #endif
   543    546   	/**
   544    547   	 * tell the calling routines to terminate.
   545    548   	 */
   546    549   	TclReadlineTerminate(LINE_COMPLETE);
   547    550   	FREE(ptr);
................................................................................
   695    698   	char* quoted_rl_line_buffer = TclReadlineQuote(rl_line_buffer, "$[]{}\"");
   696    699   	sprintf(start_s, "%d", start);
   697    700   	sprintf(end_s, "%d", end);
   698    701   	Tcl_ResetResult(tclrl_interp); /* clear result space */
   699    702   	state = Tcl_VarEval(tclrl_interp, tclrl_custom_completer,
   700    703   	    " \"", quoted_text, "\" ", start_s, " ", end_s,
   701    704   	    " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
   702         -	FREE(quoted_text);
   703         -	FREE(quoted_rl_line_buffer);
   704    705   	if (TCL_OK != state) {
   705    706   	    Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
   706    707   		" \"", quoted_text, "\" ", start_s, " ", end_s,
   707    708   		" \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
   708    709   	    TclReadlineTerminate(state);
          710  +		free(quoted_text);
          711  +		free(quoted_rl_line_buffer);
   709    712   	    return matches;
   710    713   	}
          714  +	free(quoted_text);
          715  +	quoted_text = NULL;
          716  +	free(quoted_rl_line_buffer);
          717  +	quoted_rl_line_buffer = NULL;
   711    718   	obj = Tcl_GetObjResult(tclrl_interp);
   712    719   	status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
   713    720   	if (TCL_OK != status)
   714    721   	    return matches;
   715    722   
   716    723   	if (objc) {
   717    724   	    int i, length;