This file is a HOWTO for the cross-compiling of Win32 binary DLLs built from a tarball generated by 'make dist' in a Git checkout. The resulting DLLs are built with a cdecl interface compatible with MS VC++. Prerequisites ============= In these steps the release or daily snapshot tarball is unpacked in ~/builds for the Win32 build and all operations are done from there unless otherwise noted. Under Linux you need the mingw32 package to cross-compile it, an internal copy of libltdl (configured and built as below), zip to create the archive, the tofrodos or dos2unix package installed to convert to DOS text format, and Wine plus the free MVC++Toolkit available from: http://uploading.com/files/HNH73WB3/VCToolkitSetup%28v1.01%29%282004.07.06%29.zip.html to create the Win32 .LIB file (unzip and then install it with Wine in the usual way). NB: Debian Squeeze and later users will need at least the mingw32-runtime 3.15 package as the 3.13 package is broken and can manually install the Ubuntu version from: http://packages.ubuntu.com/maverick/devel/mingw32-runtime Finally, the Win32 version of libusb must be available for the USB backends to be built. Download the latest libusb-win32-bin-1.2.4.0.zip from: https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.4.0/ and unzip the archive in ~/builds/libusb-win32-bin-1.2.4.0 and then copy the following into libusb-win32-bin-1.2.4.0/lib/pkgconfig/libusb.pc (the pkgconfig directory will need to be created): ---------------CUT----------------------------- prefix=/home/USER/builds/libusb-win32-bin-1.2.4.0 exec_prefix=${prefix} libdir=${exec_prefix}/lib/gcc bindir=${exec_prefix}/bin includedir=${prefix}/include Name: libusb Description: USB access library Version: 1.2.4.0 Libs: -L${libdir} -L${bindir} -lusb Cflags: -I${includedir} ---------------CUT----------------------------- Any version from 1.2.3.0 has been known to work. Build for Win32, cross-compile on Linux: ======================================== Extract the Hamlib tarball into ~/builds (if you prefer another directory be sure to edit the BUILD_DIR variable in the build-win32.sh script): $ tar xvfz ~/Downloads/hamlib-1.2.14~git-72c52d6-20110618.tar.gz Invoke the build-win32.sh script (it requires a Bash shell) with the name of the directory/Hamlib version to build (you need not cd into the hamlib directory, although it won't hurt. The script uses absolute paths): build-win32.sh hamlib-1.2.14~git Note: At this time (18 Jun 2011) the build will fail on Debian Unstable due to a libtool version mismatch between libtool 2.2.6b included in the 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