diff --git a/README_VB b/README_VB deleted file mode 100644 index 92a53c92b..000000000 --- a/README_VB +++ /dev/null @@ -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/ diff --git a/scripts/README.build-VB.NET b/scripts/README.build-VB.NET new file mode 100644 index 000000000..1c0720dfe --- /dev/null +++ b/scripts/README.build-VB.NET @@ -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 diff --git a/scripts/README.build-win32 b/scripts/README.build-win32 index d26734ab7..4af373f02 100644 --- a/scripts/README.build-win32 +++ b/scripts/README.build-win32 @@ -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 diff --git a/scripts/README.scripts b/scripts/README.scripts new file mode 100644 index 000000000..80b3defcd --- /dev/null +++ b/scripts/README.scripts @@ -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 diff --git a/scripts/build-VB.NET.sh b/scripts/build-VB.NET.sh new file mode 100644 index 000000000..1e8915ee6 --- /dev/null +++ b/scripts/build-VB.NET.sh @@ -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 <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}` diff --git a/scripts/build-win32.sh b/scripts/build-win32.sh old mode 100755 new mode 100644 index 25d2d5d48..87702ecfa --- a/scripts/build-win32.sh +++ b/scripts/build-win32.sh @@ -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 < 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 (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 (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}`