summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/xetexdir/am/xetex.am
blob: bd9f2bffc121564864cad7f60a74cca34d530351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX.
##
## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.

## XeTeX
##
if XETEX
bin_PROGRAMS += xetex
endif XETEX
EXTRA_PROGRAMS += xetex

## Force Automake to use CXXLD for linking
nodist_EXTRA_xetex_SOURCES = dummy.cxx

libxetex = libxetex.a

xetex_cppflags = -DU_STATIC_IMPLEMENTATION -I$(srcdir)/xetexdir
## Must add freetype2 includes as early as possible to avoid
## freetype1/freetype2 confusion -- what a mess.
xetex_cppflags += $(FREETYPE2_INCLUDES)
xetex_cppflags += $(ICU_INCLUDES) $(TECKIT_INCLUDES)
xetex_ldadd = $(libxetex) $(ICU_LIBS) $(TECKIT_LIBS)
xetex_dependencies = $(proglib)
xetex_dependencies += $(ICU_DEPEND) $(TECKIT_DEPEND)

if XETEX_MACOSX

xetex_cppflags += -DXETEX_MAC
xetex_LDFLAGS = -framework Carbon -framework Cocoa -framework QuickTime

## Extra library for the Objective C++ file xetexdir/XeTeXFontMgr_Mac.mm.
libxetex += libxetexmm.a

else !XETEX_MACOSX

xetex_cppflags += -DXETEX_OTHER
xetex_cppflags += $(XPDF_INCLUDES) $(LIBPNG_INCLUDES) $(FONTCONFIG_INCLUDES)
xetex_ldadd += $(XPDF_LIBS) $(LIBPNG_LIBS) $(FONTCONFIG_LIBS)
xetex_dependencies += $(XPDF_DEPEND) $(LIBPNG_DEPEND)

endif !XETEX_MACOSX

if XETEX_GRAPHITE

xetex_cppflags += -DXETEX_GRAPHITE $(GRAPHITE_INCLUDES)
xetex_ldadd += $(GRAPHITE_LIBS)
xetex_dependencies += $(GRAPHITE_DEPEND)

endif XETEX_GRAPHITE

xetex_cppflags += $(ZLIB_INCLUDES)
xetex_ldadd += $(FREETYPE2_LIBS) $(ZLIB_LIBS)
xetex_dependencies += $(FREETYPE2_DEPEND) $(ZLIB_DEPEND)

xetex_CPPFLAGS = $(xetex_cppflags)

## With --enable-ipc, XeTeX may need to link with -lsocket.
xetex_LDADD = $(xetex_ldadd) $(LDADD) $(ipc_socketlibs)

xetex_DEPENDENCIES = $(xetex_dependencies) $(libxetex)

## XeTeX C sources
xetex_c_h = xetexini.c xetex0.c xetex1.c xetex2.c xetexcoerce.h xetexd.h
nodist_xetex_SOURCES = $(xetex_c_h) xetex_pool.c xetexextra.c xetexdir/xetexextra.h

$(xetex_c_h): xetex-web2c
xetex-web2c: xetex.p $(web2c_texmf) xetexdir/xetex.defines
	$(web2c) xetex
	: $(synctex_convert_xetex)
	echo timestamp >$@
	touch $(xetex_c_h)

xetex_pool.c: xetex.pool xetexd.h
	perl $(srcdir)/xetexdir/pool2c.pl $< $@

xetexextra.c: xetexdir/xetexextra.h lib/texmfmp.c xetexd.h
	sed s/TEX-OR-MF-OR-MP/xetex/ $(srcdir)/lib/texmfmp.c >$@

xetexdir/xetexextra.h: xetexdir/xetexextra.in xetexdir/xetex.version xetexdir/etex.version
	$(mkdir_p) xetexdir
	sed -e s/XETEX-VERSION/`cat xetexdir/xetex.version`/ \
	    -e s/ETEX-VERSION/`cat xetexdir/etex.version`/ \
	  $(srcdir)/xetexdir/xetexextra.in >$@

## Tangling XeTeX
xetex.p xetex.pool: xetex-tangle
xetex-tangle: ./otangle$(EXEEXT) xetex.web
	$(otangle) xetex
	echo timestamp >$@
	touch xetex.p xetex.pool

## Extract etex version
xetexdir/etex.version: etexdir/etex.ch
	$(mkdir_p) xetexdir
	grep '^@d eTeX_version_string==' $(srcdir)/etexdir/etex.ch \
	  | sed "s/^.*'-//;s/'.*$$//" >$@

## Extract xetex version
xetexdir/xetex.version: xetexdir/xetex.ch
	$(mkdir_p) xetexdir
	grep '^@d XeTeX_version_string==' $(srcdir)/xetexdir/xetex.ch \
	  | sed "s/^.*'-//;s/'.*$$//" >$@

## Generate xetex.web
xetex.web: tie$(EXEEXT) $(xetex_web_srcs)
	$(tie) -m xetex.web $(xetex_web_srcs)

xetex_web_srcs = \
	tex.web \
	etexdir/etex.ch \
	etexdir/tex.ch0 \
	tex.ch \
	etexdir/tex.ch1 \
	etexdir/tex.ech \
	$(xetex_ch_synctex) \
	xetexdir/xetex.ch \
	$(xetex_post_ch_synctex)
##
EXTRA_DIST += $(xetex_web_srcs) xetexdir/xetex.defines xetexdir/xetexextra.in

DISTCLEANFILES += $(nodist_xetex_SOURCES) xetex.web xetex-web2c \
	xetex.p xetex.pool xetex-tangle xetexdir/etex.version xetexdir/xetex.version

EXTRA_DIST += \
	xetexdir/pool2c.pl \
	xetexdir/unicode-char-prep.pl

## libxetex
##
EXTRA_LIBRARIES += libxetex.a

libxetex_a_CPPFLAGS = $(xetex_cppflags)

libxetex_a_SOURCES = \
	xetexdir/MathTable.h \
	xetexdir/FontTableCache.cpp \
	xetexdir/FontTableCache.h \
	xetexdir/XeTeXFontInst.cpp \
	xetexdir/XeTeXFontInst.h \
	xetexdir/XeTeXFontInst_FT2.cpp \
	xetexdir/XeTeXFontInst_FT2.h \
	xetexdir/XeTeXFontMgr.cpp \
	xetexdir/XeTeXFontMgr.h \
	xetexdir/XeTeXLayoutInterface.cpp \
	xetexdir/XeTeXLayoutInterface.h \
	xetexdir/XeTeXOTLayoutEngine.cpp \
	xetexdir/XeTeXOTLayoutEngine.h \
	xetexdir/XeTeXOTMath.cpp \
	xetexdir/XeTeXOTMath.h \
	xetexdir/XeTeX_ext.c \
	xetexdir/XeTeX_ext.h \
	xetexdir/XeTeXswap.h \
	xetexdir/cmaps.cpp \
	xetexdir/cmaps.h \
	xetexdir/sfnt.h \
	xetexdir/trans.c \
	xetexdir/trans.h \
	xetexdir/xetex.h

## included by xetexdir/XeTeXLayoutInterface.cpp
EXTRA_DIST += xetexdir/appleGlyphNames.c

if XETEX_MACOSX

libxetex_a_SOURCES += \
	xetexdir/XeTeXFontInst_Mac.cpp \
	xetexdir/XeTeXFontInst_Mac.h \
	xetexdir/XeTeX_mac.c

else !XETEX_MACOSX

libxetex_a_SOURCES += \
	xetexdir/XeTeXFontMgr_FC.cpp \
	xetexdir/XeTeXFontMgr_FC.h \
	xetexdir/XeTeX_pic.c \
	xetexdir/bmpimage.c \
	xetexdir/bmpimage.h \
	xetexdir/jpegimage.c \
	xetexdir/jpegimage.h \
	xetexdir/mfileio.c \
	xetexdir/mfileio.h \
	xetexdir/numbers.c \
	xetexdir/numbers.h \
	xetexdir/pdfimage.cpp \
	xetexdir/pdfimage.h \
	xetexdir/pngimage.c \
	xetexdir/pngimage.h

endif !XETEX_MACOSX

if XETEX_GRAPHITE

libxetex_a_SOURCES += \
	xetexdir/XeTeXGrLayout.cpp \
	xetexdir/XeTeXGrLayout.h

endif XETEX_GRAPHITE

# We must create xetexd.h before building the libxetex_a_OBJECTS.
$(libxetex_a_OBJECTS): xetexd.h

## libxetexmm (Mac OS X only)
##
## Automake (1.10.2) does not generate a rule to compile
## the Objective C++ file xetexdir/XeTeXFontMgr_Mac.mm.
## Since this file is to be compiled with '$(CXX) -ObjC++' we provide a
## C++ wrapper xetexdir/XeTeXFontMgr_Mac.cpp including the Objective C++ file.
## Since Automake does not allow to specify CXXFLAGS for inividual objects,
## we use an additional library libxetexmm.a.
EXTRA_LIBRARIES += libxetexmm.a

libxetexmm_a_CPPFLAGS = $(xetex_cppflags)

libxetexmm_a_CXXFLAGS = -ObjC++

libxetexmm_a_SOURCES = \
	xetexdir/XeTeXFontMgr_Mac.cpp \
	xetexdir/XeTeXFontMgr_Mac.h

## included by xetexdir/XeTeXFontMgr_Mac.cpp
EXTRA_DIST += xetexdir/XeTeXFontMgr_Mac.mm

EXTRA_DIST += \
	xetexdir/ChangeLog

## Not used
##
EXTRA_DIST += \
	xetexdir/LICENSE.txt

## Eventually delete these files
##
EXTRA_DIST += \
	xetexdir/acx_pthread.m4 \
	xetexdir/tests.ac \
	xetexdir/withenable.ac \
	xetexdir/xetex.mk