From eeea1997fc7fcf7efed9f53d310bd28d8951864a Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 12 Feb 2019 21:17:25 -0800 Subject: [PATCH 1/2] mingw windows build: Use configure'd toolchain for win32deps.pl --- Makefile.am | 2 +- win32deps.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 835cedb..9b7a78d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -110,7 +110,7 @@ winpkg: $(bin_PROGRAMS) cp .libs/stoken.exe winpkg/ if ENABLE_GUI cp .libs/stoken-gui.exe winpkg/ - cp `./win32deps.pl .libs/stoken-gui.exe` winpkg/ + cp `CC=$(CC) ./win32deps.pl .libs/stoken-gui.exe` winpkg/ cp gui/*.{ui,png} winpkg/ else cp .libs/stoken.exe winpkg/ diff --git a/win32deps.pl b/win32deps.pl index 5561a57..1f9161f 100755 --- a/win32deps.pl +++ b/win32deps.pl @@ -35,8 +35,8 @@ "setupapi.dll" => 1, ); -my $CC = "i686-w64-mingw32-gcc"; -my $OBJDUMP = "mingw-objdump"; +my $CC = $ENV{'CC'}; +my $OBJDUMP = $ENV{'OBJDUMP'} // $CC =~ s/-gcc$/-objdump/r; sub run($) { From c1436794fe081fbce7ee32a19b5e65b434ba7b4c Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 12 Feb 2019 21:18:46 -0800 Subject: [PATCH 2/2] README: Update mingw Windows build instructions Document working build on more recent version of Fedora. Use 64-bit build; Windows has been predominantly 64-bit for a decade. Document hacking in '-Wl,--subsystem,windows' to stoken-gui.exe build via GTK_LIBS in README, in order to run stoken-gui as a "Windows" mode application instead of a console application. I'd love a better approach here, but am not familiar enough with autotools to propose one. --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e0e1649..e4c573c 100644 --- a/README.md +++ b/README.md @@ -113,18 +113,17 @@ or maintained regularly. #### Initial setup -On a Fedora 20 PC (other versions may work as well), install the build +On a Fedora 28 PC (other versions may work as well), install the build dependencies: - yum groupinstall "Development Tools" - yum install git autoconf automake libtool mingw32-gnutls mingw32-libxml2 mingw32-gtk3 + dnf install git autoconf automake libtool mingw64-gnutls mingw64-libxml2 mingw64-gtk3 mingw64-binutils #### Compiling git clone git://github.com/cernekee/stoken cd stoken bash autogen.sh - mingw32-configure + mingw64-configure GTK_LIBS="$(x86_64-w64-mingw32-pkg-config --libs "gtk+-3.0") -Wl,--subsystem,windows" make winpkg If all goes well, you should be able to copy winpkg.zip to