|
| 1 | +PKG_CONFIG_NAME = freetype2 libpng libtiff-4 libjpeg |
| 2 | +PKG_CONFIG ?= $(BINPREF)pkg-config |
| 3 | +RAGG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME)) |
| 4 | + |
| 5 | +ifneq ($(RAGG_LIBS),) |
| 6 | +$(info using $(PKG_CONFIG_NAME) from Rtools) |
| 7 | +RAGG_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME)) |
| 8 | +else |
1 | 9 | RWINLIB = ../windows/harfbuzz |
| 10 | +RAGG_CFLAGS = -I$(RWINLIB)/include -I$(RWINLIB)/include/freetype2 |
| 11 | +RAGG_LIBS = -L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib -lfreetype -lharfbuzz -lfreetype -lpng -lz -ltiff -ljpeg -lbz2 -lrpcrt4 -lgdi32 -lws2_32 |
| 12 | +endif |
| 13 | + |
| 14 | +PKG_LIBS = -Lagg -lstatagg $(RAGG_LIBS) |
| 15 | +PKG_CPPFLAGS = -DSTRICT_R_HEADERS -I./agg/include $(RAGG_CFLAGS) |
2 | 16 |
|
3 | 17 | AGG_OBJECTS = agg/src/agg_curves.o agg/src/agg_font_freetype.o \ |
4 | 18 | agg/src/agg_image_filters.o agg/src/agg_trans_affine.o \ |
5 | 19 | agg/src/agg_vcgen_dash.o agg/src/agg_vcgen_stroke.o |
6 | 20 |
|
7 | | -PKG_CPPFLAGS = -DSTRICT_R_HEADERS \ |
8 | | --I$(RWINLIB)/include -I$(RWINLIB)/include/freetype2 \ |
9 | | --I./agg/include \ |
10 | | - |
11 | | -PKG_LIBS = -Lagg -lstatagg \ |
12 | | --L$(RWINLIB)/lib$(R_ARCH) -L$(RWINLIB)/lib \ |
13 | | --lfreetype -lharfbuzz -lfreetype -lpng -lz -ltiff -ljpeg \ |
14 | | --lbz2 -lrpcrt4 -lgdi32 -lws2_32 |
15 | | - |
16 | 21 | STATLIB = agg/libstatagg.a |
17 | 22 |
|
18 | | -all:clean winlibs |
| 23 | +all:$(SHLIB) |
19 | 24 |
|
20 | 25 | $(SHLIB): $(STATLIB) |
21 | 26 |
|
22 | 27 | $(STATLIB): $(AGG_OBJECTS) |
23 | 28 |
|
24 | | -winlibs: |
| 29 | +$(OBJECTS): $(RWINLIB) |
| 30 | + |
| 31 | +$(RWINLIB): |
25 | 32 | "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" |
26 | 33 |
|
27 | 34 | clean: |
28 | | -rm -f $(OBJECTS) $(STATLIB) $(SHLIB) $(AGG_OBJECTS) |
| 35 | +rm -f $(SHLIB) $(OBJECTS) $(AGG_OBJECTS) $(STATLIB) |