Skip to content

Commit

Permalink
#501 attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Nov 21, 2023
1 parent 4c9f0e6 commit 8525e39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/r-check-other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- {os: macOS-latest, r: 'oldrel-4'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel-4'}
- {os: windows-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'oldrel-4'}

Expand Down
30 changes: 17 additions & 13 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
## Copyright (c) 2013-2023, Marek Gagolewski <https://www.gagolewski.com/>


#CXX_STD=CXX11
.PHONY: all

PKG_LIBS=-L. -licu_stubdata -licu_common -licu_i18n

PKG_CPPFLAGS=-I. -Iicu74/ -Iicu74/unicode -Iicu74/common -Iicu74/i18n \
-DUCONFIG_USE_LOCAL \
Expand All @@ -18,36 +20,38 @@ PKG_CPPFLAGS=-I. -Iicu74/ -Iicu74/unicode -Iicu74/common -Iicu74/i18n \
# 0x0A00 == Windows 10
# ICU 69 uses LOCALE_ALLOW_NEUTRAL_NAMES which is Windows 7 and later


## There is(*) a Cygwin bug which reports "mem alloc error" while linking
## too many .o files at once (I suppose this is the reason, at least).
## Thus, below we split the build process into a few parts using static libs.
## Voila, it's fixed.
## (*) Have been, in 2013. Haven't tested that ever since. No need to.


STRI_SOURCES_CPP=$(wildcard stri_*.cpp)
STRI_OBJECTS=$(STRI_SOURCES_CPP:.cpp=.o)

stringi_objs.a: $(STRI_OBJECTS)


ICU_STUBDATA_SOURCES_CPP=$(wildcard icu74/stubdata/*.cpp)
ICU_STUBDATA_OBJECTS=$(ICU_STUBDATA_SOURCES_CPP:.cpp=.o)

ICU_COMMON_SOURCES_CPP=$(wildcard icu74/common/*.cpp)
ICU_COMMON_OBJECTS=$(ICU_COMMON_SOURCES_CPP:.cpp=.o)
libicu_stubdata.a: $(ICU_STUBDATA_OBJECTS)

ICU_I18N_SOURCES_CPP=$(wildcard icu74/i18n/*.cpp)
ICU_I18N_OBJECTS=$(ICU_I18N_SOURCES_CPP:.cpp=.o)

OBJECTS=$(STRI_OBJECTS)
ICU_COMMON_SOURCES_CPP=$(wildcard icu74/common/*.cpp)
ICU_COMMON_OBJECTS=$(ICU_COMMON_SOURCES_CPP:.cpp=.o)

.PHONY: all
libicu_common.a: $(ICU_COMMON_OBJECTS)

all: $(SHLIB)

$(SHLIB): $(OBJECTS) libicu_stubdata.a libicu_common.a libicu_i18n.a
ICU_I18N_SOURCES_CPP=$(wildcard icu74/i18n/*.cpp)
ICU_I18N_OBJECTS=$(ICU_I18N_SOURCES_CPP:.cpp=.o)

PKG_LIBS=-L. -licu_stubdata -licu_common -licu_i18n
libicu_i18n.a: $(ICU_I18N_OBJECTS)

libicu_stubdata.a: $(ICU_STUBDATA_OBJECTS)

libicu_common.a: $(ICU_COMMON_OBJECTS)
$(SHLIB): stringi_objs.a libicu_stubdata.a libicu_common.a libicu_i18n.a

libicu_i18n.a: $(ICU_I18N_OBJECTS)
all: $(SHLIB)

0 comments on commit 8525e39

Please sign in to comment.