Skip to content

Commit

Permalink
Add tclstub support (#23)
Browse files Browse the repository at this point in the history
* Add tclstub support

Initialize the stubs when needed.

* Bump version

* Add tclstub support

To build with tclstub library run.
You have to autogen.sh to create a fresh configure.

NOCONFIGURE=1 ./autogen.sh
./configure --enable-tclstub

And add any other flags you need.

We ship the configure script to help distro's that do not
run a full autogen.sh. But stubs is only available if you
run autogen.sh (or the automake process).
  • Loading branch information
snoe925 authored Oct 21, 2019
1 parent 57a2c69 commit 98c6af7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
13 changes: 10 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ include_HEADERS = tclreadline.h

INCLUDES = -I$(TCL_INCLUDE_DIR) -I$(READLINE_INCLUDE_DIR)

## libtclreadline_la_LIBADD = $(LIBS)
libtclreadline_la_CFLAGS = -Wall
libtclreadline_la_LIBADD = $(TCL_LIB_SPEC)
if !USE_TCL_STUBS
libtclreadline_la_CFLAGS = -Wall
else
libtclreadline_la_CFLAGS = -Wall -DUSE_TCL_STUBS
endif
if !USE_TCL_STUBS
libtclreadline_la_LIBADD = $(TCL_LIB_SPEC)
else
libtclreadline_la_LIBADD = $(TCL_STUB_LIB_SPEC)
endif
libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)

tclrldir = @TCLRL_DIR@
Expand Down
26 changes: 13 additions & 13 deletions configure
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for tclreadline 2.3.6.
# Generated by GNU Autoconf 2.69 for tclreadline 2.3.7.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -588,8 +588,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tclreadline'
PACKAGE_TARNAME='tclreadline'
PACKAGE_VERSION='2.3.6'
PACKAGE_STRING='tclreadline 2.3.6'
PACKAGE_VERSION='2.3.7'
PACKAGE_STRING='tclreadline 2.3.7'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1344,7 +1344,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures tclreadline 2.3.6 to adapt to many kinds of systems.
\`configure' configures tclreadline 2.3.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1415,7 +1415,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of tclreadline 2.3.6:";;
short | recursive ) echo "Configuration of tclreadline 2.3.7:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1533,7 +1533,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
tclreadline configure 2.3.6
tclreadline configure 2.3.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1944,7 +1944,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by tclreadline $as_me 2.3.6, which was
It was created by tclreadline $as_me 2.3.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2327,9 +2327,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.



MAJOR="`echo '2.3.6' | cut -d. -f 1`"
MINOR="`echo '2.3.6' | cut -d. -f 2`"
PATCHLEVEL="`echo '2.3.6' | cut -d. -f 3`"
MAJOR="`echo '2.3.7' | cut -d. -f 1`"
MINOR="`echo '2.3.7' | cut -d. -f 2`"
PATCHLEVEL="`echo '2.3.7' | cut -d. -f 3`"
VERSION=$MAJOR.$MINOR
PATCHLEVEL_STR=$VERSION.$PATCHLEVEL

Expand Down Expand Up @@ -2825,7 +2825,7 @@ fi

# Define the identity of the package.
PACKAGE='tclreadline'
VERSION='2.3.6'
VERSION='2.3.7'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -13347,7 +13347,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tclreadline $as_me 2.3.6, which was
This file was extended by tclreadline $as_me 2.3.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -13413,7 +13413,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
tclreadline config.status 2.3.6
tclreadline config.status 2.3.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
18 changes: 16 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dnl Copyright (c) 1998 - 2014, Johannes Zellner <[email protected]>
dnl This software is copyright under the BSD license.
dnl ---

AC_INIT([tclreadline], [2.3.6])
AC_INIT([tclreadline], [2.3.7])
AC_CONFIG_SRCDIR([tclreadline.c])
AC_CONFIG_HEADERS(config.h)
AC_PREREQ(2.13)
Expand Down Expand Up @@ -258,6 +258,20 @@ int main () {
AC_MSG_RESULT(no cross compiling)
)

AC_ARG_ENABLE(tclstub,
[ --enable-tclstub build with TCL stub library],
[dnl action if given
case "${enableval}" in
yes) enable_tclstub=true ;;
no) enable_tclstub=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tclstub) ;;
esac
],
[dnl action if not given
enable_tclstub=false
]
)
AM_CONDITIONAL(USE_TCL_STUBS, test x$enable_tclstub = xtrue)

AC_ARG_ENABLE(tclshrl,
[ --enable-tclshrl build statically linked tclshrl],
Expand Down Expand Up @@ -294,8 +308,8 @@ AC_ARG_ENABLE(wishrl,
)
AM_CONDITIONAL(STATIC_WISHRL, test x$enable_static = xtrue)


AC_SUBST(TCL_INCLUDE_DIR)
AC_SUBST(TCL_STUB_LIB_SPEC)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(READLINE_INCLUDE_DIR)
AC_OUTPUT(Makefile tclreadline.h tclreadlineInit.tcl tclreadlineSetup.tcl tclreadline.n pkgIndex.tcl)
3 changes: 3 additions & 0 deletions tclreadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ int
Tclreadline_Init(Tcl_Interp *interp)
{
int status;
#ifdef USE_TCL_STUBS
Tcl_InitStubs(interp, "8.6", 0);
#endif
Tcl_CreateObjCommand(interp, "::tclreadline::readline", TclReadlineCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
tclrl_interp = interp;
Expand Down

0 comments on commit 98c6af7

Please sign in to comment.