configure.in revision 5307cd1a
1dnl $XTermId: configure.in,v 1.394 2023/02/12 19:12:35 tom Exp $
2dnl
3dnl -----------------------------------------------------------------------------
4dnl this file is part of xterm
5dnl
6dnl Copyright 1997-2022,2023 by Thomas E. Dickey
7dnl
8dnl                         All Rights Reserved
9dnl
10dnl Permission is hereby granted, free of charge, to any person obtaining a
11dnl copy of this software and associated documentation files (the
12dnl "Software"), to deal in the Software without restriction, including
13dnl without limitation the rights to use, copy, modify, merge, publish,
14dnl distribute, sublicense, and/or sell copies of the Software, and to
15dnl permit persons to whom the Software is furnished to do so, subject to
16dnl the following conditions:
17dnl
18dnl The above copyright notice and this permission notice shall be included
19dnl in all copies or substantial portions of the Software.
20dnl
21dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24dnl IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
25dnl CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26dnl TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27dnl SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28dnl
29dnl Except as contained in this notice, the name(s) of the above copyright
30dnl holders shall not be used in advertising or otherwise to promote the
31dnl sale, use or other dealings in this Software without prior written
32dnl authorization.
33dnl ---------------------------------------------------------------------------
34dnl Process this file with autoconf to produce a configure script.
35dnl
36AC_PREREQ(2.52.20210509)
37AC_INIT
38AC_CONFIG_SRCDIR([charproc.c])
39AC_CONFIG_HEADER(xtermcfg.h:xtermcfg.hin)
40CF_CHECK_CACHE
41
42###	checks for alternative programs
43
44dnl Only add to this case statement when a system has a compiler that is not
45dnl detected by AC_PROG_CC.
46case "$host_os" in
47(openedition)	: "${CFLAGS=\"-O2 -Wc,dll -Wl,EDIT=NO\"}"
48		: "${CPPFLAGS=\"-D_ALL_SOURCE\"}"
49		: "${LIBS=\"/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x\"}"
50		: "${CC=c89}";;
51(darwin*)
52		: "${LDFLAGS}=\"${LDFLAGS} -Wl,-bind_at_load\"";;
53esac
54
55CF_PROG_CC
56AC_PROG_CPP
57AC_PROG_AWK
58AC_PROG_INSTALL
59AC_PROG_LN_S
60AC_ARG_PROGRAM
61CF_PROG_LINT
62
63###	checks for compiler characteristics
64CF_XOPEN_SOURCE(700)
65CF_SIGWINCH
66
67###	checks for header files
68AC_CHECK_DECL(exit)
69AC_CHECK_HEADERS( \
70ncurses/curses.h \
71ncurses/term.h \
72sys/ptem.h \
73sys/ttydefaults.h \
74term.h \
75termios.h \
76wchar.h \
77)
78AC_HEADER_TIME
79AM_LANGINFO_CODESET
80
81###	checks for typedefs
82CF_SIG_ATOMIC_T
83AC_CHECK_TYPE(time_t, long)
84CF_TYPE_CC_T
85CF_TYPE_NFDS_T
86AC_TYPE_MODE_T
87AC_TYPE_PID_T
88AC_TYPE_UID_T
89AC_TYPE_OFF_T
90
91###	checks for library functions
92AC_CHECK_FUNCS( \
93	gethostname \
94	getusershell \
95	endusershell \
96	getlogin \
97	initgroups \
98	mkdtemp \
99	putenv \
100	unsetenv \
101	sched_yield \
102	setpgid \
103	strftime \
104	tcgetattr \
105	waitpid \
106	wcswidth \
107	wcwidth )
108CF_MKSTEMP
109CF_SETITIMER
110CF_UTMP
111CF_STRUCT_LASTLOG
112CF_POSIX_SAVED_IDS
113
114CF_HELP_MESSAGE(Compile/Install Options:)
115CF_FUNC_TGETENT
116
117CF_WITH_APP_CLASS(XTerm)
118CF_WITH_APP_DEFAULTS
119CF_WITH_ICON_NAME(mini.xterm)
120CF_WITH_ICON_SYMLINK(xterm)
121
122# Install all icons except for the overused "terminal".
123cf_cv_icon_list=
124for my_item in $srcdir/icons/*.svg
125do
126	test -f "$my_item" || continue
127	cf_icon_name=`echo "$my_item" |sed -e "s,.svg,," -e "s,^$srcdir/,,"`
128	case $cf_icon_name in
129	(*_48x48)
130		continue
131		;;
132	esac
133	CF_VERBOSE(adding $cf_icon_name to icon-list)
134	cf_cv_icon_list="$cf_cv_icon_list $cf_icon_name"
135	if test -f "${cf_icon_name}_48x48.png"
136	then
137		CF_VERBOSE(adding ${cf_icon_name}_48x48 to icon-list)
138		cf_cv_icon_list="$cf_cv_icon_list ${cf_icon_name}_48x48"
139	fi
140done
141CF_WITH_ICON_THEME([$cf_cv_icon_list],,,icons/${ICON_NAME}_48x48)
142
143CF_DISABLE_DESKTOP(xterm)
144CF_WITH_DESKTOP_CATEGORY(xterm,
145	[*rxvt*|*konsole|*[[Tt]]erminal],
146	[System|TerminalEmulator|*])
147
148AC_MSG_CHECKING(for install-permissions reference)
149AC_ARG_WITH(reference,
150	[  --with-reference=XXX    program to use as permissions-reference],
151	[with_reference=$withval],
152	[with_reference=xterm])
153AC_MSG_RESULT($with_reference)
154
155with_full_paths=yes
156CF_PATH_PROG(XTERM_PATH,$with_reference)
157
158# If any of --program-prefix, --program-suffix or --program-transform-name is
159# given, accept an option tell the makefile to create a symbolic link, e.g.,
160# to "xterm" on install.
161XTERM_SYMLINK=NONE
162AC_SUBST(XTERM_SYMLINK)
163if test "$program_transform_name" != "'s,,,'" ; then
164cf_name=`echo "$program_transform_name" | sed -e '[s,\\$\\$,$,g]'`
165cf_name=`echo xterm |sed -e "$cf_name"`
166AC_MSG_CHECKING(for symbolic link to create to $cf_name)
167AC_ARG_WITH(xterm-symlink,
168	[  --with-xterm-symlink=XXX make symbolic link to installed xterm],
169	[with_symlink=$withval],
170	[with_symlink=xterm])
171AC_MSG_RESULT($with_symlink)
172test "$with_symlink" = yes && with_symlink=xterm
173test -n "$with_symlink" && \
174	test "$with_symlink" != no && \
175	test "$with_symlink" != "$cf_name" && \
176	XTERM_SYMLINK="$with_symlink"
177fi
178
179AC_MSG_CHECKING(if you want to disable openpty)
180CF_ARG_DISABLE(openpty,
181	[  --disable-openpty       disable openpty, prefer other interfaces],
182	[disable_openpty=yes],
183	[disable_openpty=no],
184	no)
185AC_MSG_RESULT($disable_openpty)
186
187AC_MSG_CHECKING(if you want to disable setuid)
188CF_ARG_DISABLE(setuid,
189	[  --disable-setuid        disable setuid in xterm, do not install setuid/setgid],
190	[disable_setuid=yes],
191	[disable_setuid=no],
192	no)
193AC_MSG_RESULT($disable_setuid)
194
195AC_MSG_CHECKING(if you want to disable setgid)
196CF_ARG_DISABLE(setgid,
197	[  --disable-setgid        disable setgid in xterm, do not install setuid/setgid],
198	[disable_setgid=yes],
199	[disable_setgid=no],
200	no)
201AC_MSG_RESULT($disable_setgid)
202
203AC_MSG_CHECKING(if you want to run xterm setuid to a given user)
204AC_ARG_WITH(setuid,
205	[  --with-setuid=XXX       use the given setuid user],
206	[use_given_setuid=$withval],
207	[use_given_setuid=no])
208AC_MSG_RESULT($use_given_setuid)
209
210if test "$use_given_setuid" != no ; then
211	if test "$use_given_setuid" = yes ; then
212		cf_cv_given_setuid=root
213	else
214		cf_cv_given_setuid=$use_given_setuid
215	fi
216	# inherit SINSTALL_OPTS from environment to allow packager to customize it.
217	SINSTALL_OPTS="$SINSTALL_OPTS u+s -u $cf_cv_given_setuid"
218fi
219
220AC_MSG_CHECKING(if you want to run xterm setgid to match utmp/utmpx file)
221AC_ARG_WITH(utmp-setgid,
222	[  --with-utmp-setgid=XXX  use setgid to match utmp/utmpx file],
223	[use_utmp_setgid=$withval],
224	[use_utmp_setgid=no])
225AC_MSG_RESULT($use_utmp_setgid)
226
227if test "$use_utmp_setgid" != no ; then
228	if test "$use_utmp_setgid" = yes ; then
229		CF_UTMP_GROUP
230	else
231		cf_cv_utmp_group=$use_utmp_setgid
232	fi
233	if test "$cf_cv_posix_saved_ids" != yes ; then
234		AC_MSG_ERROR(Your system does not support POSIX saved-ids)
235	fi
236	AC_DEFINE(USE_UTMP_SETGID,1,[Define to 1 if we should use setgid to access utmp/utmpx])
237	SINSTALL_OPTS="$SINSTALL_OPTS g+s -g $cf_cv_utmp_group"
238fi
239
240AC_SUBST(SINSTALL_OPTS)
241
242AC_MSG_CHECKING(if you want to link with utempter)
243AC_ARG_WITH(utempter,
244	[  --with-utempter         use utempter library for access to utmp],
245	[use_utempter=$withval],
246	[use_utempter=no])
247AC_MSG_RESULT($use_utempter)
248
249if test "$use_utempter" = yes ; then
250	CF_UTEMPTER
251	test "$cf_cv_have_utempter" != yes && use_utempter=no
252else
253	use_utempter=no
254fi
255
256# Some configurations permit (or require) either setuid or setgid mode.
257# Let the user decide.
258if test "$use_utempter" = yes ; then
259	if test "${enable_setuid+set}" != set ; then
260		disable_setuid=yes
261		CF_VERBOSE([No --disable-setuid option given, force to yes])
262	fi
263fi
264
265###	checks for external data
266CF_ERRNO
267CF_TTY_GROUP
268
269###	checks for system services and user specified options
270
271AC_PATH_XTRA
272CF_POSIX_WAIT
273CF_SYSV
274CF_SVR4
275CF_X_TOOLKIT
276
277AC_CHECK_HEADERS( \
278	X11/DECkeysym.h \
279	X11/Sunkeysym.h \
280	X11/XF86keysym.h \
281	X11/XKBlib.h \
282	X11/TranslateI.h \
283	X11/Xpoll.h \
284	X11/extensions/XKB.h \
285	)
286
287CF_WITH_XPM
288CF_WITH_XINERAMA
289CF_X_ATHENA
290CF_TYPE_FD_MASK
291CF_TERMIO_C_ISPEED
292CF_TERMIOS_TYPES
293
294# The Xcursor library is normally (weakly) linked via the X11 library rather
295# than directly to applications.  xterm can select a cursor theme; users can
296# also use environment variables to select cursor size.  We would only notice
297# the library if there are development files for it.  Provide a way to disable
298# the feature if it is unwanted.
299AC_MSG_CHECKING(if we expect to use the Xcursor library)
300CF_ARG_DISABLE(xcursor,
301	[  --disable-xcursor        disable cursorTheme resource],
302	[enable_xcursor=no],
303	[enable_xcursor=yes])
304AC_MSG_RESULT($enable_xcursor)
305if test "$enable_xcursor" = yes; then
306	AC_DEFINE(HAVE_LIB_XCURSOR,1,[Define to 1 if we expect to use the Xcursor library])
307fi
308
309LIBS="$LIBS $X_EXTRA_LIBS"
310
311CF_FUNC_GRANTPT
312CF_XKB_QUERY_EXTENSION
313CF_XKB_KEYCODE_TO_KEYSYM
314CF_XKB_BELL_EXT
315
316AC_CHECK_FUNCS(Xutf8LookupString, [],[
317	EXTRAHDRS="$EXTRAHDRS xutf8.h"
318	EXTRASRCS="$EXTRASRCS xutf8.c"
319	EXTRAOBJS="$EXTRAOBJS xutf8.o"
320])
321
322CF_WITH_IMAKE_CFLAGS($(MAIN_DEFINES) $(VENDORMANDEFS))
323CF_WITH_MAN2HTML
324
325# If we have already established that there is a full termcap implementation,
326# suppress the definitions for terminfo that we make have imported from the
327# imake-file.
328if test "x$cf_cv_lib_tgetent" != xno || test "x$cf_cv_lib_part_tgetent" != xno ; then
329	case "$IMAKE_CFLAGS" in
330	(*-DUSE_TERMINFO\ -DHAVE_TIGETSTR*)
331		CF_UNDO_CFLAGS(IMAKE_CFLAGS,terminfo,[-DUSE_TERMINFO[[ 	]]*-DHAVE_TIGETSTR[[ 	]]*])
332		CF_UNDO_CFLAGS(CPPFLAGS,terminfo,[-DUSE_TERMINFO[[ 	]]*-DHAVE_TIGETSTR[[ 	]]*])
333		;;
334	esac
335fi
336
337CF_HELP_MESSAGE(Terminal Configuration:)
338
339AC_MSG_CHECKING(for default terminal-id)
340AC_ARG_WITH(terminal-id,
341	[  --with-terminal-id=V    set default decTerminalID (default: vt420)],
342	[default_termid=$withval],
343	[default_termid=vt420])
344AC_MSG_RESULT($default_termid)
345case $default_termid in
346(vt*)	default_termid=`echo $default_termid | sed -e 's/^..//'`
347	;;
348esac
349AC_DEFINE_UNQUOTED(DFT_DECID,"$default_termid",[default terminal-id])
350AC_SUBST(default_termid)
351
352AC_MSG_CHECKING(for default terminal-type)
353AC_ARG_WITH(terminal-type,
354	[  --with-terminal-type=T  set default $TERM (default: xterm)],
355	[default_TERM=$withval],
356	[default_TERM=xterm])
357AC_MSG_RESULT($default_TERM)
358AC_DEFINE_UNQUOTED(DFT_TERMTYPE,"$default_TERM",[default terminal-type])
359AC_SUBST(default_TERM)
360
361###############################################################################
362AC_MSG_CHECKING(if backarrow-key should be BS)
363CF_ARG_DISABLE(backarrow-key,
364	[  --enable-backarrow-key  set default backarrowKey resource (default: true)],
365	[backarrow_is_bs=$enableval],
366	[backarrow_is_bs=yes])
367CF_XBOOL_RESULT(DEF_BACKARO_BS,backarrow_is_bs,[Define to 1 if backarrow-key should be BS])
368
369AC_MSG_CHECKING(if backarrow-key should be treated as erase)
370CF_ARG_ENABLE(backarrow-is-erase,
371	[  --enable-backarrow-is-erase set default backarrowKeyIsErase resource (default: false)],
372	[backarrow_is_erase=$enableval],
373	[backarrow_is_erase=no])
374CF_XBOOL_RESULT(DEF_BACKARO_ERASE,backarrow_is_erase,[Define to 1 if backarrow-key should be treated as erase])
375
376AC_MSG_CHECKING(for default backspace/DEL setting)
377AC_ARG_ENABLE(delete-is-del,
378	[  --enable-delete-is-del  set default deleteIsDEL resource (default: maybe)],
379	[delete_is_del=$enableval],
380	[delete_is_del=maybe])
381CF_XBOOL_RESULT(DEFDELETE_DEL,delete_is_del,[Define to 1 if default backspace/DEL setting is DEL])
382
383AC_MSG_CHECKING(for default pty initial erase setting)
384AC_ARG_ENABLE(pty-erase,
385	[  --enable-pty-erase      set default ptyInitialErase resource (default: maybe)],
386	[initial_erase=$enableval],
387	[initial_erase=False])
388CF_XBOOL_RESULT(DEF_INITIAL_ERASE,initial_erase,[Define to 1 if default pty initial erase setting is TRUE])
389
390AC_MSG_CHECKING(if alt should send ESC)
391CF_ARG_ENABLE(alt-sends-esc,
392	[  --enable-alt-sends-esc  set default altSendsEscape resource (default: no)],
393	[alt_sends_esc=$enableval],
394	[alt_sends_esc=no])
395CF_XBOOL_RESULT(DEF_ALT_SENDS_ESC,alt_sends_esc,[Define to 1 if alt should send ESC])
396
397AC_MSG_CHECKING(if meta should send ESC)
398CF_ARG_ENABLE(meta-sends-esc,
399	[  --enable-meta-sends-esc set default metaSendsEscape resource (default: no)],
400	[meta_sends_esc=$enableval],
401	[meta_sends_esc=no])
402CF_XBOOL_RESULT(DEF_META_SENDS_ESC,meta_sends_esc,[Define to 1 if meta should send ESC])
403
404###############################################################################
405AC_CHECK_PROG(cf_tic_prog,tic,yes,no)
406if test "$cf_tic_prog" = yes ; then
407	if test -n "$TERMINFO"
408	then
409		case "$TERMINFO" in
410		(/*)
411			test -d "$TERMINFO" || unset TERMINFO
412			;;
413		(*)
414			unset TERMINFO
415			;;
416		esac
417	fi
418	AC_MSG_CHECKING(for private terminfo-directory)
419	AC_ARG_WITH(own-terminfo,
420		[  --with-own-terminfo=P   set default $TERMINFO (default: from environment)],
421		[TERMINFO_DIR=$withval],
422		[TERMINFO_DIR=${TERMINFO-none}])
423	AC_MSG_RESULT($TERMINFO_DIR)
424	if test "$TERMINFO_DIR" = yes ; then
425		AC_MSG_WARN(no value given)
426	elif test "$TERMINFO_DIR" != none ; then
427		if test -d "$TERMINFO_DIR" ; then
428			AC_DEFINE_UNQUOTED(OWN_TERMINFO_DIR,"$TERMINFO_DIR",[Define to override default TERMINFO value])
429			AC_MSG_CHECKING(if \$TERMINFO should also be set)
430			AC_ARG_ENABLE(env-terminfo,
431				[  --enable-env-terminfo   setenv $TERMINFO if --with-own-terminfo gives value],
432				[cf_env_terminfo=yes],
433				[cf_env_terminfo=no])
434			AC_MSG_RESULT($cf_env_terminfo)
435			test $cf_env_terminfo = yes &&
436			AC_DEFINE(OWN_TERMINFO_ENV,1,[Define to 1 to enable setenv of $TERMINFO value])
437		else
438			AC_MSG_WARN(not a directory)
439		fi
440	elif test "$prefix" != NONE ; then
441		TERMINFO_DIR='${prefix}/lib/terminfo'
442	elif test -d /usr/lib/terminfo ; then
443		TERMINFO_DIR=/usr/lib/terminfo
444	else
445		TERMINFO_DIR=
446	fi
447	SET_TERMINFO=
448	if test -n "$TERMINFO_DIR" ; then
449		TERMINFO_DIR='${DESTDIR}'$TERMINFO_DIR
450		SET_TERMINFO='TERMINFO=${TERMINFO_DIR}'
451	fi
452	no_ticprog=
453else
454	no_ticprog="#"
455	TERMINFO_DIR=
456	SET_TERMINFO=
457fi
458AC_SUBST(no_ticprog)
459AC_SUBST(TERMINFO_DIR)
460AC_SUBST(SET_TERMINFO)
461
462###############################################################################
463CF_HELP_MESSAGE(Optional Features:)
464
465AC_MSG_CHECKING(if you want active-icons)
466CF_ARG_DISABLE(active-icon,
467	[  --disable-active-icon   disable X11R6.3 active-icon feature],
468	[enable_active_icon=no],
469	[enable_active_icon=yes])
470AC_MSG_RESULT($enable_active_icon)
471if test "$enable_active_icon" = no ; then
472	AC_DEFINE(NO_ACTIVE_ICON,1,[Define to 1 to disable X11R6.3 active-icon feature])
473fi
474
475AC_MSG_CHECKING(if you want ANSI color)
476CF_ARG_DISABLE(ansi-color,
477	[  --disable-ansi-color    disable ANSI color],
478	[enable_ansi_color=no],
479	[enable_ansi_color=yes])
480AC_MSG_RESULT($enable_ansi_color)
481test "$enable_ansi_color" = no && AC_DEFINE(OPT_ISO_COLORS,0,[Define to 0 to disable ANSI color])
482
483if test "$enable_ansi_color" = yes ; then
484
485	AC_MSG_CHECKING(if you want 16 colors like aixterm)
486	CF_ARG_DISABLE(16-color,
487		[  --disable-16-color      disable 16-color support],
488		[enable_16_color=no],
489		[enable_16_color=yes])
490	AC_MSG_RESULT($enable_16_color)
491	test "$enable_16_color" = no && AC_DEFINE(OPT_AIX_COLORS,0,[Define to 0 to disable 16-color support])
492
493	AC_MSG_CHECKING(if you want 256 colors)
494	CF_ARG_DISABLE(256-color,
495		[  --disable-256-color     disable 256-color support],
496		[enable_256_color=no],
497		[enable_256_color=yes])
498	AC_MSG_RESULT($enable_256_color)
499
500	if test "$enable_256_color" = yes ; then
501
502		CHARPROC_DEPS="$CHARPROC_DEPS 256colres.h"
503		EXTRAHDRS="$EXTRAHDRS 256colres.h"
504		AC_DEFINE(OPT_256_COLORS,1,[Define to 1 to enable 256-color support])
505
506		AC_MSG_CHECKING(if you want direct-color support)
507		CF_ARG_DISABLE(direct-color,
508			[  --disable-direct-color  disable direct-color support],
509			[enable_direct_color=no],
510			[enable_direct_color=yes])
511		AC_MSG_RESULT($enable_direct_color)
512		if test "$enable_direct_color" = yes ; then
513			AC_DEFINE(OPT_DIRECT_COLOR,1,[Define to 1 to enable direct-color support])
514		fi
515
516	else
517
518		AC_MSG_CHECKING(if you want 88 colors)
519		CF_ARG_DISABLE(88-color,
520			[  --disable-88-color      disable 88-color support],
521			[enable_88_color=no],
522			[enable_88_color=yes])
523		AC_MSG_RESULT($enable_88_color)
524		if test "$enable_88_color" = yes ; then
525			CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h"
526			EXTRAHDRS="$EXTRAHDRS 88colres.h"
527			AC_DEFINE(OPT_88_COLORS,1,[Define to 1 to enable 88-color support])
528		fi
529
530	fi
531
532fi
533
534AC_MSG_CHECKING(if you want blinking cursor)
535CF_ARG_DISABLE(blink-cursor,
536	[  --disable-blink-cursor  disable support for blinking cursor],
537	[enable_blink_curs=no],
538	[enable_blink_curs=yes])
539AC_MSG_RESULT($enable_blink_curs)
540test "$enable_blink_curs" = no && AC_DEFINE(OPT_BLINK_CURS,0,[Define to 0 to disable support for blinking cursor])
541
542AC_MSG_CHECKING(if you want to ignore Linux's broken palette-strings)
543
544case $host_os in
545(linux*)
546	assume_broken_osc=yes ;;
547(*)
548	assume_broken_osc=no ;;
549esac
550
551CF_ARG_OPTION(broken-osc,
552	[  --enable-broken-osc     allow broken Linux OSC-strings],
553	[enable_broken_osc=$enableval],
554	[enable_broken_osc=$enableval],
555	[$assume_broken_osc])
556AC_MSG_RESULT($enable_broken_osc)
557if test "$enable_broken_osc" = yes ; then
558	AC_DEFINE(OPT_BROKEN_OSC,1,[Define to 1 to allow broken Linux OSC-strings])
559else
560	AC_DEFINE(OPT_BROKEN_OSC,0,[Define to 0 to allow broken Linux OSC-strings])
561fi
562
563AC_MSG_CHECKING(if you want to allow broken string-terminators)
564CF_ARG_ENABLE(broken-st,
565	[  --disable-broken-st     disallow broken string-terminators],
566	[enable_broken_st=no],
567	[enable_broken_st=yes])
568AC_MSG_RESULT($enable_broken_st)
569test "$enable_broken_st" = no && AC_DEFINE(OPT_BROKEN_ST,0,[Define to 0 to disallow broken string-terminators])
570
571AC_MSG_CHECKING(if you want to compile-in icon data)
572CF_ARG_ENABLE(builtin-xpms,
573	[  --enable-builtin-xpms   compile-in icon data],
574	[enable_builtin_xpms=yes],
575	[enable_builtin_xpms=no])
576AC_MSG_RESULT($enable_builtin_xpms)
577test "$enable_builtin_xpms" = yes && AC_DEFINE(OPT_BUILTIN_XPMS,1,[Define to 1 to compile-in icon data])
578
579AC_MSG_CHECKING(if you want printable 128-159)
580CF_ARG_DISABLE(c1-print,
581	[  --disable-c1-print      disallow -k8 option for printable 128-159],
582	[enable_c1_print=no],
583	[enable_c1_print=yes])
584AC_MSG_RESULT($enable_c1_print)
585test "$enable_c1_print" = no && AC_DEFINE(OPT_C1_PRINT,0,[Define to 0 to disallow -k8 option for printable 128-159])
586
587if test "$enable_ansi_color" = yes ; then
588
589	AC_MSG_CHECKING(if you want bold colors mapped like IBM PC)
590	CF_ARG_DISABLE(bold-color,
591		[  --disable-bold-color    disable PC-style mapping of bold colors],
592		[enable_pc_color=no],
593		[enable_pc_color=yes])
594	AC_MSG_RESULT($enable_pc_color)
595	test "$enable_pc_color" = no && AC_DEFINE(OPT_PC_COLORS,0,[Define to 0 to disable PC-style mapping of bold colors])
596
597	AC_MSG_CHECKING(if you want separate color-classes)
598	CF_ARG_DISABLE(color-class,
599		[  --disable-color-class   disable separate color class resources],
600		[enable_color_class=no],
601		[enable_color_class=yes])
602	AC_MSG_RESULT($enable_color_class)
603	test "$enable_color_class" = no && AC_DEFINE(OPT_COLOR_CLASS,0,[Define to 0 to disable separate color class resources])
604
605	AC_MSG_CHECKING(if you want color-mode enabled by default)
606	CF_ARG_DISABLE(color-mode,
607		[  --disable-color-mode    disable default colorMode resource],
608		[default_colormode=no],
609		[default_colormode=yes])
610	AC_MSG_RESULT($default_colormode)
611	test "$default_colormode" = no && AC_DEFINE(DFT_COLORMODE,0,[Define to 0 if you want color-mode enabled by default])
612
613fi
614
615AC_MSG_CHECKING(if you want support for color highlighting)
616CF_ARG_DISABLE(highlighting,
617	[  --disable-highlighting  disable support for color highlighting],
618	[default_highlight=no],
619	[default_highlight=yes])
620AC_MSG_RESULT($default_highlight)
621test "$default_highlight" = no && AC_DEFINE(OPT_HIGHLIGHT_COLOR,0,[Define to 1 if you want support for color highlighting])
622
623AC_MSG_CHECKING(if you want support for doublesize characters)
624CF_ARG_DISABLE(doublechars,
625	[  --disable-doublechars   disable support for double-size chars],
626	[enable_doublechars=no],
627	[enable_doublechars=yes])
628AC_MSG_RESULT($enable_doublechars)
629test "$enable_doublechars" = no && AC_DEFINE(OPT_DEC_CHRSET,0,[Define to 0 to disable support for double-size chars])
630
631AC_MSG_CHECKING(if you want fallback-support for box characters)
632CF_ARG_DISABLE(boxchars,
633	[  --disable-boxchars      disable fallback-support for box chars],
634	[enable_boxchars=no],
635	[enable_boxchars=yes])
636AC_MSG_RESULT($enable_boxchars)
637test "$enable_boxchars" = no && AC_DEFINE(OPT_BOX_CHARS,0,[Define to 0 to disable fallback-support for box chars])
638
639AC_MSG_CHECKING(if you want to allow spawning commands to process selections)
640CF_ARG_DISABLE(exec-selection,
641	[  --disable-exec-selection disable "exec-formatted" and "exec-selection" actions],
642	[enable_exec_selection=no],
643	[enable_exec_selection=yes])
644AC_MSG_RESULT($enable_exec_selection)
645if test "$enable_exec_selection" = no ; then
646	AC_DEFINE(OPT_EXEC_SELECTION,0,[Define to 0 to disable "exec-selection" action])
647fi
648
649AC_MSG_CHECKING(if you want to allow spawning new xterms)
650CF_ARG_ENABLE(exec-xterm,
651	[  --enable-exec-xterm     enable "spawn-new-terminal" action],
652	[enable_exec_xterm=yes],
653	[enable_exec_xterm=no])
654AC_MSG_RESULT($enable_exec_xterm)
655if test "$enable_exec_xterm" = yes ; then
656	CF_PROCFS_CWD
657	if test "$cf_cv_procfs_cwd" = no ; then
658		AC_MSG_WARN(no suitable proc filesystem found)
659	else
660		AC_DEFINE_UNQUOTED(PROCFS_ROOT,"$cf_cv_procfs_cwd",[This is defined via the --enable-exec-xterm option])
661		AC_DEFINE(OPT_EXEC_XTERM,1,[Define to 1 to enable "spawn-new-terminal" action])
662	fi
663fi
664
665CF_X_EXT
666CF_X_EXT_DOUBLE_BUFFER
667double_buffer=False
668if test "$cf_x_ext_double_buffer" = yes ; then
669	AC_MSG_CHECKING(if you want to enable double-buffering in default resources)
670	CF_ARG_ENABLE(double-buffer,
671		[  --enable-double-buffer  enable double-buffering in default resources],
672		[enable_double_bfr=yes],
673		[enable_double_bfr=no])
674	AC_MSG_RESULT($enable_double_bfr)
675	if test "$enable_double_bfr" = yes ; then
676		AC_DEFINE(OPT_DOUBLE_BUFFER,1,[Define to 1 to enable double-buffering in default resources])
677		double_buffer=True
678	fi
679fi
680AC_SUBST(double_buffer)
681
682AC_MSG_CHECKING(if you want to use FreeType library)
683CF_ARG_DISABLE(freetype,
684	[  --disable-freetype      disable freetype library-support],
685	[enable_freetype=no],
686	[enable_freetype=yes])
687AC_MSG_RESULT($enable_freetype)
688if test "$enable_freetype" = yes ; then
689	CF_X_FONTCONFIG
690else
691	CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//`
692fi
693
694AC_MSG_CHECKING(if you want support for HP-style function keys)
695CF_ARG_ENABLE(hp-fkeys,
696	[  --enable-hp-fkeys       enable support for HP-style function keys],
697	[enable_hp_fkeys=yes],
698	[enable_hp_fkeys=no])
699AC_MSG_RESULT($enable_hp_fkeys)
700if test "$enable_hp_fkeys" = yes ; then
701	AC_DEFINE(OPT_HP_FUNC_KEYS,1,[Define to 1 to enable support for HP-style function keys])
702fi
703
704AC_MSG_CHECKING(if you want support for SCO-style function keys)
705CF_ARG_ENABLE(sco-fkeys,
706	[  --enable-sco-fkeys      enable support for SCO-style function keys],
707	[enable_sco_fkeys=yes],
708	[enable_sco_fkeys=no])
709AC_MSG_RESULT($enable_sco_fkeys)
710if test "$enable_sco_fkeys" = yes ; then
711	AC_DEFINE(OPT_SCO_FUNC_KEYS,1,[Define to 1 to enable support for SCO-style function keys])
712fi
713
714AC_MSG_CHECKING(if you want support for Sun-style function keys)
715CF_ARG_DISABLE(sun-fkeys,
716	[  --disable-sun-fkeys     disable support for Sun-style function keys],
717	[enable_sun_fkeys=no],
718	[enable_sun_fkeys=yes])
719AC_MSG_RESULT($enable_sun_fkeys)
720if test "$enable_sun_fkeys" = no ; then
721	AC_DEFINE(OPT_SUN_FUNC_KEYS,0,[Define to 0 to disable support for Sun-style function keys])
722fi
723
724AC_MSG_CHECKING(if you want saved-lines stored as a FIFO)
725CF_ARG_DISABLE(fifo-lines,
726	[  --disable-fifo-lines    disable FIFO-storage for saved-lines],
727	[enable_fifo_lines=no],
728	[enable_fifo_lines=yes])
729AC_MSG_RESULT($enable_fifo_lines)
730if test "$enable_fifo_lines" != yes ; then
731	AC_MSG_WARN(this option has been deprecated)
732fi
733
734AC_MSG_CHECKING(if you want support for internationalization)
735CF_ARG_DISABLE(i18n,
736	[  --disable-i18n          disable internationalization],
737	[enable_i18n=no],
738	[enable_i18n=yes])
739AC_MSG_RESULT($enable_i18n)
740if test "$enable_i18n" = no ; then
741	AC_DEFINE(OPT_I18N_SUPPORT,0,[Define to 0 to disable internationalization])
742fi
743
744AC_MSG_CHECKING(if you want support for initial-erase setup)
745CF_ARG_DISABLE(initial-erase,
746	[  --disable-initial-erase disable setup for stty erase],
747	[enable_ie=no],
748	[enable_ie=yes])
749AC_MSG_RESULT($enable_ie)
750if test "$enable_ie" = no ; then
751	AC_DEFINE(OPT_INITIAL_ERASE,0,[Define to 0 to disable setup for stty erase])
752fi
753
754AC_MSG_CHECKING(if you want support for input-method)
755CF_ARG_DISABLE(input-method,
756	[  --disable-input-method  disable input-method],
757	[enable_ximp=no],
758	[enable_ximp=$enable_i18n])
759AC_MSG_RESULT($enable_ximp)
760CF_INPUT_METHOD
761test "$cf_cv_input_method" = no && enable_ximp=no
762if test "$enable_ximp" != no ; then
763	if test "$enable_i18n" = no ; then
764		AC_MSG_WARN(input-methor relies upon internationalization)
765		enable_ximp=no
766	fi
767fi
768if test "$enable_ximp" = no ; then
769	AC_DEFINE(OPT_INPUT_METHOD,0,[Define to 0 to disable input-method])
770fi
771
772AC_MSG_CHECKING(if you want support for load-vt-fonts)
773CF_ARG_ENABLE(load-vt-fonts,
774	[  --enable-load-vt-fonts  enable load-vt-fonts() action],
775	[enable_load_vt_fonts=yes],
776	[enable_load_vt_fonts=no])
777AC_MSG_RESULT($enable_load_vt_fonts)
778if test "$enable_load_vt_fonts" = yes ; then
779	AC_DEFINE(OPT_LOAD_VTFONTS,1,[Define to 1 to enable load-vt-fonts() action])
780fi
781
782AC_MSG_CHECKING(if you want support for logging)
783CF_ARG_ENABLE(logging,
784	[  --enable-logging        enable logging],
785	[enable_logging=yes],
786	[enable_logging=no])
787AC_MSG_RESULT($enable_logging)
788if test "$enable_logging" = yes ; then
789	AC_DEFINE(ALLOWLOGGING,1,[if you want support for logging])
790	AC_MSG_CHECKING(if you want to allow logging via a pipe)
791	CF_ARG_ENABLE(logfile-exec,
792		[  --enable-logfile-exec   enable exec'd logfile filter],
793		[enable_log_exec=yes],
794		[enable_log_exec=no])
795	AC_MSG_RESULT($enable_log_exec)
796	if test "$enable_log_exec" = yes ; then
797		AC_DEFINE(ALLOWLOGFILEEXEC,1,[if you want to allow logging via a pipe])
798	fi
799fi
800
801AC_MSG_CHECKING(if you want support for iconify/maximize translations)
802CF_ARG_DISABLE(maximize,
803	[  --disable-maximize      disable actions for iconify/deiconify/maximize/restore],
804	[enable_maximize=no],
805	[enable_maximize=yes])
806AC_MSG_RESULT($enable_maximize)
807test "$enable_maximize" = no && AC_DEFINE(OPT_MAXIMIZE,0,[Define to 0 to disable actions for iconify/deiconify/maximize/restore])
808
809AC_MSG_CHECKING(if you want NumLock to override keyboard tables)
810CF_ARG_DISABLE(num-lock,
811	[  --disable-num-lock      disable NumLock keypad support],
812	[enable_numlock=no],
813	[enable_numlock=yes])
814AC_MSG_RESULT($enable_numlock)
815test "$enable_numlock" = no && AC_DEFINE(OPT_NUM_LOCK,0,[Define to 0 to disable NumLock keypad support])
816
817AC_MSG_CHECKING(if you want support for get/set of base64 selection data)
818
819CF_ARG_DISABLE(paste64,
820	[  --disable-paste64       disable get/set base64 selection data],
821	[enable_paste64=no],
822	[enable_paste64=yes])
823AC_MSG_RESULT($enable_paste64)
824if test "$enable_paste64" = yes ; then
825	AC_DEFINE(OPT_PASTE64,1,[Define to 1 to disable get/set base64 selection data])
826else
827	AC_DEFINE(OPT_PASTE64,0,[Define to 0 to disable get/set base64 selection data])
828fi
829
830AC_MSG_CHECKING(if you want support for pty-handshaking)
831
832CF_ARG_DISABLE(pty-handshake,
833	[  --disable-pty-handshake disable pty-handshake support],
834	[enable_pty_handshake=no],
835	[enable_pty_handshake=yes])
836AC_MSG_RESULT($enable_pty_handshake)
837if test "$enable_pty_handshake" = yes ; then
838	AC_DEFINE(OPT_PTY_HANDSHAKE,1,[Define to 1 to disable pty-handshake support])
839else
840	AC_DEFINE(OPT_PTY_HANDSHAKE,0,[Define to 0 to disable pty-handshake support])
841fi
842
843AC_MSG_CHECKING(if you want support for mouse in readline applications)
844CF_ARG_DISABLE(readline-mouse,
845	[  --disable-readline-mouse disable support for mouse in readline applications],
846	[enable_readline_mouse=no],
847	[enable_readline_mouse=yes])
848AC_MSG_RESULT($enable_readline_mouse)
849if test "$enable_readline_mouse" = yes ; then
850	AC_DEFINE(OPT_READLINE,1,[Define to 1 to enable support for mouse in readline applications])
851fi
852
853AC_MSG_CHECKING(if you want support for regular-expression selections)
854CF_ARG_DISABLE(regex,
855	[  --disable-regex         disable regular-expression selections],
856	[enable_regex=no],
857	[enable_regex=yes])
858AC_MSG_RESULT($enable_regex)
859if test "$enable_regex" = yes ; then
860	CF_WITH_PCRE2
861	if test "$with_pcre2" = no ; then
862		CF_WITH_PCRE
863		if test "$with_pcre" = no ; then
864			CF_REGEX
865			if test "X$cf_cv_regex_hdrs" != "Xregex.h" ; then
866				AC_MSG_ERROR([Only POSIX, PCRE, or PCRE2 regular expressions are supported])
867			fi
868		fi
869	fi
870	AC_DEFINE(OPT_SELECT_REGEX,1,[Define to 1 to enable regular-expression selections])
871fi
872
873AC_MSG_CHECKING(if you want support for right-scrollbar)
874CF_ARG_DISABLE(rightbar,
875	[  --disable-rightbar      disable right-scrollbar support],
876	[enable_rightbar=no],
877	[enable_rightbar=yes])
878AC_MSG_RESULT($enable_rightbar)
879if test "$enable_rightbar" = yes ; then
880	AC_DEFINE(SCROLLBAR_RIGHT,1,[Define to 1 to enable right-scrollbar support])
881fi
882
883AC_MSG_CHECKING(if you want check for redundant name-change)
884CF_ARG_DISABLE(samename,
885	[  --disable-samename      disable check for redundant name-change],
886	[enable_samename=no],
887	[enable_samename=yes])
888AC_MSG_RESULT($enable_samename)
889test "$enable_samename" = no && AC_DEFINE(OPT_SAME_NAME,0,[Define to 0 to disable check for redundant name-change])
890
891AC_MSG_CHECKING(if you want support for selection-actions)
892CF_ARG_DISABLE(selection-ops,
893	[  --disable-selection-ops disable selection-action operations],
894	[enable_selection_ops=no],
895	[enable_selection_ops=yes])
896AC_MSG_RESULT($enable_selection_ops)
897test "$enable_selection_ops" = no && AC_DEFINE(OPT_SELECTION_OPS,0,[Define to 0 disable selection-action operations])
898
899AC_MSG_CHECKING(if you want support for session management)
900CF_ARG_DISABLE(session-mgt,
901	[  --disable-session-mgt   disable support for session management],
902	[enable_session_mgt=no],
903	[enable_session_mgt=yes])
904AC_MSG_RESULT($enable_session_mgt)
905test "$enable_session_mgt" = no && AC_DEFINE(OPT_SESSION_MGT,0,[Define to 0 to disable support for session management])
906
907AC_MSG_CHECKING(if you want support for status-line)
908CF_ARG_ENABLE(status-line,
909	[  --enable-status-line    enable support for status-line],
910	[enable_status_line=yes],
911	[enable_status_line=no])
912AC_MSG_RESULT($enable_status_line)
913test "$enable_status_line" = yes && AC_DEFINE(OPT_STATUS_LINE,1,[Define to 1 to enable support for status-line])
914
915AC_MSG_CHECKING(if you want to use termcap function-keys)
916CF_ARG_DISABLE(tcap-fkeys,
917	[  --disable-tcap-fkeys    disable termcap function-keys support],
918	[enable_tcap_fkeys=no],
919	[enable_tcap_fkeys=yes])
920AC_MSG_RESULT($enable_tcap_fkeys)
921test "$enable_tcap_fkeys" = no && AC_DEFINE(OPT_TCAP_FKEYS,0,[Define to 0 to disable termcap function-keys support])
922
923AC_MSG_CHECKING(if you want to use termcap-query/report)
924CF_ARG_DISABLE(tcap-query,
925	[  --disable-tcap-query    disable compiled-in termcap-query support],
926	[enable_tcap_query=no],
927	[enable_tcap_query=yes])
928AC_MSG_RESULT($enable_tcap_query)
929test "$enable_tcap_query" = no && AC_DEFINE(OPT_TCAP_QUERY,0,[Define to 0 to disable compiled-in termcap-query support])
930
931AC_MSG_CHECKING(if you want support for tek4014)
932CF_ARG_DISABLE(tek4014,
933	[  --disable-tek4014       disable tek4014 emulation],
934	[enable_tek4014=no],
935	[enable_tek4014=yes])
936AC_MSG_RESULT($enable_tek4014)
937if test "$enable_tek4014" = no ; then
938	AC_DEFINE(OPT_TEK4014,0,[Define to 0 to disable tek4014 emulation])
939else
940	EXTRAHDRS="$EXTRAHDRS Tekparse.h"
941	EXTRASRCS="$EXTRASRCS TekPrsTbl.c Tekproc.c"
942	EXTRAOBJS="$EXTRAOBJS TekPrsTbl.o Tekproc.o"
943fi
944
945AC_MSG_CHECKING(if you want pulldown menus with a toolbar)
946CF_ARG_ENABLE(toolbar,
947	[  --enable-toolbar        compile-in toolbar for pulldown menus],
948	[enable_toolbar=yes],
949	[enable_toolbar=no])
950AC_MSG_RESULT($enable_toolbar)
951if test "$enable_toolbar" = yes ; then
952	AC_DEFINE(OPT_TOOLBAR,1,[Define to 1 to compile-in toolbar for pulldown menus])
953fi
954
955AC_MSG_CHECKING(if you want VT52 emulation)
956CF_ARG_DISABLE(vt52,
957	[  --disable-vt52          disable VT52 emulation],
958	[enable_vt52=no],
959	[enable_vt52=yes])
960AC_MSG_RESULT($enable_vt52)
961test "$enable_vt52" = no && AC_DEFINE(OPT_VT52_MODE,0,[Define to 0 to disable VT52 emulation])
962
963AC_MSG_CHECKING(if you want wide-attribute support)
964CF_ARG_DISABLE(wide-attrs,
965	[  --disable-wide-attrs    disable wide-attribute support],
966	[enable_wattr=no],
967	[enable_wattr=yes])
968AC_MSG_RESULT($enable_wattr)
969
970if test x$enable_wattr = xno && test x$enable_direct_color = xyes ; then
971	AC_MSG_WARN(overriding wide-attributes to support direct color)
972	enable_wattr=yes
973fi
974
975AC_MSG_CHECKING(if you want wide-character support)
976CF_ARG_DISABLE(wide-chars,
977	[  --disable-wide-chars    disable wide-character support],
978	[enable_wchar=no],
979	[enable_wchar=yes])
980AC_MSG_RESULT($enable_wchar)
981test "x$enable_wattr" = xno && AC_DEFINE(OPT_WIDE_ATTRS,0,[Define to 0 to disable rarely-used SGR features])
982
983AC_MSG_CHECKING(if you want only 16-bit character support)
984CF_ARG_ENABLE(16bit-chars,
985	[  --enable-16bit-chars    enable 16-bit character support],
986	[enable_16bit_chars=yes],
987	[enable_16bit_chars=no])
988AC_MSG_RESULT($enable_16bit_chars)
989
990if test "$enable_16bit_chars" = yes ; then
991	AC_DEFINE(OPT_WIDER_ICHAR,0,[Define to 0 to enable 16-bit character support])
992	enable_wchar=yes
993fi
994
995if test "$enable_wchar" = yes ; then
996
997AC_MSG_CHECKING(if you want to use mini-luit/Latin9 built-in support)
998CF_ARG_ENABLE(mini-luit,
999	[  --enable-mini-luit      enable mini-luit (built-in Latin9 support)],
1000	[enable_mini_luit=yes],
1001	[enable_mini_luit=no])
1002AC_MSG_RESULT($enable_mini_luit)
1003if test "$enable_mini_luit" = yes ; then
1004	AC_DEFINE(OPT_MINI_LUIT,1,[Define to 1 to enable mini-luit (built-in Latin9 support)])
1005fi
1006
1007AC_MSG_CHECKING(if you want to use luit)
1008CF_ARG_DISABLE(luit,
1009	[  --disable-luit          enable luit filter (Unicode translation)],
1010	[enable_luit=no],
1011	[enable_luit=yes])
1012AC_MSG_RESULT($enable_luit)
1013if test "$enable_luit" = yes ; then
1014	AC_DEFINE(OPT_LUIT_PROG,1,[Define to 1 to enable luit filter (Unicode translation)])
1015	CF_PATH_PROG(LUIT,xterm-filter,bluit luit)
1016fi
1017
1018	AC_DEFINE(OPT_WIDE_CHARS,1,[Define to 1 to enable wide-character support])
1019	EXTRAHDRS="$EXTRAHDRS charclass.h precompose.h wcwidth.h"
1020	EXTRASRCS="$EXTRASRCS charclass.c precompose.c wcwidth.c"
1021	EXTRAOBJS="$EXTRAOBJS charclass.o precompose.o wcwidth.o"
1022fi
1023
1024AC_MSG_CHECKING(if you want dynamic-abbreviation support)
1025CF_ARG_ENABLE(dabbrev,
1026	[  --enable-dabbrev        enable dynamic-abbreviation support],
1027	[enable_dabbrev=yes],
1028	[enable_dabbrev=no])
1029AC_MSG_RESULT($enable_dabbrev)
1030if test "$enable_dabbrev" = yes ; then
1031	AC_DEFINE(OPT_DABBREV,1,[Define to 1 to enable dynamic-abbreviation support])
1032fi
1033
1034AC_MSG_CHECKING(if you want DECterm Locator support)
1035CF_ARG_ENABLE(dec-locator,
1036	[  --enable-dec-locator    enable DECterm Locator support],
1037	[enable_dec_locator=yes],
1038	[enable_dec_locator=no])
1039AC_MSG_RESULT($enable_dec_locator)
1040if test "$enable_dec_locator" = yes ; then
1041	AC_DEFINE(OPT_DEC_LOCATOR,1,[Define to 1 to enable DECterm Locator support])
1042fi
1043
1044AC_MSG_CHECKING(if you want XHTML and SVG screen dump support)
1045CF_ARG_DISABLE(screen-dumps,
1046	[  --disable-screen-dumps  disable XHTML and SVG screen dumps],
1047	[enable_screen_dumps=no],
1048	[enable_screen_dumps=yes])
1049AC_MSG_RESULT($enable_screen_dumps)
1050if test "$enable_screen_dumps" = yes ; then
1051	EXTRASRCS="$EXTRASRCS html.c svg.c"
1052	EXTRAOBJS="$EXTRAOBJS html.o svg.o"
1053else
1054	AC_DEFINE(OPT_SCREEN_DUMPS,0,[Define to 0 to disable XHTML and SVG screen dump support])
1055fi
1056
1057AC_MSG_CHECKING(if you want ReGIS graphics support)
1058CF_ARG_ENABLE(regis-graphics,
1059	[  --enable-regis-graphics enable ReGIS graphics support],
1060	[enable_regis_graphics=yes],
1061	[enable_regis_graphics=no])
1062AC_MSG_RESULT($enable_regis_graphics)
1063if test "$enable_regis_graphics" = yes ; then
1064	AC_DEFINE(OPT_REGIS_GRAPHICS,1,[Define to 1 to enable ReGIS graphics support])
1065	EXTRAHDRS="$EXTRAHDRS graphics_regis.h"
1066	EXTRASRCS="$EXTRASRCS graphics_regis.c"
1067	EXTRAOBJS="$EXTRAOBJS graphics_regis.o"
1068	CF_MATH_LIB
1069fi
1070
1071AC_MSG_CHECKING(if you want sixel graphics support)
1072CF_ARG_DISABLE(sixel-graphics,
1073	[  --disable-sixel-graphics disable sixel graphics support],
1074	[enable_sixel_graphics=no],
1075	[enable_sixel_graphics=yes])
1076AC_MSG_RESULT($enable_sixel_graphics)
1077if test "$enable_sixel_graphics" = yes ; then
1078	AC_DEFINE(OPT_SIXEL_GRAPHICS,1,[Define to 1 to enable sixel graphics support])
1079	EXTRAHDRS="$EXTRAHDRS graphics_sixel.h"
1080	EXTRASRCS="$EXTRASRCS graphics_sixel.c"
1081	EXTRAOBJS="$EXTRAOBJS graphics_sixel.o"
1082fi
1083
1084if test "$enable_regis_graphics" = yes || test "$enable_sixel_graphics" = yes ; then
1085	AC_DEFINE(OPT_GRAPHICS,1,[Defined to 1 to if any graphics mode is enabled])
1086	EXTRAHDRS="$EXTRAHDRS graphics.h"
1087	EXTRASRCS="$EXTRASRCS graphics.c"
1088	EXTRAOBJS="$EXTRAOBJS graphics.o"
1089fi
1090
1091AC_MSG_CHECKING(if you want sixel screen dump support)
1092CF_ARG_DISABLE(print-graphics,
1093	[  --disable-print-graphics disable screen dump to sixel support],
1094	[enable_print_graphics=no],
1095	[enable_print_graphics=$enable_regis_graphics])
1096AC_MSG_RESULT($enable_print_graphics)
1097if test "$enable_print_graphics" = yes ; then
1098	AC_DEFINE(OPT_PRINT_GRAPHICS,1,[Define to 1 to enable screen dump to sixel support])
1099fi
1100
1101AC_MSG_CHECKING(if you want VT420 rectangle support)
1102CF_ARG_DISABLE(rectangles,
1103	[  --disable-rectangles    disable VT420 rectangle support],
1104	[enable_rectangles=no],
1105	[enable_rectangles=yes])
1106AC_MSG_RESULT($enable_rectangles)
1107if test "$enable_rectangles" = no ; then
1108	AC_DEFINE(OPT_DEC_RECTOPS,0,[Define to 0 to disable VT420 rectangle support])
1109fi
1110
1111AC_MSG_CHECKING(if you want -ziconbeep option)
1112CF_ARG_DISABLE(ziconbeep,
1113	[  --disable-ziconbeep     disable -ziconbeep option],
1114	[enable_ziconbeep=no],
1115	[enable_ziconbeep=yes])
1116AC_MSG_RESULT($enable_ziconbeep)
1117test "$enable_ziconbeep" = no && AC_DEFINE(OPT_ZICONBEEP,0,[Define to 0 to disable -ziconbeep option])
1118
1119###############################################################################
1120CF_HELP_MESSAGE(Testing/development Options:)
1121
1122AC_MSG_CHECKING(if you want debugging traces)
1123CF_ARG_ENABLE(trace,
1124	[  --enable-trace          test: set to enable debugging traces],
1125	[enable_trace=yes],
1126	[enable_trace=no])
1127AC_MSG_RESULT($enable_trace)
1128if test "$enable_trace" = yes ; then
1129	AC_DEFINE(OPT_TRACE,1,[Define to 1 to enable debugging traces])
1130	EXTRASRCS="$EXTRASRCS trace.c"
1131	EXTRAOBJS="$EXTRAOBJS trace.o"
1132fi
1133
1134CF_DISABLE_LEAKS
1135CF_DISABLE_ECHO
1136
1137AC_MSG_CHECKING(if you want magic cookie emulation)
1138CF_ARG_ENABLE(xmc-glitch,
1139	[  --enable-xmc-glitch     test: enable xmc magic-cookie emulation],
1140	[enable_xmc=yes],
1141	[enable_xmc=no])
1142AC_MSG_RESULT($enable_xmc)
1143if test "$enable_xmc" = yes ; then
1144	AC_DEFINE(OPT_XMC_GLITCH,1,[Define to 1 to enable xmc magic-cookie emulation])
1145	EXTRASRCS="$EXTRASRCS testxmc.c"
1146	EXTRAOBJS="$EXTRAOBJS testxmc.o"
1147fi
1148
1149dnl FIXME - extra test needed to make tcap-fkeys work on HPUX
1150AC_CHECK_FUNCS(tigetstr)
1151
1152dnl only check for ncurses' use_extended_names if really not using termcap
1153if test -n "$cf_cv_lib_part_tgetent"; then
1154    AC_CHECK_FUNCS(use_extended_names)
1155fi
1156
1157CF_ENABLE_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum Wno-cast-qual,yes)
1158
1159AC_SUBST(EXTRA_CFLAGS)
1160AC_SUBST(CHARPROC_DEPS)
1161AC_SUBST(EXTRAHDRS)
1162AC_SUBST(EXTRASRCS)
1163AC_SUBST(EXTRAOBJS)
1164
1165test "$disable_setuid" = yes && AC_DEFINE(DISABLE_SETUID,1,[Define to 1 if you want to disable setuid])
1166test "$disable_setgid" = yes && AC_DEFINE(DISABLE_SETGID,1,[Define to 1 if you want to disable setgid])
1167
1168if test $disable_setuid = yes ; then
1169	MAY_SETUID="#"
1170	NOT_SETUID=
1171elif test $disable_setgid = yes ; then
1172	MAY_SETUID="#"
1173	NOT_SETUID=
1174else
1175	MAY_SETUID=
1176	NOT_SETUID="#"
1177fi
1178
1179AC_SUBST(MAY_SETUID)
1180AC_SUBST(NOT_SETUID)
1181
1182###	remove from CPPFLAGS the optional features we define in xtermcfg.h
1183###	or other conflicting symbols that may be defined via imake:
1184for cf_def in \
1185	__STDC__ \
1186	ALLOWLOGGING \
1187	ALLOWLOGFILEEXEC \
1188	OPT_LUIT_PROG \
1189	OPT_WIDE_CHARS \
1190	SCROLLBAR_RIGHT \
1191	USE_TTY_GROUP \
1192	USE_UTEMPTER \
1193	XRENDERFONT
1194do
1195	CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-D$cf_def//`
1196done
1197
1198CF_MAKE_TAGS
1199CF_DISABLE_RPATH_HACK
1200
1201# Force plink.sh to not trim pcre's libraries, which have the same symbol
1202# names as the system regexp.
1203if test "$with_pcre" != no
1204then
1205	LIBS=`echo "$LIBS" | sed -e 's/-lpcre/-kpcre/g'`
1206fi
1207
1208###	output xtermcfg.h, etc
1209AC_CONFIG_FILES([Makefile df-install minstall:minstall.in run-tic.sh:run-tic.in])
1210AC_OUTPUT
1211