Enable Windows build with new unicode-enabled version under MinGW #1

This commit is contained in:
Thomas Jensen 2021-02-12 21:11:45 +01:00
parent f4f14cdc61
commit 7532faf755
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
4 changed files with 17 additions and 4 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@
/src/parser.h
/src/parser.c
/doc/boxes.1
/pcre2-*/
# Linux Packaging
doc/*.tar.gz

View File

@ -20,6 +20,7 @@
# The following line (GLOBALCONF) is the only line you should need to edit!
GLOBALCONF = /usr/share/boxes
# TODO update git call
GIT_STATUS = ($(shell git rev-parse --short HEAD)$(shell if [ $$(git status -s -uall | wc -l) -ge 1 ] ; then echo ", dirty" ; fi))
BVERSION = 1.3.1-SNAPSHOT
@ -27,6 +28,9 @@ ALL_FILES = LICENSE README.md README.Win32.md boxes-config
DOC_FILES = doc/boxes.1 doc/boxes.el
PKG_NAME = boxes-$(BVERSION)
WIN_PCRE2_VERSION = 10.36
WIN_PCRE2_DIR = pcre2-$(WIN_PCRE2_VERSION)
.PHONY: clean build win32 debug win32.debug infomsg replaceinfos test package win32.package package_common
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -35,10 +39,18 @@ build debug: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=unix $@
win32: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=win32 build
$(MAKE) -C src BOXES_PLATFORM=win32 C_INCLUDE_PATH=../$(WIN_PCRE2_DIR)/src LDFLAGS=-L../$(WIN_PCRE2_DIR)/.libs build
win32.debug: infomsg replaceinfos
$(MAKE) -C src BOXES_PLATFORM=win32 debug
$(MAKE) -C src BOXES_PLATFORM=win32 C_INCLUDE_PATH=../$(WIN_PCRE2_DIR)/src LDFLAGS=-L../$(WIN_PCRE2_DIR)/.libs debug
win32.pcre:
# build the pcre2 dependency (only needed on Windows MinGW)
curl -LO https://ftp.pcre.org/pub/pcre/$(WIN_PCRE2_DIR).tar.gz
tar xfz $(WIN_PCRE2_DIR).tar.gz
cd $(WIN_PCRE2_DIR)
./configure --disable-pcre2-8 --disable-pcre2-16 --enable-pcre2-32 --disable-shared --enable-never-backslash-C --enable-newline-is-anycrlf
$(MAKE)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -50,7 +50,7 @@ boxes: $(ALL_OBJ)
if [ "$(STRIP)" = "true" ] ; then strip $(BOXES_EXECUTABLE_NAME) ; fi
boxes.exe: $(ALL_OBJ)
$(CC) $(LDFLAGS) $(ALL_OBJ) -o $(BOXES_EXECUTABLE_NAME) -lkernel32
$(CC) $(LDFLAGS) $(ALL_OBJ) -o $(BOXES_EXECUTABLE_NAME) -lkernel32 -l:libunistring.a -l:libpcre2-32.a -l:libiconv.a
if [ "$(STRIP)" = "true" ] ; then strip $(BOXES_EXECUTABLE_NAME) ; fi

View File

@ -106,7 +106,7 @@ static void usage(FILE *st)
fprintf(st, " -k bool leading/trailing blank line retention on removal\n");
fprintf(st, " -l list available box designs w/ samples\n");
fprintf(st, " -m mend box, i.e. remove it and redraw it afterwards\n");
fprintf(st, " -n enc Character encoding of input and output\n");
fprintf(st, " -n enc Character encoding of input and output [default: %s]\n", locale_charset());
fprintf(st, " -p fmt padding [default: none]\n");
/* fprintf(st, " -q modify command for needs of the web UI (undocumented)\n"); */
fprintf(st, " -r remove box\n");