Add build-VB.NET.sh and README files to scripts/

Removed README_VB as its info is now embedded in the build-VB.NET.sh
script and is output into a custom README file upon creation of the ZIP
archive.

Added README.scripts to document reason for the directory and included
scripts.
Hamlib-1.2.14
Nate Bargmann 2011-06-20 21:35:06 -05:00
rodzic 3dd031c36b
commit 72b46957aa
6 zmienionych plików z 344 dodań i 97 usunięć

Wyświetl plik

@ -1,88 +0,0 @@
This file originates from a mail by Michael Benz who did the work.
It explains how to proceed to have the VB Wrapper used with
VB.NET 2002 with Framework 1.1 (others not tested)
In the newer VB Modules (.BAS) don't exist anymore. So they were replaced by the
Classes (.VB)
The Wrapper is not in final Condition, many DLL Function are still not covered now,
but it will be a good start.
To Import the "Wrapper" use the Folder "Project" and "Import existing Element"
Now import the Class "Hamlib.VB". It alsough seems to import into Sharpdevelop,
so anybody can try it out for free!
http://www.icsharpcode.net/OpenSource/SD/Default.aspx
This Class contains Your Enumeration as well as the DLLImport to get Access to the
Hamlib DLL.
Covered are:
- Init Rig with Comport and Speed
- set/ get Frequency
- set/get Mode
- set/get VFO
- get Riginfo
-rig_debug_level_e not verified (Function is Void, VB Dokumentation
sais this is not possible to be marshaled, but Compiler is still accapting this)
To get access to the Class you have to add something like this in your Main Class
Dim RigLib As RigControll = New RigControll 'get Acces to RigLib Klass
here is an Example how to use the Class:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Dim tokenlookup As String = "rig_pathname"
'Dim tokenlookup As Object = "serial_speed"
'Dim Info As String
Dim Frequenz As Double
Dim ZeichenOut As String
Dim TokenPointer As System.Int32
Dim VFO As Integer
Dim Mode As RigControll.RMode_t
Dim Bandbreite As Long
' Dim RigLib As RigControll = New RigControll
Button3.Enabled() = True
Button2.Enabled() = False
RigLib.rig_set_debug(RigControll.rig_debug_level_e.RIG_DEBUG_TRACE)
myrig = RigLib.rig_init(RigNumber.Text)
TBmyrig.Text = myrig.ToString 'convert myrig to String
TokenPointer = RigLib.rig_token_lookup(myrig, "rig_pathname")
TBZeichen.Text = RigLib.rig_set_conf(myrig, TokenPointer, ComboBox2.Text)
Token.Text = TokenPointer
TokenPointer = RigLib.rig_token_lookup(myrig, "serial_speed")
TBZeichen.Text = RigLib.rig_set_conf(myrig, TokenPointer, ComboBox3.Text)
Token.Text = TokenPointer
RigLib.rig_open(myrig)
TB_Riginfo.Text = RigLib.rig_get_info(myrig)
RigLib.rig_get_vfo(myrig, VFO)
TextBox8.Text = VFO.ToString
RigLib.rig_get_freq(myrig, VFO, Frequenz)
TextBox2.Text() = Frequenz
RigLib.rig_get_mode(myrig, VFO, Mode, Bandbreite)
TextBox3.Text = [Enum].GetName(GetType(RigControll.RMode_t), Mode)
TextBox4.Text = Bandbreite
End Sub
+++++++++++++++++++++++++++++++++
kind Regard
Michael
PS: For help, patches, report, please use send mail at
hamlib-developer@lists.sourceforge.net mailing list
or http://sourceforge.net/projects/hamlib/

Wyświetl plik

@ -0,0 +1,17 @@
The build-VB.NET.sh script creates a binary ZIP archive of Hamlib compiled for
Win32 using the __stdcall interface for Visual Basic.NET 2002 Framework 1.1.
The release is possibly usable by other VB versions, but success has not
been reported to the Hamlib team. The script is very similar to the
build-win32.sh script and has the same Prerequisites for development tools.
The differences are the use of sed(1) to edit include/hamlib.rig_dll.h for
__stdcall, output of a customized README.VB.NET-bin file, and naming of the
ZIP archive. See README.build-win32 for more information.
The Hamlib developers would appreciate help making Hamlib, and the binary
release generated by the script, usable by other versions of Visual Basic.
Interested developers may contact us by our mailing list:
hamlib-developer@lists.sourceforge.net
73, Nate, N0NB

Wyświetl plik

@ -73,3 +73,28 @@ mingw32/gcc-mingw32 packages and the later libtool 2.4 installed on Unstable
and Testing. Users of Debian Stable (Squeeze) and Ubuntu 10.10 (Maverick)
should be able to build the Win32 DLLs.
Release Info
============
The structure of the archive is:
$ tree -d
.
|-- bin
|-- include
| `-- hamlib
`-- lib
|-- gcc
`-- msvc
6 directories
The bin directory is were the executables and DLL files are placed. Header
files are under include/Hamlib and compiler specific files are under lib/*.
The embedded README.win32-bin file generated by the build-win32.sh script
describes setting the PATH environment variable in Windows 2000 and Windows
XP.
73, Nate, N0NB

Wyświetl plik

@ -0,0 +1,11 @@
The scripts/ directory will contain helper scripts for building Hamlib
binary releases for Win32 and possibly other target platforms. EAch
script should be accompanied by a companion README file with information
on the script and build requirements.
Scripts:
build-win32.sh for building Win32 DLLs and EXEs for use with MS VC++.
build-VB.NET.sh for building Win32 DLLs and EXEs for use with MS VB.NET
2002 Framework 1.1

Wyświetl plik

@ -0,0 +1,213 @@
#!/bin/bash
# A script to build a set of VB.NET 2002 Framework 1.1 binary DLLs from a
# Hamlib tarball. This script assumes that the Hamlib tarball has been
# extracted to the directory specified in $build_dir and that
# libusb-win32-bin-1.x.y.z has also been extracted to $build_dir and a
# libusb.pc file has been created. The MS VC++ Toolkit must also be
# installed.
#
# See README.build-VB.NET for complete details.
# Set this to a desired directory
BUILD_DIR=~/builds
# Set this to LibUSB archive extracted in $BUILD_DIR
LIBUSB_VER=libusb-win32-bin-1.2.4.0
# Error return codes. See /usr/include/sysexits.h
EX_USAGE=64
EX_NOINPUT=66
# Pass name of Hamlib archive extracted in $BUILD_DIR
if [ $# -ne 1 ]; then
echo -e "\nUsage: `basename $0` hamlib-version\n"
echo -e "See README.build-VB.NET for more information.\n"
exit $EX_USAGE
fi
# Make sure the Hamlib archive is where we expect
if [ -d ${BUILD_DIR}/$1 ]; then
echo -e "\nBuilding VB.NET binaries in ${BUILD_DIR}/$1\n\n"
cd ${BUILD_DIR}/$1
else
echo -e "\nBuild directory, ${BUILD_DIR}/$1 not found!\nCheck path for $1 or correct the version number.\n"
exit $EX_NOINPUT
fi
RELEASE=`/usr/bin/awk 'BEGIN{FS="["; RS="]"} /\[1\./ {print $2}' ./configure.ac`
INST_DIR=`pwd`/mingw-inst
ZIP_DIR=`pwd`/hamlib-VB.NET-${RELEASE}
LIBUSB_WIN32_BIN_PATH=${BUILD_DIR}/${LIBUSB_VER}
# Create VB.NET specific README.VB.NET-bin file
cat > README.VB.NET-bin <<END_OF_README
What is it?
===========
This ZIP archive contains a build of Hamlib-$RELEASE
cross-compiled for VB.NET 2002 Framework 1.1 using MinGW under
Debian GNU/Linux (nice, heh!).
The DLL has a stdcall interface for MS VB.NET 2002 Framework 1.1.
This material is copyrighted. The library license is LGPL, and the *.EXE
files licenses are GPL. Hamlib comes WITHOUT ANY WARRANTY. See LICENSE.txt
COPYING.txt, and COPYING.LIB.txt files.
Usage
=====
The following originates from a mail by Michael Benz who did the work. It
explains how to proceed to have the VB Wrapper used with VB.NET 2002 with
Framework 1.1 (others not tested)
------------------------------------------------------------------------------
In the newer VB Modules (.BAS) don't exist anymore. So they were replaced by
the Classes (.VB) The Wrapper is not in final Condition, many DLL Function
are still not covered now, but it will be a good start.
To Import the "Wrapper" use the Folder "Project" and "Import existing
Element" Now import the Class "Hamlib.VB". It alsough seems to import into
Sharpdevelop, so anybody can try it out for free!
http://www.icsharpcode.net/OpenSource/SD/Default.aspx
This Class contains Your Enumeration as well as the DLLImport to get Access
to the Hamlib DLL.
Covered are:
- Init Rig with Comport and Speed
- set/ get Frequency
- set/get Mode
- set/get VFO
- get Riginfo
-rig_debug_level_e not verified (Function is Void, VB Dokumentation
sais this is not possible to be marshaled, but Compiler is still accapting this)
To get access to the Class you have to add something like this in your Main Class
Dim RigLib As RigControll = New RigControll 'get Acces to RigLib Klass
here is an Example how to use the Class:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Dim tokenlookup As String = "rig_pathname"
'Dim tokenlookup As Object = "serial_speed"
'Dim Info As String
Dim Frequenz As Double
Dim ZeichenOut As String
Dim TokenPointer As System.Int32
Dim VFO As Integer
Dim Mode As RigControll.RMode_t
Dim Bandbreite As Long
' Dim RigLib As RigControll = New RigControll
Button3.Enabled() = True
Button2.Enabled() = False
RigLib.rig_set_debug(RigControll.rig_debug_level_e.RIG_DEBUG_TRACE)
myrig = RigLib.rig_init(RigNumber.Text)
TBmyrig.Text = myrig.ToString 'convert myrig to String
TokenPointer = RigLib.rig_token_lookup(myrig, "rig_pathname")
TBZeichen.Text = RigLib.rig_set_conf(myrig, TokenPointer, ComboBox2.Text)
Token.Text = TokenPointer
TokenPointer = RigLib.rig_token_lookup(myrig, "serial_speed")
TBZeichen.Text = RigLib.rig_set_conf(myrig, TokenPointer, ComboBox3.Text)
Token.Text = TokenPointer
RigLib.rig_open(myrig)
TB_Riginfo.Text = RigLib.rig_get_info(myrig)
RigLib.rig_get_vfo(myrig, VFO)
TextBox8.Text = VFO.ToString
RigLib.rig_get_freq(myrig, VFO, Frequenz)
TextBox2.Text() = Frequenz
RigLib.rig_get_mode(myrig, VFO, Mode, Bandbreite)
TextBox3.Text = [Enum].GetName(GetType(RigControll.RMode_t), Mode)
TextBox4.Text = Bandbreite
End Sub
+++++++++++++++++++++++++++++++++
kind Regard
Michael
------------------------------------------------------------------------------
Thank You!
==========
Patches, feedback, and contributions are welcome.
Please report problems, success to hamlib-developer@lists.sourceforge.net
Cheers,
Stephane Fillod - F8CFE
Nate Bargmann - N0NB
http://www.hamlib.org
END_OF_README
# Edit include/hamlib/rig_dll.h for __stdcall
mv include/hamlib/rig_dll.h include/hamlib/rig_dll.h.orig
sed -e 's/__cdecl/__stdcall/' <include/hamlib/rig_dll.h.orig >include/hamlib/rig_dll.h
rm include/hamlib/rig_dll.h.orig
# Import internal ./libltdl and build it for mingw32
libtoolize --ltdl
cd libltdl; ./configure --host=i586-mingw32msvc && make; cd ..
# Configure and build hamlib for mingw32, with libusb-win32
./configure --disable-static \
--host=i586-mingw32msvc \
--prefix=`pwd`/mingw-inst \
--without-rpc-backends \
--without-cxx-binding \
PKG_CONFIG_LIBDIR=${LIBUSB_WIN32_BIN_PATH}/lib/pkgconfig
make install
mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc ${ZIP_DIR}/include
cp -a src/libhamlib.def ${ZIP_DIR}/lib/msvc/libhamlib-2.def; todos ${ZIP_DIR}/lib/msvc/libhamlib-2.def
cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/.; todos ${ZIP_DIR}/include/hamlib/*.h
# C++ binding is useless on win32 because of ABI
rm ${ZIP_DIR}/include/hamlib/{rig,rot}class.h
for f in AUTHORS ChangeLog COPYING COPYING.LIB LICENSE README README.betatester README.VB.NET-bin THANKS ; do \
cp -a ${f} ${ZIP_DIR}/${f}.txt ; todos ${ZIP_DIR}/${f}.txt ; done
# Copy build files into specific locations for Zip file
cp -a ${INST_DIR}/bin/{rigctld.exe,rigctl.exe,rigmem.exe,rigsmtr.exe,rigswr.exe,rotctld.exe,rotctl.exe} ${ZIP_DIR}/bin/.
cp -a ${INST_DIR}/lib/hamlib/hamlib-*.dll ${ZIP_DIR}/bin/.
cp -a ${INST_DIR}/bin/libhamlib-?.dll ${ZIP_DIR}/bin/.
cp -a ${INST_DIR}/lib/libhamlib.dll.a ${ZIP_DIR}/lib/gcc/.
# NB: Do not strip libusb0.dll
i586-mingw32msvc-strip ${ZIP_DIR}/bin/*.exe ${ZIP_DIR}/bin/*hamlib-*.dll
cp -a ${LIBUSB_WIN32_BIN_PATH}/bin/x86/libusb0_x86.dll ${ZIP_DIR}/bin/libusb0.dll
# Need VC++ free toolkit installed (default Wine directory installation shown)
( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:i386 /def:libhamlib-2.def )
zip -r hamlib-VB.NET-${RELEASE}.zip `basename ${ZIP_DIR}`

87
scripts/build-win32.sh 100755 → 100644
Wyświetl plik

@ -42,27 +42,95 @@ INST_DIR=`pwd`/mingw-inst
ZIP_DIR=`pwd`/hamlib-win32-${RELEASE}
LIBUSB_WIN32_BIN_PATH=${BUILD_DIR}/${LIBUSB_VER}
# Create Win32 specific README.win32_bin file
cat > README.win32-bin <<END_OF_README
What is it?
===========
This ZIP archive contains a build of Hamlib-$RELEASE
cross-compiled for Win32 using MinGW under Debian GNU/Linux (nice, heh!).
cross-compiled for Win32 using MinGW under Xubuntu Linux 10.10 (nice, heh!).
The DLL has a cdecl interface for MS VC++.
This material is copyrighted. The library license is LGPL, and the *.EXE
files licenses are GPL. Hamlib comes WITHOUT ANY WARRANTY. See LICENSE.txt
COPYING.txt, and COPYING.LIB.txt files.
This software is copyrighted. The library license is LGPL, and the *.EXE
files licenses are GPL. Hamlib comes WITHOUT ANY WARRANTY. See the
LICENSE.txt, COPYING.txt, and COPYING.LIB.txt files.
Make sure *all* the .DLL are in your PATH, and you have read
the README.betatester file, especially the "testing Hamlib" section.
Installation and Configuration
==============================
Extract the ZIP archive into a convenient location, C:\Program Files is a
reasonable choice.
Make sure *all* the .DLL files are in your PATH (leave them in the bin
directory and set the PATH). To set the PATH environment variable in
Windows 2000 and Windows XP (need info on Vista and Win 7) do the following:
* Right-click on "My Computer"
* Select "Properties" from the pop-up menu
* Click the "Advanced" tab of the "System Properties" dialog
* Click the "Environment Variables" button
* Select "Path" in the "System variables" box of the "Environment Variables"
dialog
* Click the Edit button
* Now add the Hamlib path in the "Variable Value: edit box. Be sure to put
a semi-colon ';' after the last path before adding the Hamlib path (NB. The
entire path is highlighted and will be erased upon typing a character so
click in the box to unselect the text first. The PATH is important!!)
Append the Hamlib path, e.g. C:\Program Files\hamlib-win32-1.2.14~git\bin
* Click OK for all three dialog boxes to save your changes.
Testing with the Hamlib Utilities
=================================
To continue, be sure you have read the README.betatester file, especially
the "Testing Hamlib" section. The primary means of testing is by way of the
rigctl utility for radios and rotctl utility for rotators. Each is a command
line program that is interactive or can act on a single command and exit.
Documentation for each can be found in a PDF at:
https://sourceforge.net/apps/mediawiki/hamlib/index.php?title=Documentation
In short, the command syntax is of the form:
rigctl -m 120 -r COM1 -vvvvv
-m -> Radio model 120, or Yaesu FT-817 (use -l for a list)
-r -> Radio device, in this case COM1
-v -> Verbosity level. For testing four or five v characters are required.
Five v's set a debug level of TRACE which generates a lot of screen
output showing communication to the radio and values of important
variables. These traces are important for Hamlib development.
To run rigctl or rotctl open a cmd window (Start|Run|enter 'cmd' in the dialog).
If text scrolls off the screen, you can scroll back with the mouse. To copy
output text into a mailer or editor (I recommend Notepad++, a free editor also
licensed under the GPL), highlight the text as a rectangle in the cmd window,
press <Enter> (or right-click the window icon in the upper left corner and
select Edit, then Copy), and paste it into your editor with Ctl-V (or
Edit|Paste from the typical GUI menu).
All feedback is welcome to the mail address below.
Information for Win32 Programmers
=================================
There's a .LIB import library for MS-VC++ in lib/msvc. Simply #include
<hamlib/rig.h> (add directory to include path), include the .LIB in your
project and you're done. Note: MS-VC++ cannot compile all the Hamlib code,
but the API rig.h has been made MSVC friendly :-)
Thank You!
==========
Patches, feedback, and contributions are welcome.
Please report problems, success to hamlib-developer@lists.sourceforge.net
Please report problems or success to hamlib-developer@lists.sourceforge.net
Cheers,
Stephane Fillod - F8CFE
@ -71,6 +139,7 @@ http://www.hamlib.org
END_OF_README
# Import internal ./libltdl and build it for mingw32
libtoolize --ltdl
cd libltdl; ./configure --host=i586-mingw32msvc && make; cd ..
@ -93,7 +162,7 @@ cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/.; todos ${ZIP_DIR}/include/
# C++ binding is useless on win32 because of ABI
rm ${ZIP_DIR}/include/hamlib/{rig,rot}class.h
for f in AUTHORS ChangeLog README README.betatester LICENSE COPYING COPYING.LIB README.win32-bin THANKS ; do \
for f in AUTHORS ChangeLog COPYING COPYING.LIB LICENSE README README.betatester README.win32-bin THANKS ; do \
cp -a ${f} ${ZIP_DIR}/${f}.txt ; todos ${ZIP_DIR}/${f}.txt ; done
# Copy build files into specific locations for Zip file
@ -108,6 +177,6 @@ cp -a ${LIBUSB_WIN32_BIN_PATH}/bin/x86/libusb0_x86.dll ${ZIP_DIR}/bin/libusb0.dl
# Need VC++ free toolkit installed (default Wine directory installation shown)
( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:i386 /def:libhamlib-2.def )
zip -r hamlib-win32-${RELEASE}-`date +%Y%m%d`.zip `basename ${ZIP_DIR}`
zip -r hamlib-win32-${RELEASE}.zip `basename ${ZIP_DIR}`