Fix TCL script test target--check-tcl

Found that when nothing was installed that check-tcl failed with a
failure of tclsh not being able to load the shared library.  Thanks to
assistance from comp.lang.tcl, copying pkgIndex.tcl to $(builddir)/.libs
prior to loading the test script allows the script to load the shared
library immediately after 'make' and before 'make install'.

Prefixed various TCL section target commands with either $(AM_V_GEN) or
$(AM_V_at) to conditionally silence the output of 'make'.
astyle-formatting
Nate Bargmann 2017-07-27 14:44:40 -05:00
rodzic 4f9085f8f5
commit 21a86f429e
1 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -158,22 +158,25 @@ hamlibtcl_la_LTLIBRARIES = $(tcl_ltlib)
# Having the first occurance of 'hamlib' capitalized seemed to cause confusion
# for the TCL interpreter loading the Hamlib module.
pkgIndex.tcl: Makefile
echo 'package ifneeded hamlib $(PKG_VER) [list load [file join $$dir $(DLL)] Hamlib]' > pkgIndex.tcl
$(AM_V_at)echo 'package ifneeded hamlib $(PKG_VER) [list load [file join $$dir $(DLL)] Hamlib]' > pkgIndex.tcl
hamlibtcl_wrap.c: hamlib.swg $(SWGDEP)
$(SWIG) -tcl -pkgversion $(PKG_VER) $(AM_CPPFLAGS) -I$(top_srcdir)/bindings \
-o $@ `test -f hamlib.swg || echo '$(srcdir)/'`hamlib.swg
$(AM_V_GEN)$(SWIG) -tcl -pkgversion $(PKG_VER) $(AM_CPPFLAGS) \
-I$(top_srcdir)/bindings \
-o $@ `test -f hamlib.swg || echo '$(srcdir)/'`hamlib.swg
do_subst = sed -e 's,[@]tcldir[@],$(tcldir),g'
tcltest.tcl: tcltest.tcl.in Makefile
$(do_subst) < $(srcdir)/tcltest.tcl.in > tcltest.tcl
$(AM_V_GEN)$(do_subst) < $(srcdir)/tcltest.tcl.in > tcltest.tcl
all-tcl: pkgIndex.tcl $(tcl_ltlib) tcltest.tcl
check-tcl: all-tcl
TCLLIBPATH=$(builddir)/.libs tclsh $(builddir)/tcltest.tcl \
|| echo "Tcl test failed" 1>&2
$(AM_V_at)cp $(builddir)/pkgIndex.tcl $(builddir)/.libs
$(AM_V_at)TCLLIBPATH=$(builddir)/.libs tclsh $(builddir)/tcltest.tcl \
|| echo "Tcl test failed" 1>&2
$(AM_V_at)rm -f $(builddir)/.libs/pkgIndex.tcl
install-tcl:
clean-tcl: