[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. cd67bf15ce8336f819c2a
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-07-22 02:28:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via cd67bf15ce8336f819c2aa589ec0a37ee58f99eb (commit) via fb2834afe8c01c163f5bd157170cc6e061899738 (commit) via 41baedf9696668cae8a99b77f93606f6d89f6645 (commit) from 94d7f0b7debd0ef80d5b010c3dc73bff65045a5b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cd67bf15ce8336f819c2aa589ec0a37ee58f99eb Author: Phillip Rose, GM3ZZA <gm...@bt...> Date: Sat Jul 19 08:42:09 2025 +0000 Windows build README updates and MSVS .lib recipe Include Phil's recipe for generating a local .lib file for MS Visual Studio and credit him for this commit. Phil's original message is: https://sourceforge.net/p/hamlib/mailman/message/59208589/ diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index aac75633e..76c766a4a 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -185,41 +185,44 @@ Information for w32 Programmers The DLL has a cdecl interface. There is a libhamlib-4.def definition file for MS Visual C++/Visual Studio in -lib/msvc. Refer to the sample commands below to generate a local -libhamlib-4.lib file for use with the VC++/VS linker. +lib\msvc. Refer to the recipe below to generate a local libhamlib-4.lib file +for use with the VC++/VS linker. -Simply #include <hamlib/rig.h> (add directory to include path), include -libhamlib-4.lib in your project and you are done. Note: VC++/VS cannot -compile all the Hamlib code, but the API defined by rig.h has been made MSVC -friendly :-) +Simply '#include <hamlib/rig.h>' (or any other header) (add directory to +include path), include libhamlib-4.lib in your project and you are done. Note: +VC++/VS cannot compile all the Hamlib code, but the API defined by rig.h has +been made MSVC friendly :-) As the source code for the library DLLs is licensed under the LGPL, your program is not considered a "derivative work" when using the published Hamlib API and normal linking to the front-end library, and may be of a license of your choosing. -As of 08 Sep 2022 a .lib file is generated using the MinGW dlltool utility. -If this file does not work for your project, follow the steps in the following -section: +As of 21 Jul 2025 a .lib file is generated using the MinGW dlltool utility. +This file is now installed to the lib\gcc-mingw directory. As it is generated +by the MinGW dlltool utility, it is only suitable for use with MinGW/GCC. -For linking the library with MS Visual C++ 2003, from the directory you -installed Hamlib run the following commands to generate the libhamlib-4.lib -file needed for linking with your MSVC project: +For developers using Microsoft Visual Studio, the following recipe is +provided by Phil Rose, GM3ZZA: -cd lib\msvc -c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def +My secret sauce is: -To do the same for Visual Studio 2017: +Open "Developer PowerShell for VS2022" in administrator mode. This adds the +correct directory to the path and allows update of "C:\Program Files" with the +.dll. -cd lib\msvc -c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Tools\MSVC\14.16.27023\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def +Then (in my case). -For VS 2019: +cd "C:\Program Files\hamlib-w32-${RELEASE}\lib\msvc" +lib \def:libhamlib-4.def \machine:x86 -cd lib\msvc -c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def +If you use any other terminal then the full path to lib.exe is needed +(today it is +"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\lib.exe", +but is dependent on the version of MSVC which gets updated every few weeks). -NOTE: feedback is requested on the previous two command examples! +NOTE: feedback is requested on Phil's example! Please let know if this works +for you. The published Hamlib API may be found at: diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index 139581379..12a116cc6 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -185,47 +185,44 @@ Information for w64 Programmers The DLL has a cdecl interface. There is a libhamlib-4.def definition file for MS Visual C++/Visual Studio in -lib/msvc. Refer to the sample commands below to generate a local -libhamlib-4.lib file for use with the VC++/VS linker. +lib\msvc. Refer to the recipe below to generate a local libhamlib-4.lib file +for use with the VC++/VS linker. -Simply #include <hamlib/rig.h> (add directory to include path), include -libhamlib-4.lib in your project and you are done. Note: VC++/VS cannot -compile all the Hamlib code, but the API defined by rig.h has been made MSVC -friendly :-) +Simply '#include <hamlib/rig.h>' (pr any other header) (add directory to +include path), include libhamlib-4.lib in your project and you are done. Note: +VC++/VS cannot compile all the Hamlib code, but the API defined by rig.h has +been made MSVC friendly :-) As the source code for the library DLLs is licensed under the LGPL, your program is not considered a "derivative work" when using the published Hamlib API and normal linking to the front-end library, and may be of a license of your choosing. -As of 08 Sep 2022 a .lib file is generated using the MinGW dlltool utility. -If this file does not work for your project, follow the steps in the following -section: +As of 21 Jul 2025 a .lib file is generated using the MinGW dlltool utility. +This file is now installed to the lib\gcc-mingw directory. As it is generated +by the MinGW dlltool utility, it is only suitable for use with MinGW/GCC. -For linking the library with MS Visual C++ 2003, from the directory you -installed Hamlib run the following commands to generate the libhamlib-4.lib -file needed for linking with your MSVC project: +For developers using Microsoft Visual Studio, the following recipe is +provided by Phil Rose, GM3ZZA: -cd lib\msvc -c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\link.exe /lib /machine:amd64 /def:libhamlib-4.def +My secret sauce is: -To do the same for Visual Studio 2017: +Open "Developer PowerShell for VS2022" in administrator mode. This adds the +correct directory to the path and allows update of "C:\Program Files" with the +.dll. -cd lib\msvc -c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def +Then (in my case). -and for VS 2019: +cd "C:\Program Files\hamlib-w64-${RELEASE}\lib\msvc" +lib \def:libhamlib-4.def \machine:x64 -cd lib\msvc -c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def +If you use any other terminal then the full path to lib.exe is needed +(today it is +"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\lib.exe", +but is dependent on the version of MSVC which gets updated every few weeks). -NOTE: feedback is requested on the previous two command examples as these do -not appear to be correct to generate a 64 bit libhamlib-4.lib file! - -For VS 2022: - -cd lib/msvc -c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\lib.exe /lib /machine:i386 /def:libhamlib-4.def +NOTE: feedback is requested on Phil's example! Please let know if this works +for you. The published Hamlib API may be found at: commit fb2834afe8c01c163f5bd157170cc6e061899738 Author: Nate Bargmann <n0...@n0...> Date: Mon Jul 21 16:10:50 2025 -0500 Add info about the ZIP archive directory structure Rename the lib/gcc directory to lib/gcc-mingw. Output the dlltool generated .lib file to lib/gcc-mingw. This on advice from Jonathan Yong on the MinGW-W64 forum: https://sourceforge.net/p/mingw-w64/discussion/723798/thread/e23dceba20/?limit=25#51dd/3df2/3708/e62b diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index 4c4d3b08f..aac75633e 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -74,8 +74,8 @@ cat > README.w32-bin <<END_OF_README What is it? =========== -This ZIP archive or Windows installer contains a build of Hamlib-$RELEASE -cross-compiled for MS Windows 32 bit using MinGW under Debian GNU/Linux 10 +This ZIP archive or Windows installer contains a build of Hamlib-${RELEASE} +cross-compiled for MS Windows 32 bit using MinGW under Debian GNU/Linux 13 (nice, heh!). This software is copyrighted. The library license is LGPL, and the *.EXE files @@ -92,7 +92,21 @@ 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 +The archive directory structure is: + +hamlib-w32-4.7~git +├── bin +├── doc +├── include +│ └── hamlib +└── lib + ├── gcc-mingw + └── msvc + +The 'bin' and 'doc' directories will be of interest to users while developers +will be interested in the 'include' and 'lib' directories as well. + +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, Windows XP, and Windows 7 (need info on Vista and Windows 8/10) do the following: @@ -118,7 +132,7 @@ following: 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-w32-$RELEASE\bin + Append the Hamlib path, e.g. C:\Program Files\hamlib-w32-${RELEASE}\bin * Click OK for all three dialog boxes to save your changes. @@ -149,9 +163,9 @@ In short, the command syntax is of the form: 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 +To copy output text into a mailer or editor (Notepad++, a free editor also +licensed under the GPL is recommended), 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). @@ -221,7 +235,7 @@ Please report problems or success to ham...@li... Cheers, Stephane Fillod - F8CFE -Mike Black - W9MDB +Mike Black - W9MDB (SK) Nate Bargmann - N0NB http://www.hamlib.org @@ -240,7 +254,7 @@ END_OF_README make -j 4 install -mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc ${ZIP_DIR}/include ${ZIP_DIR}/doc +mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc-mingw ${ZIP_DIR}/include ${ZIP_DIR}/doc cp -a src/libhamlib.def ${ZIP_DIR}/lib/msvc/libhamlib-4.def todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/. @@ -274,7 +288,7 @@ do done cp -a ${INST_DIR}/bin/libhamlib-?.dll ${ZIP_DIR}/bin/. -cp -a ${INST_DIR}/lib/libhamlib.dll.a ${ZIP_DIR}/lib/gcc/. +cp -a ${INST_DIR}/lib/libhamlib.dll.a ${ZIP_DIR}/lib/gcc-mingw/. # NB: Strip Hamlib DLLs and EXEs ${HOST_ARCH_STRIP} ${ZIP_DIR}/bin/*.exe ${ZIP_DIR}/bin/*hamlib-*.dll @@ -318,7 +332,8 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi -# Generate .lib file for MSVC -${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib +# Generate .lib file for GCC on MinGW per Jonathan Yong from mingw-w64 +# https://sourceforge.net/p/mingw-w64/discussion/723798/thread/e23dceba20/?limit=25#51dd/3df2/3708/e62b +${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/gcc-mingw/libhamlib-4.lib /usr/bin/zip -r ${HL_FILENAME}.zip $(basename ${ZIP_DIR}) diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index 6841870e8..139581379 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -74,8 +74,8 @@ cat > README.w64-bin <<END_OF_README What is it? =========== -This ZIP archive or Windows installer contains a build of Hamlib-$RELEASE -cross-compiled for MS Windows 64 bit using MinGW under Debian GNU/Linux 10 +This ZIP archive or Windows installer contains a build of Hamlib-${RELEASE} +cross-compiled for MS Windows 64 bit using MinGW under Debian GNU/Linux 13 (nice, heh!). This software is copyrighted. The library license is LGPL, and the *.EXE files @@ -92,7 +92,21 @@ 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 +The archive directory structure is: + +hamlib-w64-4.7~git +├── bin +├── doc +├── include +│ └── hamlib +└── lib + ├── gcc-mingw + └── msvc + +The 'bin' and 'doc' directories will be of interest to users while developers +will be interested in the 'include' and 'lib' directories as well. + +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, Windows XP, and Windows 7 (need info on Vista and Windows 8/10) do the following: @@ -118,7 +132,7 @@ following: 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-w64-$RELEASE\bin + Append the Hamlib path, e.g. C:\Program Files\hamlib-w64-${RELEASE}\bin * Click OK for all three dialog boxes to save your changes. @@ -149,9 +163,9 @@ In short, the command syntax is of the form: 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 +To copy output text into a mailer or editor (Notepad++, a free editor also +licensed under the GPL is recommended), 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). @@ -227,7 +241,7 @@ Please report problems or success to ham...@li... Cheers, Stephane Fillod - F8CFE -Mike Black - W9MDB +Mike Black - W9MDB (SK) Nate Bargmann - N0NB http://www.hamlib.org @@ -246,7 +260,7 @@ END_OF_README make -j 4 install -mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc ${ZIP_DIR}/include ${ZIP_DIR}/doc +mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc-mingw ${ZIP_DIR}/include ${ZIP_DIR}/doc cp -a src/libhamlib.def ${ZIP_DIR}/lib/msvc/libhamlib-4.def todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/. @@ -280,7 +294,7 @@ do done cp -a ${INST_DIR}/bin/libhamlib-?.dll ${ZIP_DIR}/bin/. -cp -a ${INST_DIR}/lib/libhamlib.dll.a ${ZIP_DIR}/lib/gcc/. +cp -a ${INST_DIR}/lib/libhamlib.dll.a ${ZIP_DIR}/lib/gcc-mingw/. # NB: Strip Hamlib DLLs and EXEs ${HOST_ARCH_STRIP} ${ZIP_DIR}/bin/*.exe ${ZIP_DIR}/bin/*hamlib-*.dll @@ -324,7 +338,8 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi -# Generate .lib file for MSVC -${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib +# Generate .lib file for GCC on MinGW per Jonathan Yong from mingw-w64 +# https://sourceforge.net/p/mingw-w64/discussion/723798/thread/e23dceba20/?limit=25#51dd/3df2/3708/e62b +${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/gcc-mingw/libhamlib-4.lib /usr/bin/zip -r ${HL_FILENAME}.zip $(basename ${ZIP_DIR}) commit 41baedf9696668cae8a99b77f93606f6d89f6645 Author: Nate Bargmann <n0...@n0...> Date: Mon Jul 21 15:24:27 2025 -0500 Update Windows build scripts for Debian 13 diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index 9bf25dd93..4c4d3b08f 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -9,6 +9,10 @@ # See README.build-Windows for complete details. +# running 'file' against the resulting .DLL should return the following or similar: +# file libhamlib-4.dll +# libhamlib-4.dll: PE32 executable for MS Windows 4.00 (DLL), Intel i386 (stripped to external PDB), 10 sections + # Set this to a desired directory BUILD_DIR=~/builds @@ -307,6 +311,13 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi +# Required for MinGW with GCC 14 (Debian 13) +FILE="/usr/lib/gcc/i686-w64-mingw32/14-posix/libgcc_s_dw2-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + # Generate .lib file for MSVC ${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index 2215bc86b..6841870e8 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -9,6 +9,10 @@ # See README.build-Windows for complete details. +# running 'file' against the resulting .DLL should return the following or similar: +# file libhamlib-4.dll +# libhamlib-4.dll: PE32+ executable for MS Windows 5.02 (DLL), x86-64 (stripped to external PDB), 11 sections + # Set this to a desired directory BUILD_DIR=~/builds @@ -313,6 +317,13 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi +# Required for MinGW with GCC 14 (Debian 13) +FILE="/usr/lib/gcc/x86_64-w64-mingw32/14-posix/libgcc_s_seh-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + # Generate .lib file for MSVC ${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib ----------------------------------------------------------------------- Summary of changes: scripts/build-w32.sh | 95 +++++++++++++++++++++++++++++++----------------- scripts/build-w64.sh | 101 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 124 insertions(+), 72 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |