By including the stdint SWIG typemaps we can directly use types
derived from [u]int64_t etc.
Because Lua numbers are implemented using a double-precision floating
point type and also because SWIG when generating a Lua wrappings can
only define constants from #define and enum values that fit into an
'int' type we must hide any constants that require more than 32-bits
to represent themselves, as they cannot be represented in Lua. This
applies to rmode_t and the RIG_FUNC... defines at the time of
writing. By hiding them from the Lua binding they will get a 'nil'
value in Lua i.e. undefined so clients using the Lua binding will know
they are not there. This is a nasty hack but without major design
changes to the Hamlib API it is do this or drop the Lua binding.
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'.
Remove execute bits for all test scripts and install them into
doc/examples.
Make sure check-py and check-tcl targets work.
Set a conditional for Python3 or Python2 and install/test the correct
script file.
Use Makefile variables instead of configure substitutions wherever
possible.
Generate tcltest.tcl at make time to insert installation library path
into the script so that tests pass.
Also reorder its call in configure.ac which now allows the PYTHON_VERSION
environment variable to be recognized and processed correctly by the
build system.
Correctly add PYTHON_LIBS (correct ouput variable of AX_PYTHON_DEVEL) to the
Makefile for the Python bindings.
Update README.python for use of PYTHON_VERSION.
The increasing popularity of Python3 requires that Hamlib provide a
means of instruction for building and installing its module concurrent
with the Python2 module. README.python outlines the required steps.
py3test.py is a reworking of the pytest.py script for Python3 syntax.
I have a small patch to correct the install location of the python
bindings.
Since it's not a pure python extension is belongs in pyexecdir instead
of pythondir, which for multilib systems like Fedora will get installed
into /usr/lib64/python{ver}/site-packages on 64bit systems.
This is consistent with the automake documentation:
http://www.gnu.org/software/automake/manual/html_node/Python.html
(Patch adjusted by n0nb for Hamlib 3.0 bindings/Makefile.am)
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
Due to the changes of the patch contributed by Ervin Hegedüs, correct
the bindings test scripts to work with the corrected ordering of VFO and
frequency arguments.
Also add a call to send_morse() in each script.
I made a patch, you can see in that there is the solution, which
describe the error: if a function in hamlib looks 3 argument
(rig, vfo, any 3rd arg), the order of the 2nd and 3rd argument
were reversed, because the macro METHOD1 reversed them.
I've collected these functions, compared its arguments with
hamlib docs (http://hamlib.sourceforge.net/manuals/1.2.15/), and
where 1st arg is rig, 2nd arg is vfo, and 3rd is any kind of
type, changed to METHOD3, which is a new macro, and keeps the
correct order of original function - see the patch. (I didn't
find any info about the expected diff format, so I just created
the `diff -uprN ORIG NEW'.)
To check my theory, I've tested with another function, which uses
vfo type at 2nd argument, eg. rig_set_freq; here is the Python
code:
my_rig.set_freq(Hamlib.RIG_VFO_A, 7013200.0)
and the original code drop the exception:
my_rig.set_freq(Hamlib.RIG_VFO_A, 7012500.0)
File "/usr/local/lib/python2.7/dist-packages/Hamlib.py", line 2513, in
set_freq
def set_freq(self, *args): return _Hamlib.Rig_set_freq(self, *args)
TypeError: in method 'Rig_set_freq', argument 3 of type 'vfo_t'
As you can see, it's same as my original error above.
So, after I patched the source and recompiled it again, these two
function works correctly - I will test it at soon, but I think
_this_ is good and stable.
Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
Various fixes for building the bindings properly.
Install TCL binding to $(libdir)/tcl/Hamlib, arbitrarily chosen since
there seems to be no standard installation location. When install
location is changed, tcltest.tcl documents the needed change to a TCL
script.
In the Perl and Python test scripts, improved the QRA examples. In all
scripts used tabs to line up printed values nicely.
Updated INSTALL and NEWS for recent updates. Better documented bindings
installation and uninstallation in INSTALL.
A Perl file was being compile whether Perl binding was enabled or not.
Fixed that and configured an AM_CONDITIONAL for Perl so its components
will not be built when it is not enabled.