diff --git a/.gitignore b/.gitignore index b112d0a..ca68cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /src/parser.h /src/parser.c /doc/boxes.1 +/pcre2-*/ # Linux Packaging doc/*.tar.gz diff --git a/Makefile b/Makefile index 919bd7e..b4162ce 100644 --- a/Makefile +++ b/Makefile @@ -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) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Makefile b/src/Makefile index 02fcf22..8bf0429 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/boxes.c b/src/boxes.c index 67320cb..ddea9a9 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -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");