summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILDING22
-rw-r--r--Makefile9
-rw-r--r--config.mk9
3 files changed, 31 insertions, 9 deletions
diff --git a/BUILDING b/BUILDING
new file mode 100644
index 0000000..9932d30
--- /dev/null
+++ b/BUILDING
@@ -0,0 +1,22 @@
+To cross compile for Windows, the following needs to be done:
+
+1) Download the needed build dependencies from
+ https://njw.name/getxbook/win-build-deps.20211103.tar.xz
+ and unpack them into the getxbook directory
+
+2) Uncomment all lines under 'mingw' in config.mk
+
+Then 'make' and 'make dist-win' should all work as expected
+
+---
+
+# More information about the necessary files for Windows builds
+
+OpenSSL is needed to link the windows builds to, as mingw doesn't include it. This needs to be cross compiled with mingw by running the following from an OpenSSL source directory:
+ ./Configure mingw --cross-compile-prefix=i686-w64-mingw32-
+ make
+
+Tclkit and SDX are used to create a self contained executable with the GUI and all needed tools. Unfortunately these days working builds are difficult to find. Two different versions of Tclkit are required: a native one, to get the SDX packer to work, and a Windows version including Tk, to package into the final executable.
+ Both Tclkits can be downloaded from: http://tclkits.rkeene.org/fossil/wiki/Downloads
+ sdx can be downloaded from: https://chiselapp.com/user/aspect/repository/sdx/index
+
diff --git a/Makefile b/Makefile
index b697fd2..c659ba6 100644
--- a/Makefile
+++ b/Makefile
@@ -89,18 +89,18 @@ getxbookgui.exe: getxbookgui.tcl
echo STARPACK $@
sed 's/ icons/ .. icons/' < getxbookgui.tcl > getxbookgui-win.tcl
sed -i '/^\tset cmd / i set cmdbin [file join tools $$cmdbin]' getxbookgui-win.tcl
- sdx qwrap getxbookgui-win.tcl getxbookgui
- sdx unwrap getxbookgui.kit
+ $(SDX) qwrap getxbookgui-win.tcl getxbookgui
+ $(SDX) unwrap getxbookgui.kit
cp -f getxbook.ico getxbookgui.vfs/tclkit.ico
echo 'FileDescription "Book downloader"' > getxbookgui.vfs/tclkit.inf
- sdx wrap $@ -runtime $(W32TCLKIT)
+ $(SDX) wrap $@ -runtime $(W32TCLKIT)
rm -r getxbookgui-win.tcl getxbookgui.kit getxbookgui.vfs
# needs config.mk set up to use mingw
dist-win: $(BIN) $(GUI:.tcl=.exe)
mkdir -p $(NAME)-win/tools
cp $(GUI:.tcl=.exe) $(NAME)-win
- for f in $(BIN); do cp $$f $(NAME)-win/tools/$$f.exe; done
+ for f in $(BIN); do cp $$f.exe $(NAME)-win/tools/$$f.exe; done
mkdir -p $(NAME)-win/icons
cp icons/* $(NAME)-win/icons/
for f in LEGAL README COPYING; do \
@@ -110,7 +110,6 @@ dist-win: $(BIN) $(GUI:.tcl=.exe)
groff -m man -T utf8 < $$f | col -bx | sed 's/$$/\r/g' > $(NAME)-win/tools/$$b.txt; done
mv $(NAME)-win/tools/getxbookgui.txt $(NAME)-win/
cd $(NAME)-win; zip -r ../$(NAME)-$(VERSION)-win.zip .;cd ..
- gpg -b < $(NAME)-$(VERSION)-win.zip > $(NAME)-$(VERSION)-win.zip.sig
rm -rf $(NAME)-win
echo $(NAME)-$(VERSION)-win.zip $(NAME)-$(VERSION)-win.zip.sig
diff --git a/config.mk b/config.mk
index b8065c2..aacdeb6 100644
--- a/config.mk
+++ b/config.mk
@@ -12,8 +12,6 @@ LIBS = -lssl -lcrypto
CFLAGS = -std=c99 -pedantic -Wall -Wextra -g -D_POSIX_C_SOURCE=200112L \
-DVERSION=\"$(VERSION)\" -I$(OPENSSL)/include
-W32TCLKIT = tclkit-8.5.9-win32.upx.exe
-
# glibc dynamic
CC = cc
LDFLAGS = $(LIBS)
@@ -23,9 +21,12 @@ LDFLAGS = $(LIBS)
#LDFLAGS = $(LIBS) -L$(OPENSSL) -static #-s
# mingw
+#W32TCLKIT = win-build-deps/tclkit-gui-8_6_11-twapi-4_5_2-x86-max.exe
+#OPENSSLDIR = win-build-deps/openssl-1.1.1l
+#SDX = ./win-build-deps/sdx
#CC = i686-w64-mingw32-gcc
#AR = i686-w64-mingw32-ar
-#CFLAGS = -ansi -Wall -DVERSION=\"$(VERSION)\" -DWINVER=0x0501
-#LDFLAGS = $(LIBS) -lws2_32
+#CFLAGS = -ansi -Wall -DVERSION=\"$(VERSION)\" -DWINVER=0x0501 -I$(OPENSSLDIR)/include
+#LDFLAGS = -L$(OPENSSLDIR) $(LIBS) -lws2_32 -static
LD = $(CC)