| 1 |
## $Id: xetex.am 73613 2025-01-27 22:01:50Z karl $ |
| 2 |
## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX. |
| 3 |
## |
| 4 |
## Copyright 2017-2025 Karl Berry <[email protected]> |
| 5 |
## Copyright 2009-2015 Peter Breitenlohner <[email protected]> |
| 6 |
## You may freely use, modify and/or distribute this file. |
| 7 |
|
| 8 |
## XeTeX |
| 9 |
## |
| 10 |
if XETEX |
| 11 |
bin_PROGRAMS += xetex |
| 12 |
endif XETEX |
| 13 |
EXTRA_PROGRAMS += xetex |
| 14 |
|
| 15 |
# Force Automake to use CXXLD for linking |
| 16 |
nodist_EXTRA_xetex_SOURCES = dummy.cxx |
| 17 |
|
| 18 |
xe_tangle = WEBINPUTS=.:$(srcdir)/xetexdir AM_V_P=$(AM_V_P) $(SHELL) ./tangle-sh $@ $(OTANGLE) |
| 19 |
|
| 20 |
libxetex = libxetex.a |
| 21 |
|
| 22 |
xetex_cppflags = $(AM_CPPFLAGS) -I$(srcdir)/xetexdir |
| 23 |
## Must add icu first to avoid an installed version. |
| 24 |
xetex_cppflags += $(ICU_INCLUDES) |
| 25 |
## Must add freetype2 includes early to avoid |
| 26 |
## freetype1/freetype2 confusion -- what a mess. |
| 27 |
xetex_cppflags += $(FREETYPE2_INCLUDES) |
| 28 |
xetex_cppflags += $(TECKIT_INCLUDES) |
| 29 |
xetex_cppflags += $(HARFBUZZ_INCLUDES) |
| 30 |
xetex_cppflags += $(GRAPHITE2_INCLUDES) |
| 31 |
xetex_cppflags += $(LIBPNG_INCLUDES) |
| 32 |
xetex_cppflags += $(ZLIB_INCLUDES) |
| 33 |
xetex_cppflags += $(PPLIB_INCLUDES) |
| 34 |
xetex_cppflags += -I$(srcdir)/libmd5 |
| 35 |
xetex_ldadd = $(libxetex) |
| 36 |
xetex_ldadd += $(HARFBUZZ_LIBS) |
| 37 |
xetex_ldadd += $(GRAPHITE2_LIBS) |
| 38 |
xetex_ldadd += $(ICU_LIBS) $(ICU_LIBS_EXTRA) |
| 39 |
xetex_ldadd += $(TECKIT_LIBS) |
| 40 |
xetex_ldadd += $(LIBPNG_LIBS) |
| 41 |
xetex_ldadd += $(FREETYPE2_LIBS) |
| 42 |
xetex_ldadd += $(PPLIB_LIBS) |
| 43 |
xetex_ldadd += $(ZLIB_LIBS) |
| 44 |
xetex_ldadd += libmd5.a |
| 45 |
xetex_dependencies = $(proglib) |
| 46 |
xetex_dependencies += $(KPATHSEA_DEPEND) |
| 47 |
xetex_dependencies += $(ICU_DEPEND) |
| 48 |
xetex_dependencies += $(TECKIT_DEPEND) |
| 49 |
xetex_dependencies += $(HARFBUZZ_DEPEND) |
| 50 |
xetex_dependencies += $(GRAPHITE2_DEPEND) |
| 51 |
xetex_dependencies += $(LIBPNG_DEPEND) |
| 52 |
xetex_dependencies += $(FREETYPE2_DEPEND) |
| 53 |
xetex_dependencies += $(ZLIB_DEPEND) |
| 54 |
xetex_dependencies += $(PPLIB_DEPEND) |
| 55 |
xetex_dependencies += libmd5.a |
| 56 |
|
| 57 |
if XETEX_MACOSX |
| 58 |
xetex_cppflags += -DXETEX_MAC |
| 59 |
xetex_LDFLAGS = -framework ApplicationServices -framework Cocoa |
| 60 |
OBJCXXFLAGS += -std=c++11 |
| 61 |
|
| 62 |
else !XETEX_MACOSX |
| 63 |
xetex_cppflags += $(FONTCONFIG_INCLUDES) |
| 64 |
xetex_ldadd += $(FONTCONFIG_LIBS) |
| 65 |
|
| 66 |
endif !XETEX_MACOSX |
| 67 |
|
| 68 |
xetex_CPPFLAGS = $(xetex_cppflags) |
| 69 |
xetex_CFLAGS = $(WARNING_CFLAGS) |
| 70 |
xetex_CXXFLAGS = # $(WARNING_CXXFLAGS) |
| 71 |
|
| 72 |
## With --enable-ipc, XeTeX may need to link with -lsocket. |
| 73 |
xetex_LDADD = $(xetex_ldadd) $(LDADD) $(ipc_socketlibs) |
| 74 |
|
| 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) |
| 78 |
|
| 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 |
| 84 |
|
| 85 |
$(xetex_c_h): xetex-web2c |
| 86 |
@$(web2c) xetex |
| 87 |
xetex-web2c: xetex.p $(web2c_texmf) xetexdir/xetex.defines |
| 88 |
@$(web2c) xetex |
| 89 |
|
| 90 |
xetex-pool.c: xetex.pool xetexd.h $(makecpool_stamp) |
| 91 |
$(makecpool) xetex >$@ || { rm -f $@; exit 1; } |
| 92 |
|
| 93 |
## Tangling XeTeX |
| 94 |
xetex.p xetex.pool: xetex-tangle |
| 95 |
$(xe_tangle) xetex xetex-final |
| 96 |
xetex-tangle: otangle$(EXEEXT) xetexdir/xetex.web xetex-final.ch tangle-sh |
| 97 |
$(xe_tangle) xetex xetex-final |
| 98 |
|
| 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/'.*$$/\"/" >$@ |
| 103 |
|
| 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/'.*$$/\"/" >$@ |
| 108 |
|
| 109 |
## Generate xetex-final.ch |
| 110 |
xetex-final.ch: tie$(EXEEXT) $(xetex_ch_srcs) |
| 111 |
$(tie_c) $(xetex_ch_srcs) || { rm -f $@; exit 1; } |
| 112 |
xetex_ch_srcs = \ |
| 113 |
xetexdir/xetex.web \ |
| 114 |
xetexdir/tex.ch0 \ |
| 115 |
tex.ch \ |
| 116 |
tracingstacklevels.ch \ |
| 117 |
partoken-102.ch \ |
| 118 |
partoken.ch \ |
| 119 |
locnull-optimize.ch \ |
| 120 |
unbalanced-braces.ch \ |
| 121 |
showstream.ch \ |
| 122 |
$(xetex_ch_synctex) \ |
| 123 |
xetexdir/xetex.ch \ |
| 124 |
$(xetex_post_ch_synctex) \ |
| 125 |
xetexdir/char-warning-xetex.ch \ |
| 126 |
tex-binpool.ch |
| 127 |
|
| 128 |
## |
| 129 |
EXTRA_DIST += $(xetex_web_srcs) $(xetex_ch_srcs) xetexdir/xetex.defines |
| 130 |
|
| 131 |
DISTCLEANFILES += $(nodist_xetex_SOURCES) xetex.web xetex-final.ch \ |
| 132 |
xetex-web2c xetex.p xetex.pool xetex-tangle |
| 133 |
|
| 134 |
|
| 135 |
## libxetex |
| 136 |
## |
| 137 |
EXTRA_LIBRARIES += libxetex.a |
| 138 |
|
| 139 |
libxetex_a_CPPFLAGS = $(xetex_cppflags) |
| 140 |
libxetex_a_CFLAGS = $(WARNING_CFLAGS) |
| 141 |
libxetex_a_CXXFLAGS = # $(WARNING_CXXFLAGS) |
| 142 |
libxetex_a_OBJCXXFLAGS = # $(WARNING_OBJCXXFLAGS) |
| 143 |
|
| 144 |
libxetex_a_SOURCES = \ |
| 145 |
xetexdir/XeTeXFontInst.cpp \ |
| 146 |
xetexdir/XeTeXFontInst.h \ |
| 147 |
xetexdir/XeTeXFontMgr.cpp \ |
| 148 |
xetexdir/XeTeXFontMgr.h \ |
| 149 |
xetexdir/XeTeXLayoutInterface.cpp \ |
| 150 |
xetexdir/XeTeXLayoutInterface.h \ |
| 151 |
xetexdir/XeTeXOTMath.cpp \ |
| 152 |
xetexdir/XeTeXOTMath.h \ |
| 153 |
xetexdir/XeTeX_ext.c \ |
| 154 |
xetexdir/XeTeX_ext.h \ |
| 155 |
xetexdir/XeTeX_pic.c \ |
| 156 |
xetexdir/XeTeX_web.h \ |
| 157 |
xetexdir/XeTeXswap.h \ |
| 158 |
xetexdir/trans.c \ |
| 159 |
xetexdir/trans.h \ |
| 160 |
xetexdir/hz.cpp \ |
| 161 |
xetexdir/xetex.h \ |
| 162 |
xetexdir/pdfimage.cpp \ |
| 163 |
xetexdir/pdfimage.h \ |
| 164 |
xetexdir/image/bmpimage.c \ |
| 165 |
xetexdir/image/bmpimage.h \ |
| 166 |
xetexdir/image/jpegimage.c \ |
| 167 |
xetexdir/image/jpegimage.h \ |
| 168 |
xetexdir/image/mfileio.c \ |
| 169 |
xetexdir/image/mfileio.h \ |
| 170 |
xetexdir/image/numbers.c \ |
| 171 |
xetexdir/image/numbers.h \ |
| 172 |
xetexdir/image/pngimage.c \ |
| 173 |
xetexdir/image/pngimage.h |
| 174 |
|
| 175 |
if XETEX_MACOSX |
| 176 |
|
| 177 |
libxetex_a_SOURCES += \ |
| 178 |
xetexdir/XeTeXFontInst_Mac.cpp \ |
| 179 |
xetexdir/XeTeXFontInst_Mac.h \ |
| 180 |
xetexdir/XeTeXFontMgr_Mac.mm \ |
| 181 |
xetexdir/XeTeXFontMgr_Mac.h \ |
| 182 |
xetexdir/XeTeX_mac.c |
| 183 |
|
| 184 |
else !XETEX_MACOSX |
| 185 |
|
| 186 |
libxetex_a_SOURCES += \ |
| 187 |
xetexdir/XeTeXFontMgr_FC.cpp \ |
| 188 |
xetexdir/XeTeXFontMgr_FC.h |
| 189 |
|
| 190 |
endif !XETEX_MACOSX |
| 191 |
|
| 192 |
# We must create xetexd.h etc. before building the libxetex_a_OBJECTS. |
| 193 |
libxetex_prereq = xetexd.h $(xetex_dependencies) |
| 194 |
$(libxetex_a_OBJECTS): $(libxetex_prereq) |
| 195 |
|
| 196 |
EXTRA_DIST += \ |
| 197 |
xetexdir/ChangeLog \ |
| 198 |
xetexdir/COPYING \ |
| 199 |
xetexdir/NEWS \ |
| 200 |
xetexdir/image/README \ |
| 201 |
xetexdir/unicode-char-prep.pl \ |
| 202 |
xetexdir/xewebmac.tex |
| 203 |
|
| 204 |
# XeTeX Tests |
| 205 |
# |
| 206 |
xetex_tests = \ |
| 207 |
xetexdir/xetex-filedump.test \ |
| 208 |
xetexdir/xetex-bug73.test \ |
| 209 |
xetexdir/xetex-ctrlsym.test \ |
| 210 |
xetexdir/xetex.test \ |
| 211 |
xetexdir/wcfname.test |
| 212 |
xetexdir/xetex-filedump.log xetexdir/xetex-bug73.log \ |
| 213 |
xetexdir/xetex-ctrlsym.log xetexdir/xetex.log \ |
| 214 |
xetexdir/wcfname.log: xetex$(EXEEXT) |
| 215 |
|
| 216 |
EXTRA_DIST += $(xetex_tests) |
| 217 |
|
| 218 |
if XETEX |
| 219 |
TESTS += $(xetex_tests) |
| 220 |
endif XETEX |
| 221 |
|
| 222 |
## xetex-bug73.test |
| 223 |
EXTRA_DIST += xetexdir/tests/bug73.log xetexdir/tests/bug73.tex |
| 224 |
DISTCLEANFILES += bug73.fmt bug73.log bug73.out bug73.tex |
| 225 |
|
| 226 |
## xetex-filedump.test |
| 227 |
EXTRA_DIST += xetexdir/tests/filedump.log xetexdir/tests/filedump.tex |
| 228 |
DISTCLEANFILES += filedump.log filedump.out filedump.tex |
| 229 |
|
| 230 |
## xetex-ctrlsym.test |
| 231 |
EXTRA_DIST += xetexdir/tests/ctrlsym.log xetexdir/tests/ctrlsym.tex |
| 232 |
DISTCLEANFILES += xe-ctrlsym.fmt xe-ctrlsym.log xe-ctrlsym.out xe-ctrlsym.tex |
| 233 |
|
| 234 |
## wcfname.test |
| 235 |
DISTCLEANFILES += xetests/fn*.* |
| 236 |
|
| 237 |
# (end of xetex.am) |