From 64c2bc27b33ddd8e0d625aeea129b72c087560c6 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 18 Apr 2020 22:44:02 -0500 Subject: [PATCH] Update build-win32 and build-win64 to allow for different version of linkers --- scripts/build-w32.sh | 22 +++++++++++++++++----- scripts/build-w64.sh | 21 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index 9b818cdbb..0c760c0e7 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -222,23 +222,35 @@ cp -a /usr/i686-w64-mingw32/lib/libwinpthread-1.dll ${ZIP_DIR}/bin/. cp -a ${LIBUSB_1_0_BIN_PATH}/MinGW32/dll/libusb-1.0.dll ${ZIP_DIR}/bin/libusb-1.0.dll # Required for MinGW with GCC 6.3 -FILE= /usr/lib/gcc/i686-w64-mingw32/6.3-posix/libgcc_s_sjlj-1.dll +FILE="/usr/lib/gcc/i686-w64-mingw32/6.3-posix/libgcc_s_sjlj-1.dll" if test -f "$FILE"; then cp -a /usr/lib/gcc/i686-w64-mingw32/6.3-posix/libgcc_s_sjlj-1.dll ${ZIP_DIR}/bin/libgcc_s_sjlj-1.dll cp -a ${FILE} ${ZIP_DIR}/bin/libgcc_s_sjlj-1.dll fi # Required for MinGW with GCC 8.3 -FILE= /usr/lib/gcc/i686-w64-mingw32/8.3-posix/libgcc_s_sjlj-1.dll +FILE="/usr/lib/gcc/i686-w64-mingw32/8.3-posix/libgcc_s_sjlj-1.dll" if test -f "$FILE"; then cp -a ${FILE} ${ZIP_DIR}/bin/libgcc_s_sjlj-1.dll fi +pushd . +cd ${ZIP_DIR}/lib/msvc/ ## Need VC++ free toolkit installed (default Wine directory installation shown) # Path for 2003 version of Visual C++ Toolkit -#( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:i386 /def:libhamlib-4.def ) +#wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:i386 /def:libhamlib-4.def # Path for 2017 version of Visual Studio -( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_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 ) +wine ~/.wine/drive_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 +if [ $? -ne 0 ];then +echo Did not find 2017 link.exe...trying 2019 # Path for 2019 version Visual Studio Community -#( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_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 ) +wine ~/.wine/drive_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 +fi +if [ $? -ne 0 ]; then +echo Cannot find MSVC link executable!! +echo You must put in your own path in here +popd +exit 1 +fi +popd /usr/bin/zip -r ${HL_FILENAME}.zip `basename ${ZIP_DIR}` diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index cf6b6a17a..ff702019f 100644 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -234,14 +234,29 @@ if test -f "$FILE"; then cp -a ${FILE} ${ZIP_DIR}/bin/libgcc_s_sjlj-1.dll fi -## 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:amd64 /def:libhamlib-4.def ) +pushd . +cd ${ZIP_DIR}/lib/msvc/ ## Need VC++ free toolkit installed (default Wine directory installation shown) -# Path for 2003 version of Visual C++ Toolkit +wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:amd64 /def:libhamlib-4.def + +## Need VC++ free toolkit installed (default Wine directory installation shown) +# Path for 2003 version of Visual C++ Toolkit -- anybody have this anymore? +# Commented out 20200418 #( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_c/Program\ Files/Microsoft\ Visual\ C++\ Toolkit\ 2003/bin/link.exe /lib /machine:i386 /def:libhamlib-4.def ) +if [ $? -ne 0 ];then # Path for 2017 version of Visual Studio ( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_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 ) +fi +if [ $? -ne 0 ];then +echo Did not find 2017 link.exe...trying 2019 # Path for 2019 version Visual Studio Community #( cd ${ZIP_DIR}/lib/msvc/ && wine ~/.wine/drive_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 ) +#else +echo Cannot find MSVC link executable!! +echo You must put in your own path in here +popd +exit 1 +fi +popd /usr/bin/zip -r ${HL_FILENAME}.zip `basename ${ZIP_DIR}`