Imakefile revision e39b573c
1XCOMM $XTermId: Imakefile,v 1.104 2011/07/02 00:48:49 tom Exp $ 2XCOMM 3XCOMM Attention xterm porters 4XCOMM 5XCOMM 6XCOMM Xterm assumes that bcopy can handle overlapping arguments. If your 7XCOMM bcopy (or memcpy) cannot, write a routine called bcopy and link it in 8XCOMM or add -Dbcopy=mybcopy to the DEFINES list below. 9XCOMM 10 11/* Uncomment SCROLLBAR_RIGHT if you want the scroll bar to be on the right */ 12SCROLLBAR_RIGHT = -DSCROLLBAR_RIGHT 13 14/* Define UTF8support to compile-in support for UTF-8 */ 15#define UTF8support 16 17/* 18 * setgid mode works for systems that do not require setuid to open pty. 19 * 20 * This feature could also be applied to FreeBSD, but requires the installer 21 * to define a "utmp" group as well as chgrp the utmp file to match. 22 * 23 * Note: InstallXtermSetUID is always defined; InstallXtermSetGID is defined 24 * in newer imake configurations. 25 */ 26#if !defined(InstallXtermSetGID) && !InstallXtermSetUID 27#if defined(OpenBSDArchitecture) || \ 28 (defined(LinuxArchitecture) && \ 29 (LinuxCLibMajorVersion == 6)) 30#define InstallXtermSetGID YES 31#endif 32#endif 33 34/* 35 * Override the set uid/gid flags to use the utempter library. 36 */ 37#if defined(UseUtempter) 38#undef InstallXtermSetUID /* imake sets this */ 39#undef InstallXtermSetGID /* we set this */ 40#define InstallXtermSetUID NO 41#define InstallXtermSetGID NO 42 UTMPLIB = -lutempter 43#endif 44 45/* 46 * Fixes to allow compile with X11R5, etc. 47 */ 48#ifndef InstGidFlags 49#define InstGidFlags -m 2755 -g utmp 50#endif 51 52#ifndef InstUidFlags 53#define InstUidFlags -m 4711 54#endif 55 56#ifndef XkbClientDefines 57#define XkbClientDefines /**/ 58#endif 59 60#ifndef InstallXtermSetUID 61#define InstallXtermSetUID NO 62#endif 63 64#ifndef InstallXtermSetGID 65#define InstallXtermSetGID NO 66#endif 67 68#ifndef XkbClientDepLibs 69#define XkbClientDepLibs /**/ 70#endif 71 72#ifndef XkbClientLibs 73#define XkbClientLibs /**/ 74#endif 75 76/* This must come before setting DEFINES */ 77#if InstallXtermSetGID 78CSGIDFLAGS = -DUSE_UTMP_SETGID 79INSTSETIDFLAGS = InstGidFlags 80#elif InstallXtermSetUID 81INSTSETIDFLAGS = InstUidFlags 82#else 83INSTSETIDFLAGS = NullParameter 84#endif 85 86/* 87 * Compensate for broken imake configuration. 88 */ 89#ifdef LinuxGnuSourceDefines 90# ifdef UseInstalled 91 IMAKEDEFINES = -D_GNU_SOURCE 92# endif 93#endif 94 95#ifndef SpecialCObjectRule 96#define SpecialCObjectRule(module,ignore,defines) \ 97module.o: ; $(CC) -c defines $(CFLAGS) module.c 98#endif 99 100#ifndef ProgramTargetName 101#define ProgramTargetName(program) program 102#endif 103 104/* 105 * add -DWTMP and -DLASTLOG if you want them; make sure that bcopy can 106 * handle overlapping copies before using it. 107 */ 108#if SetTtyGroup /* turn on in config/machine.cf */ 109 TTYGROUPDEF = -DUSE_TTY_GROUP 110#endif 111#ifdef UsePUCCPtyd /* turn on in config/site.def */ 112 PUCCPTYDDEF = -DPUCC_PTYD /* does not need to be setuid */ 113 PTYLIB = -lpucc 114#endif 115 116#if defined(NetBSDArchitecture) || \ 117 defined(OpenBSDArchitecture) || \ 118 defined(FreeBSDArchitecture) || \ 119 (defined(LinuxArchitecture) && \ 120 (LinuxCLibMajorVersion == 6) && (LinuxCLibMinorVersion < 1)) 121 PTYLIB = -lutil 122#endif 123 124#ifdef DarwinArchitecture 125/* dyld can deadlock if a signal comes in when it is looking up a symbol */ 126 LOCAL_LDFLAGS = -Wl,-bind_at_load 127#endif 128 129#ifdef OS2Architecture 130/* 131 * Only used in os2main.c, see ptyx.h for OPT_I18N_SUPPORT 132 * <werner@suse.de> 133 */ 134#if XtermWithI18N 135 I18NDEF = -DI18N 136 FEATURE_DEFINES = -DDEBUG -DALLOWLOGGING $(I18NDEF) 137#else 138 FEATURE_DEFINES = -DDEBUG -DALLOWLOGGING 139#endif 140#endif 141 142 OSMAJORVERSION = OSMajorVersion 143 OSMINORVERSION = OSMinorVersion 144 145#if defined(NTOArchitecture) || \ 146 defined(OpenBSDArchitecture) || \ 147 defined(SGIArchitecture) || \ 148 defined(SunArchitecture) 149TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR 150#elif defined(LinuxArchitecture) 151# if LinuxUsesNcurses 152TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR 153# endif 154#endif 155 156#if !defined(OS2Architecture) && !defined(__GNU__) 157#if defined(UseUtempter) 158 UTMPDEF = -DUSE_UTEMPTER 159#else 160 UTMPDEF = -DUTMP 161#endif 162#endif 163 164#ifdef UTF8support 165 UTF8_OPTION = -DOPT_WIDE_CHARS -DOPT_LUIT_PROG 166 UTF8SRC = charclass.c precompose.c wcwidth.c xutf8.c 167 UTF8OBJ = charclass.o precompose.o wcwidth.o xutf8.o 168#endif 169#if BuildXftLibrary 170#define XRenderSupport 171#endif 172#ifdef XRenderSupport 173 XRFDEF = -DXRENDERFONT -DXFREE86_FT2 174 XRFLIBS = XftClientLibs 175 XRFDEPLIBS = XftClientDepLibs 176 XRFINCLUDES = $(XFTINCLUDES) 177#endif 178#if !HasPutenv 179 PUTENVDEF = -DNOPUTENV 180#endif 181#ifdef TraceXTerm 182 TRACEDEF = -DOPT_TRACE=1 183#endif 184 MAIN_DEFINES = $(UTMPDEF) $(TTYGROUPDEF) $(PUCCPTYDDEF) $(CSGIDFLAGS) \ 185 -DOSMAJORVERSION=$(OSMAJORVERSION) \ 186 -DOSMINORVERSION=$(OSMINORVERSION) 187 MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */ 188 XKB_DEFINES = XkbClientDefines 189 PATH_DEFINES = -DPROJECTROOT=$(PROJECTROOT) 190 DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT) $(UTF8_OPTION) $(XRFDEF) $(PATH_DEFINES) $(PUTENVDEF) $(IMAKEDEFINES) $(TRACEDEF) 191 INCLUDES = -I. $(XRFINCLUDES) 192 193#ifdef OS2Architecture 194 MAINSRC = os2main.c 195 MAINOBJ = os2main.o 196#else 197 MAINSRC = main.c 198 MAINOBJ = main.o 199#endif 200#ifdef TraceXTerm 201 TRACESRC = trace.c 202 TRACEOBJ = trace.o 203#endif 204 SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \ 205 data.c doublechr.c fontutils.c input.c \ 206 linedata.c menu.c misc.c print.c ptydata.c scrollback.c \ 207 screen.c scrollbar.c tabs.c util.c xstrings.c xtermcap.c \ 208 TekPrsTbl.c Tekproc.c VTPrsTbl.c \ 209 $(MAINSRC) $(EXTRASRC) $(UTF8SRC) $(TRACESRC) 210 OBJS1 = button.o cachedGCs.o charproc.o charsets.o cursor.o \ 211 data.o doublechr.o fontutils.o input.o \ 212 linedata.o menu.o misc.o print.o ptydata.o scrollback.o \ 213 screen.o scrollbar.o tabs.o util.o xstrings.o xtermcap.o \ 214 TekPrsTbl.o Tekproc.o VTPrsTbl.o \ 215 $(MAINOBJ) $(EXTRAOBJ) $(UTF8OBJ) $(TRACEOBJ) 216 SRCS2 = resize.c xstrings.c 217 OBJS2 = resize.o xstrings.o 218 SRCS = $(SRCS1) $(SRCS2) 219 OBJS = $(OBJS1) $(OBJS2) 220 PROGRAMS = ProgramTargetName(resize) ProgramTargetName(xterm) 221 DEPLIBS1 = XkbClientDepLibs XawClientDepLibs $(XRFDEPLIBS) 222 DEPLIBS2 = 223 224#ifndef TermcapLibrary 225#if SystemV && !defined(MacIIArchitecture) 226#if defined(CrayArchitecture) || \ 227 (defined(HPArchitecture) && (OSMajorVersion < 10)) || \ 228 defined(RsArchitecture) || \ 229 defined(SCOArchitecture) || \ 230 defined(USLArchitecture) 231#define TermcapLibrary -lcurses /* special cases of System V */ 232#else 233#define TermcapLibrary -ltermlib /* usually in here */ 234#endif 235#else 236#define TermcapLibrary -ltermcap /* bsd puts it here */ 237#endif 238#endif 239 240 TERMCAPLIB = TermcapLibrary 241 242AllTarget($(PROGRAMS)) 243 244SpecialCObjectRule(main,$(_NOOP_),$(MAIN_DEFINES)) 245SpecialCObjectRule(menu,$(_NOOP_),$(MISC_DEFINES)) 246SpecialCObjectRule(misc,$(_NOOP_),$(MISC_DEFINES)) 247SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES)) 248SpecialCObjectRule(data,$(_NOOP_),$(MISC_DEFINES)) 249 250#if InstallXtermSetUID 251SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB)) 252#else 253NormalProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(UTMPLIB) $(PTYLIB)) 254#endif 255 256#if InstallXtermSetUID && defined(SunArchitecture) && HasSharedLibraries && (OSMajorVersion < 5) 257#if AlternateUsrLibDir 258#if ((OSMajorVersion == 4) && (OSMinorVersion >= 1)) 259LDOVERRIDE = -L$(DESTDIR)$(USRLIBDIR) 260#else 261#if HasGcc 262LDOVERRIDE = -static -L$(DESTDIR)$(USRLIBDIR) 263#else 264LDOVERRIDE = -Bstatic -L$(DESTDIR)$(USRLIBDIR) 265LDRESUME = -Bdynamic 266#endif 267#endif 268#endif 269install:: 270 MakeDir($(DESTDIR)$(BINDIR)) 271 RemoveFile(ProgramTargetName(xterm.inst)) 272 LinkRule(ProgramTargetName(xterm.inst),$(CDEBUGFLAGS) $(CCOPTIONS) 273 $(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS),$(OBJS1),$(LDOVERRIDE) 274 $(XRFLIBS) XawClientLibs $(LDRESUME) $(LDLIBS) $(TERMCAPLIB) 275 $(PTYLIB)) 276 $(INSTALL) -c $(INSTPGMFLAGS) $(INSTSETIDFLAGS) ProgramTargetName(xterm.inst) $(DESTDIR)$(BINDIR)/ProgramTargetName(xterm) 277 RemoveFile(ProgramTargetName(xterm.inst)) 278#else 279InstallProgramWithFlags(xterm,$(BINDIR),$(INSTSETIDFLAGS)) 280#endif 281 282InstallNamedProg(uxterm,uxterm,$(BINDIR)) 283 284/* 285 * Link with the termcap library if USE_TERMCAP is defined in resize.c 286 */ 287#if defined(NTOArchitecture) || \ 288 defined(LinuxArchitecture) || \ 289 defined(OpenBSDArchitecture) || \ 290 defined(SGIArchitecture) || \ 291 defined(SunArchitecture) 292NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,NullParameter) 293#else 294NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,$(TERMCAPLIB)) 295#endif 296 297InstallProgramWithFlags(resize,$(BINDIR),NullParameter) 298 299/* 300 * termcap is a special name that does not install correctly with 301 * InstallNamedNonExec() 302 */ 303install:: 304 MakeDir($(DESTDIR)$(LIBDIR)/etc) 305 $(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) termcap \ 306 $(DESTDIR)$(LIBDIR)/etc/xterm.termcap 307InstallNamedNonExec(terminfo,xterm.terminfo,$(LIBDIR)/etc) 308 309InstallAppDefaults(XTerm) 310InstallAppDefaults(UXTerm) 311InstallAppDefaultsLong(XTerm-col,XTerm-color) 312InstallManPage(xterm,$(MANDIR)) 313InstallManPage(resize,$(MANDIR)) 314DependTarget() 315