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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
XCOMM $XTermId: Imakefile,v 1.121 2018/08/12 17:23:20 tom Exp $
XCOMM
XCOMM Attention xterm porters
XCOMM
XCOMM
XCOMM Xterm assumes that bcopy can handle overlapping arguments. If your
XCOMM bcopy (or memcpy) cannot, write a routine called bcopy and link it in
XCOMM or add -Dbcopy=mybcopy to the DEFINES list below.
XCOMM
/* Uncomment SCROLLBAR_RIGHT if you want the scroll bar to be on the right */
SCROLLBAR_RIGHT = -DSCROLLBAR_RIGHT
/* Define UTF8support to compile-in support for UTF-8 */
#define UTF8support
/*
* setgid mode works for systems that do not require setuid to open pty.
*
* This feature could also be applied to FreeBSD, but requires the installer
* to define a "utmp" group as well as chgrp the utmp file to match.
*
* Note: InstallXtermSetUID is always defined; InstallXtermSetGID is defined
* in newer imake configurations.
*/
#if !defined(InstallXtermSetGID) && !InstallXtermSetUID
#if defined(OpenBSDArchitecture) || \
(defined(LinuxArchitecture) && \
(LinuxCLibMajorVersion == 6))
#define InstallXtermSetGID YES
#endif
#endif
/*
* Override the set uid/gid flags to use the utempter library.
*/
#if defined(UseUtempter)
#undef InstallXtermSetUID /* imake sets this */
#undef InstallXtermSetGID /* we set this */
#define InstallXtermSetUID NO
#define InstallXtermSetGID NO
UTMPLIB = -lutempter
#endif
/*
* Fixes to allow compile with X11R5, etc.
*/
#ifndef InstGidFlags
#define InstGidFlags -m 2755 -g utmp
#endif
#ifndef InstUidFlags
#define InstUidFlags -m 4711
#endif
#ifndef XkbClientDefines
#define XkbClientDefines /**/
#endif
#ifndef InstallXtermSetUID
#define InstallXtermSetUID NO
#endif
#ifndef InstallXtermSetGID
#define InstallXtermSetGID NO
#endif
#ifndef XkbClientDepLibs
#define XkbClientDepLibs /**/
#endif
#ifndef XkbClientLibs
#define XkbClientLibs /**/
#endif
/* This must come before setting DEFINES */
#if InstallXtermSetGID
CSGIDFLAGS = -DUSE_UTMP_SETGID
INSTSETIDFLAGS = InstGidFlags
#elif InstallXtermSetUID
INSTSETIDFLAGS = InstUidFlags
#else
INSTSETIDFLAGS = NullParameter
#endif
/*
* Compensate for broken imake configuration.
*/
#ifdef LinuxGnuSourceDefines
# ifdef UseInstalled
IMAKEDEFINES = -D_DEFAULT_SOURCE -U_XOPEN_SOURCE -D_XOPEN_SOURCE=600
# endif
#endif
#ifndef SpecialCObjectRule
#define SpecialCObjectRule(module,ignore,defines) \
module.o: ; $(CC) -c defines $(CFLAGS) module.c
#endif
#ifndef ProgramTargetName
#define ProgramTargetName(program) program
#endif
/*
* add -DWTMP and -DLASTLOG if you want them; make sure that bcopy can
* handle overlapping copies before using it.
*/
#if SetTtyGroup /* turn on in config/machine.cf */
TTYGROUPDEF = -DUSE_TTY_GROUP
#endif
#ifdef UsePUCCPtyd /* turn on in config/site.def */
PUCCPTYDDEF = -DPUCC_PTYD /* does not need to be setuid */
PTYLIB = -lpucc
#endif
#if defined(NetBSDArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(FreeBSDArchitecture) || \
(defined(LinuxArchitecture) && \
(LinuxCLibMajorVersion == 6) && (LinuxCLibMinorVersion < 1))
PTYLIB = -lutil
#endif
#ifdef DarwinArchitecture
/* dyld can deadlock if a signal comes in when it is looking up a symbol */
LOCAL_LDFLAGS = -Wl,-bind_at_load
#endif
OSMAJORVERSION = OSMajorVersion
OSMINORVERSION = OSMinorVersion
/* none of these can be expected to use termcap unless emulated by terminfo */
#if defined(NTOArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(SGIArchitecture) || \
defined(SunArchitecture) || \
defined(NetBSDArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(FreeBSDArchitecture) || \
defined(LinuxArchitecture)
TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR -DHAVE_TERM_H
#endif
#if !defined(OS2Architecture) && !defined(__GNU__) && !defined(Minix3Architecture)
#if defined(UseUtempter)
UTMPDEF = -DUSE_UTEMPTER
#else
UTMPDEF = -DUTMP
#endif
#endif
#ifdef UTF8support
UTF8_OPTION = -DOPT_WIDE_CHARS -DOPT_LUIT_PROG
UTF8SRC = charclass.c precompose.c wcwidth.c xutf8.c
UTF8OBJ = charclass.o precompose.o wcwidth.o xutf8.o
#endif
#if BuildXftLibrary
#define XRenderSupport
#endif
#ifdef XRenderSupport
XRFDEF = -DXRENDERFONT -DXFREE86_FT2
XRFLIBS = XftClientLibs
XRFDEPLIBS = XftClientDepLibs
XRFINCLUDES = $(XFTINCLUDES)
#endif
#if !HasPutenv
PUTENVDEF = -DNOPUTENV
#endif
#ifdef DumpsXTerm
DUMPSDEF = -DOPT_SCREEN_DUMPS=1
#endif
#ifdef RegisXTerm
SIXELDEF = -DOPT_REGIS_GRAPHICS=1
#endif
#ifdef SixelXTerm
SIXELDEF = -DOPT_SIXEL_GRAPHICS=1
#endif
#ifdef TraceXTerm
TRACEDEF = -DOPT_TRACE=1
#endif
MAIN_DEFINES = $(UTMPDEF) $(TTYGROUPDEF) $(PUCCPTYDDEF) $(CSGIDFLAGS) \
-DOSMAJORVERSION=$(OSMAJORVERSION) \
-DOSMINORVERSION=$(OSMINORVERSION)
MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */
XKB_DEFINES = XkbClientDefines
PATH_DEFINES = -DPROJECTROOT=$(PROJECTROOT)
DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT) $(UTF8_OPTION) $(XRFDEF) $(PATH_DEFINES) $(PUTENVDEF) $(IMAKEDEFINES) $(SIXELDEF) $(TRACEDEF) $(DUMPSDEF)
INCLUDES = -I. $(XRFINCLUDES)
MAINSRC = main.c
MAINOBJ = main.o
#ifdef DumpsXTerm
DUMPSSRC = html.c svg.c
DUMPSOBJ = html.o svg.o
#endif
#ifdef RegisXTerm
SIXELSRC = graphics_regis.c
SIXELOBJ = graphics_regis.o
#endif
#ifdef SixelXTerm
SIXELSRC = graphics_sixel.c
SIXELOBJ = graphics_sixel.o
#endif
#ifdef TraceXTerm
TRACESRC = trace.c
TRACEOBJ = trace.o
#endif
SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
data.c doublechr.c fontutils.c input.c \
linedata.c menu.c misc.c print.c ptydata.c scrollback.c \
screen.c scrollbar.c tabs.c util.c version.c xstrings.c \
xtermcap.c TekPrsTbl.c Tekproc.c VTPrsTbl.c \
$(MAINSRC) $(EXTRASRC) $(UTF8SRC) $(SIXELSRC) $(TRACESRC) $(DUMPSSRC)
OBJS1 = button.o cachedGCs.o charproc.o charsets.o cursor.o \
data.o doublechr.o fontutils.o input.o \
linedata.o menu.o misc.o print.o ptydata.o scrollback.o \
screen.o scrollbar.o tabs.o util.o version.o xstrings.o \
xtermcap.o TekPrsTbl.o Tekproc.o VTPrsTbl.o \
$(MAINOBJ) $(EXTRAOBJ) $(UTF8OBJ) $(SIXELOBJ) $(TRACEOBJ) $(DUMPSOBJ)
SRCS2 = resize.c version.c xstrings.c
OBJS2 = resize.o version.o xstrings.o
SRCS = $(SRCS1) $(SRCS2)
OBJS = $(OBJS1) $(OBJS2)
PROGRAMS = ProgramTargetName(resize) ProgramTargetName(xterm)
DEPLIBS1 = XkbClientDepLibs XawClientDepLibs $(XRFDEPLIBS)
DEPLIBS2 =
#ifndef TermcapLibrary
#if SystemV && !defined(MacIIArchitecture)
#if defined(CrayArchitecture) || \
(defined(HPArchitecture) && (OSMajorVersion < 10)) || \
defined(RsArchitecture) || \
defined(SCOArchitecture) || \
defined(USLArchitecture)
#define TermcapLibrary -lcurses /* special cases of System V */
#else
#define TermcapLibrary -ltermlib /* usually in here */
#endif
#else
#define TermcapLibrary -ltermcap /* bsd puts it here */
#endif
#endif
TERMCAPLIB = TermcapLibrary
AllTarget($(PROGRAMS))
VTPARSE_H = VTparse.h VTparse.hin
TEKPARSE_H = Tekparse.h Tekparse.hin
VTPARSE_C = VTparse.h VTparse.cin
TEKPARSE_C = Tekparse.h Tekparse.cin
.SUFFIXES : .def .cin .hin
.def.cin :
awk '/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
.def.hin :
awk '/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
SpecialCObjectRule(main,$(_NOOP_),$(MAIN_DEFINES))
SpecialCObjectRule(menu,$(_NOOP_),$(MISC_DEFINES))
SpecialCObjectRule(misc,$(VTPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(VTPrsTbl,$(VTPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(charproc,$(VTPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(data,$(_NOOP_),$(MISC_DEFINES))
SpecialCObjectRule(TekPrsTbl,$(TEKPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(TekProc,$(TEKPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(trace,$(VTPARSE_C) $(TEKPARSE_C),$(MISC_DEFINES))
#if InstallXtermSetUID
SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
#else
NormalProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(UTMPLIB) $(PTYLIB))
#endif
#if defined(OpenBSDArchitecture) || defined(MirBSDArchitecture)
/* On OpenBSD xterm is now setgid utmp */
INSTUIDFLAGS= -m 2555 -g utmp
#endif
#if InstallXtermSetUID && defined(SunArchitecture) && HasSharedLibraries && (OSMajorVersion < 5)
#if AlternateUsrLibDir
#if ((OSMajorVersion == 4) && (OSMinorVersion >= 1))
LDOVERRIDE = -L$(DESTDIR)$(USRLIBDIR)
#else
#if HasGcc
LDOVERRIDE = -static -L$(DESTDIR)$(USRLIBDIR)
#else
LDOVERRIDE = -Bstatic -L$(DESTDIR)$(USRLIBDIR)
LDRESUME = -Bdynamic
#endif
#endif
#endif
install::
MakeDir($(DESTDIR)$(BINDIR))
RemoveFile(ProgramTargetName(xterm.inst))
LinkRule(ProgramTargetName(xterm.inst),$(CDEBUGFLAGS) $(CCOPTIONS)
$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS),$(OBJS1),$(LDOVERRIDE)
$(XRFLIBS) XawClientLibs $(LDRESUME) $(LDLIBS) $(TERMCAPLIB)
$(PTYLIB))
$(INSTALL) -c $(INSTPGMFLAGS) $(INSTSETIDFLAGS) ProgramTargetName(xterm.inst) $(DESTDIR)$(BINDIR)/ProgramTargetName(xterm)
RemoveFile(ProgramTargetName(xterm.inst))
#else
InstallProgramWithFlags(xterm,$(BINDIR),$(INSTSETIDFLAGS))
#endif
InstallNamedProg(uxterm,uxterm,$(BINDIR))
/*
* Link with the termcap library if USE_TERMCAP is defined in resize.c
*/
#if defined(NTOArchitecture) || \
defined(LinuxArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(SGIArchitecture) || \
defined(SunArchitecture)
NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,NullParameter)
#else
NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,$(TERMCAPLIB))
#endif
InstallProgramWithFlags(resize,$(BINDIR),NullParameter)
/*
* termcap is a special name that does not install correctly with
* InstallNamedNonExec()
*/
install::
MakeDir($(DESTDIR)$(LIBDIR)/etc)
$(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) termcap \
$(DESTDIR)$(LIBDIR)/etc/xterm.termcap
InstallNamedNonExec(terminfo,xterm.terminfo,$(LIBDIR)/etc)
InstallAppDefaults(XTerm)
InstallAppDefaults(UXTerm)
InstallAppDefaultsLong(XTerm-col,XTerm-color)
InstallManPage(xterm,$(MANDIR))
InstallManPage(resize,$(MANDIR))
cleandir::
$(RM) *parse.hin *parse.cin
DependTarget()
|