synch wiht TL 37823
[luatex.git] / source / texk / web2c / xetexdir / am / xetex.am
blob246e2e6f2f1f1a9f7ff38a2fd59ccc089b09632b
1 ## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX.
2 ##
3 ## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 ## XeTeX
7 ##
8 if XETEX
9 bin_PROGRAMS += xetex
10 endif XETEX
11 EXTRA_PROGRAMS += xetex
13 # Force Automake to use CXXLD for linking
14 nodist_EXTRA_xetex_SOURCES = dummy.cxx
16 xe_tangle = WEBINPUTS=.:$(srcdir)/xetexdir AM_V_P=$(AM_V_P) $(SHELL) ./tangle-sh $@ $(OTANGLE)
18 libxetex = libxetex.a
20 xetex_cppflags = $(AM_CPPFLAGS) -I$(srcdir)/xetexdir
21 ## Must add icu first to avoid an installed version.
22 xetex_cppflags += $(ICU_INCLUDES)
23 ## Must add freetype2 includes early to avoid
24 ## freetype1/freetype2 confusion -- what a mess.
25 xetex_cppflags += $(FREETYPE2_INCLUDES)
26 xetex_cppflags += $(TECKIT_INCLUDES)
27 xetex_cppflags += $(HARFBUZZ_INCLUDES)
28 xetex_cppflags += $(GRAPHITE2_INCLUDES)
29 xetex_cppflags += $(POPPLER_INCLUDES)
30 xetex_cppflags += $(LIBPNG_INCLUDES)
31 xetex_cppflags += $(ZLIB_INCLUDES)
32 xetex_cppflags += -I$(srcdir)/libmd5
33 xetex_ldadd = $(libxetex)
34 xetex_ldadd += $(HARFBUZZ_LIBS)
35 xetex_ldadd += $(GRAPHITE2_LIBS)
36 xetex_ldadd += $(ICU_LIBS)
37 xetex_ldadd += $(TECKIT_LIBS)
38 xetex_ldadd += $(POPPLER_LIBS)
39 xetex_ldadd += $(LIBPNG_LIBS)
40 xetex_ldadd += $(FREETYPE2_LIBS)
41 xetex_ldadd += $(ZLIB_LIBS)
42 xetex_ldadd += libmd5.a
43 xetex_dependencies = $(proglib)
44 xetex_dependencies += $(KPATHSEA_DEPEND)
45 xetex_dependencies += $(ICU_DEPEND)
46 xetex_dependencies += $(TECKIT_DEPEND)
47 xetex_dependencies += $(HARFBUZZ_DEPEND)
48 xetex_dependencies += $(GRAPHITE2_DEPEND)
49 xetex_dependencies += $(POPPLER_DEPEND)
50 xetex_dependencies += $(LIBPNG_DEPEND)
51 xetex_dependencies += $(FREETYPE2_DEPEND)
52 xetex_dependencies += $(ZLIB_DEPEND)
53 xetex_dependencies += libmd5.a
55 if XETEX_MACOSX
57 xetex_cppflags += -DXETEX_MAC
58 xetex_LDFLAGS = -framework ApplicationServices -framework Cocoa
60 else !XETEX_MACOSX
62 xetex_cppflags += $(FONTCONFIG_INCLUDES)
63 xetex_ldadd += $(FONTCONFIG_LIBS)
65 endif !XETEX_MACOSX
68 xetex_CPPFLAGS = $(xetex_cppflags)
69 xetex_CFLAGS = # $(WARNING_CFLAGS)
70 xetex_CXXFLAGS = # $(WARNING_CXXFLAGS)
72 ## With --enable-ipc, XeTeX may need to link with -lsocket.
73 xetex_LDADD = $(xetex_ldadd) $(LDADD) $(ipc_socketlibs)
75 # We must create libxetex.a etc before building the xetex_OBJECTS
76 xetex_prereq = $(libxetex) xetexdir/etex_version.h xetexdir/xetex_version.h
77 $(xetex_OBJECTS): $(xetex_prereq)
79 ## XeTeX C sources
80 xetex_c_h = xetexini.c xetex0.c xetexcoerce.h xetexd.h
81 nodist_xetex_SOURCES = $(xetex_c_h) xetex-pool.c
82 dist_xetex_SOURCES = xetexdir/xetexextra.c xetexdir/xetexextra.h \
83         xetexdir/etex_version.h xetexdir/xetex_version.h
85 $(xetex_c_h): xetex-web2c
86         @$(web2c) xetex
87 xetex-web2c: xetex.p $(web2c_texmf) xetexdir/xetex.defines
88         @$(web2c) xetex
90 xetex-pool.c: xetex.pool xetexd.h $(makecpool_stamp)
91         $(makecpool) xetex >$@ || rm -f $@
93 ## Tangling XeTeX
94 xetex.p xetex.pool: xetex-tangle
95         @$(xe_tangle) xetex xetex
96 xetex-tangle: otangle$(EXEEXT) xetexdir/xetex.web xetex.ch tangle-sh
97         @$(xe_tangle) xetex xetex
99 # Extract etex version
100 $(srcdir)/xetexdir/etex_version.h: @MAINTAINER_MODE_TRUE@ xetexdir/xetex.web
101         $(AM_V_GEN)grep '^@d eTeX_version_string==' $(srcdir)/xetexdir/xetex.web \
102           | sed "s/^.*'-/#define ETEX_VERSION \"/;s/'.*$$/\"/" >$@
104 ## Extract xetex version
105 $(srcdir)/xetexdir/xetex_version.h: @MAINTAINER_MODE_TRUE@ xetexdir/xetex.web
106         $(AM_V_GEN)grep '^@d XeTeX_version_string==' $(srcdir)/xetexdir/xetex.web \
107           | sed "s/^.*'-/#define XETEX_VERSION \"/;s/'.*$$/\"/" >$@
109 ## Generate xetex.ch
110 xetex.ch: tie$(EXEEXT) $(xetex_ch_srcs)
111         $(tie_c) $(xetex_ch_srcs)
112 xetex_ch_srcs = \
113         xetexdir/xetex.web \
114         xetexdir/tex.ch0 \
115         tex.ch \
116         $(xetex_ch_synctex) \
117         xetexdir/xetex.ch \
118         $(xetex_post_ch_synctex) \
119         tex-binpool.ch
122 EXTRA_DIST += $(xetex_web_srcs) $(xetex_ch_srcs) xetexdir/xetex.defines
124 DISTCLEANFILES += $(nodist_xetex_SOURCES) xetex.web xetex.ch xetex-web2c \
125         xetex.p xetex.pool xetex-tangle
128 ## libxetex
130 EXTRA_LIBRARIES += libxetex.a
132 libxetex_a_CPPFLAGS = $(xetex_cppflags)
133 libxetex_a_CFLAGS = # $(WARNING_CFLAGS)
134 libxetex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
135 libxetex_a_OBJCXXFLAGS = # $(WARNING_OBJCXXFLAGS)
137 libxetex_a_SOURCES = \
138         xetexdir/MathTable.h \
139         xetexdir/XeTeXFontInst.cpp \
140         xetexdir/XeTeXFontInst.h \
141         xetexdir/XeTeXFontMgr.cpp \
142         xetexdir/XeTeXFontMgr.h \
143         xetexdir/XeTeXLayoutInterface.cpp \
144         xetexdir/XeTeXLayoutInterface.h \
145         xetexdir/XeTeXOTMath.cpp \
146         xetexdir/XeTeXOTMath.h \
147         xetexdir/XeTeX_ext.c \
148         xetexdir/XeTeX_ext.h \
149         xetexdir/XeTeX_pic.c \
150         xetexdir/XeTeX_web.h \
151         xetexdir/XeTeXswap.h \
152         xetexdir/trans.c \
153         xetexdir/trans.h \
154         xetexdir/hz.cpp \
155         xetexdir/xetex.h \
156         xetexdir/pdfimage.cpp \
157         xetexdir/pdfimage.h \
158         xetexdir/image/bmpimage.c \
159         xetexdir/image/bmpimage.h \
160         xetexdir/image/jpegimage.c \
161         xetexdir/image/jpegimage.h \
162         xetexdir/image/mfileio.c \
163         xetexdir/image/mfileio.h \
164         xetexdir/image/numbers.c \
165         xetexdir/image/numbers.h \
166         xetexdir/image/pngimage.c \
167         xetexdir/image/pngimage.h
169 if XETEX_MACOSX
171 libxetex_a_SOURCES += \
172         xetexdir/XeTeXFontInst_Mac.cpp \
173         xetexdir/XeTeXFontInst_Mac.h \
174         xetexdir/XeTeXFontMgr_Mac.mm \
175         xetexdir/XeTeXFontMgr_Mac.h \
176         xetexdir/XeTeX_mac.c
178 else !XETEX_MACOSX
180 libxetex_a_SOURCES += \
181         xetexdir/XeTeXFontMgr_FC.cpp \
182         xetexdir/XeTeXFontMgr_FC.h
184 endif !XETEX_MACOSX
186 # We must create xetexd.h etc. before building the libxetex_a_OBJECTS.
187 libxetex_prereq = xetexd.h $(xetex_dependencies)
188 $(libxetex_a_OBJECTS): $(libxetex_prereq)
190 EXTRA_DIST += \
191         xetexdir/ChangeLog \
192         xetexdir/COPYING \
193         xetexdir/NEWS \
194         xetexdir/image/README \
195         xetexdir/unicode-char-prep.pl \
196         xetexdir/xewebmac.tex
198 # XeTeX Tests
200 xetex_tests = \
201         xetexdir/xetex-bug73.test \
202         xetexdir/xetex.test
204 EXTRA_DIST += $(xetex_tests)
206 if XETEX
207 TESTS += $(xetex_tests)
208 endif XETEX
210 ## xetex-bug73.test
211 EXTRA_DIST += xetexdir/tests/bug73.log xetexdir/tests/bug73.tex
212 DISTCLEANFILES += bug73.fmt bug73.log bug73.out bug73.tex