configure.in revision d522f475
1dnl $XTermId: configure.in,v 1.244 2008/03/26 00:55:11 tom Exp $
2dnl
3dnl ---------------------------------------------------------------------------
4dnl
5dnl Copyright 1997-2007,2008 by Thomas E. Dickey
6dnl
7dnl                         All Rights Reserved
8dnl
9dnl Permission to use, copy, modify, and distribute this software and its
10dnl documentation for any purpose and without fee is hereby granted,
11dnl provided that the above copyright notice appear in all copies and that
12dnl both that copyright notice and this permission notice appear in
13dnl supporting documentation, and that the name of the above listed
14dnl copyright holder(s) not be used in advertising or publicity pertaining
15dnl to distribution of the software without specific, written prior
16dnl permission.
17dnl
18dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
19dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
21dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25dnl
26dnl ---------------------------------------------------------------------------
27dnl Process this file with autoconf to produce a configure script.
28dnl
29AC_PREREQ(2.13.20030927)
30AC_INIT(charproc.c)
31AC_CONFIG_HEADER(xtermcfg.h:xtermcfg.hin)
32CF_CHECK_CACHE
33
34###	checks for alternative programs
35
36dnl Only add to this case statement when a system has a compiler that is not
37dnl detected by AC_PROG_CC.
38case "$host_os" in
39openedition)	: ${CFLAGS="-O2 -Wc,dll -Wl,EDIT=NO"}
40		: ${CPPFLAGS="-D_ALL_SOURCE"}
41		: ${LIBS="/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x"}
42		: ${CC=c89};;
43darwin*)
44		: ${LDFLAGS}="${LDFLAGS} -Wl,-bind_at_load";;
45esac
46
47AC_PROG_CC
48AC_PROG_CPP
49AC_PROG_GCC_TRADITIONAL
50AC_PROG_AWK
51AC_PROG_INSTALL
52AC_PROG_LN_S
53AC_ARG_PROGRAM
54AC_CHECK_PROGS(LINT, tdlint lint alint)
55
56###	checks for UNIX variants that set C preprocessor variables
57AC_AIX
58AC_ISC_POSIX
59
60###	checks for compiler characteristics
61CF_ANSI_CC_CHECK
62AC_C_CONST
63CF_PROG_EXT
64CF_XOPEN_SOURCE
65CF_SIGWINCH
66
67###	checks for header files
68AC_CHECK_HEADERS( \
69ncurses/term.h \
70stdlib.h \
71sys/ttydefaults.h \
72term.h \
73termios.h \
74unistd.h \
75wchar.h \
76)
77AC_HEADER_TIME
78AM_LANGINFO_CODESET
79
80###	checks for typedefs
81CF_SIG_ATOMIC_T
82CF_SIZE_T
83AC_CHECK_TYPE(time_t, long)
84AC_TYPE_MODE_T
85AC_TYPE_PID_T
86AC_TYPE_UID_T
87AC_TYPE_OFF_T
88
89###	checks for library functions
90AC_CHECK_FUNCS( \
91	bcopy \
92	gethostname \
93	getlogin \
94	memmove \
95	putenv \
96	sched_yield \
97	strerror \
98	strftime \
99	tcgetattr \
100	waitpid \
101	wcswidth \
102	wcwidth )
103CF_FUNC_MEMMOVE
104CF_UTMP
105CF_STRUCT_LASTLOG
106CF_POSIX_SAVED_IDS
107
108CF_HELP_MESSAGE(Compile/Install Options:)
109CF_FUNC_TGETENT
110
111AC_MSG_CHECKING(for directory to install resource files)
112CF_WITH_PATH(app-defaults,
113	[  --with-app-defaults=DIR directory in which to install resource files],
114	[appsdir],[EPREFIX/lib/X11/app-defaults],
115	['\$(exec_prefix)/lib/X11/app-defaults'])
116AC_MSG_RESULT($appsdir)
117AC_SUBST(appsdir)
118
119no_appsdir=
120test "$appsdir" = no && no_appsdir="#"
121AC_SUBST(no_appsdir)
122
123AC_MSG_CHECKING(for directory to install icons)
124CF_WITH_PATH(icondir,
125	[  --with-icondir=DIR      directory in which to install icons],
126	[icondir],[EPREFIX/share/pixmaps],
127	['\$(exec_prefix)/share/pixmaps'])
128AC_MSG_RESULT($icondir)
129AC_SUBST(icondir)
130
131no_icondir=
132test "$icondir" = no && no_icondir="#"
133AC_SUBST(no_icondir)
134
135# Comment-out the install-desktop rule if the desktop-utils are not found.
136AC_MSG_CHECKING(if you want to install desktop files)
137CF_ARG_OPTION(desktop,
138	[  --disable-desktop       disable install of xterm desktop files],
139	[enable_desktop=$enableval],
140	[enable_desktop=$enableval],yes)
141AC_MSG_RESULT($enable_desktop)
142
143desktop_utils=
144if test "$enable_desktop" = yes ; then
145AC_CHECK_PROG(desktop_utils,desktop-file-install,yes,no)
146fi
147
148test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#"
149AC_SUBST(DESKTOP_FLAGS)
150
151# inherit SINSTALL_OPTS from environment to allow packager to customize it.
152
153AC_MSG_CHECKING(for install-permissions reference)
154AC_ARG_WITH(reference,
155	[  --with-reference=XXX    program to use as permissions-reference],
156	[with_reference=$withval],
157	[with_reference=xterm])
158AC_MSG_RESULT($with_reference)
159
160with_full_paths=yes
161CF_PATH_PROG(XTERM_PATH,$with_reference)
162
163# If any of --program-prefix, --program-suffix or --program-transform-name is
164# given, accept an option tell the makefile to create a symbolic link, e.g.,
165# to "xterm" on install.
166XTERM_SYMLINK=NONE
167AC_SUBST(XTERM_SYMLINK)
168if test "$program_transform_name" != "'s,,,'" ; then
169cf_name=`echo "$program_transform_name" | sed -e '[s,\\$\\$,$,g]'`
170cf_name=`echo xterm |sed -e "$cf_name"`
171AC_MSG_CHECKING(for symbolic link to create to $cf_name)
172AC_ARG_WITH(xterm-symlink,
173	[  --with-xterm-symlink=XXX make symbolic link to installed xterm],
174	[with_symlink=$withval],
175	[with_symlink=xterm])
176AC_MSG_RESULT($with_symlink)
177test "$with_symlink" = yes && with_symlink=xterm
178test -n "$with_symlink" && \
179	test "$with_symlink" != no && \
180	test "$with_symlink" != $cf_name && \
181	XTERM_SYMLINK="$with_symlink"
182fi
183
184AC_MSG_CHECKING(if you want to disable setuid)
185CF_ARG_DISABLE(setuid,
186	[  --disable-setuid        disable setuid in xterm, do not install setuid/setgid],
187	[disable_setuid=yes],
188	[disable_setuid=no],
189	no)
190AC_MSG_RESULT($disable_setuid)
191
192AC_MSG_CHECKING(if you want to disable setgid)
193CF_ARG_DISABLE(setgid,
194	[  --disable-setgid        disable setgid in xterm, do not install setuid/setgid],
195	[disable_setgid=yes],
196	[disable_setgid=no],
197	no)
198AC_MSG_RESULT($disable_setgid)
199
200AC_MSG_CHECKING(if you want to run xterm setuid to a given user)
201AC_ARG_WITH(setuid,
202	[  --with-setuid=XXX       use the given setuid user],
203	[use_given_setuid=$withval],
204	[use_given_setuid=no])
205AC_MSG_RESULT($use_given_setuid)
206
207if test "$use_given_setuid" != no ; then
208	if test "$use_given_setuid" = yes ; then
209		cf_cv_given_setuid=root
210	else
211		cf_cv_given_setuid=$use_given_setuid
212	fi
213	SINSTALL_OPTS="$SINSTALL_OPTS u+s -u $cf_cv_given_setuid"
214fi
215
216AC_MSG_CHECKING(if you want to run xterm setgid to match utmp/utmpx file)
217AC_ARG_WITH(utmp-setgid,
218	[  --with-utmp-setgid=XXX  use setgid to match utmp/utmpx file],
219	[use_utmp_setgid=$withval],
220	[use_utmp_setgid=no])
221AC_MSG_RESULT($use_utmp_setgid)
222
223if test "$use_utmp_setgid" != no ; then
224	if test "$use_utmp_setgid" = yes ; then
225		CF_UTMP_GROUP
226	else
227		cf_cv_utmp_group=$use_utmp_setgid
228	fi
229	if test "$cf_cv_posix_saved_ids" != yes ; then
230		AC_MSG_ERROR(Your system does not support POSIX saved-ids)
231	fi
232	AC_DEFINE(USE_UTMP_SETGID)
233	SINSTALL_OPTS="$SINSTALL_OPTS g+s -g $cf_cv_utmp_group"
234fi
235
236AC_SUBST(SINSTALL_OPTS)
237
238AC_MSG_CHECKING(if you want to link with utempter)
239AC_ARG_WITH(utempter,
240	[  --with-utempter         use utempter library for access to utmp],
241	[use_utempter=$withval],
242	[use_utempter=no])
243AC_MSG_RESULT($use_utempter)
244
245if test "$use_utempter" = yes ; then
246	CF_UTEMPTER
247	test "$cf_cv_have_utempter" != yes && use_utempter=no
248else
249	use_utempter=no
250fi
251
252# Some configurations permit (or require) either setuid or setgid mode.
253# Let the user decide.
254if test "$use_utempter" = yes ; then
255	if test "${enable_setuid+set}" != set ; then
256		disable_setuid=yes
257		CF_VERBOSE([No --disable-setuid option given, force to yes])
258	fi
259fi
260
261###	checks for external data
262CF_ERRNO
263CF_TTY_GROUP
264
265###	checks for system services and user specified options
266
267CF_POSIX_WAIT
268CF_SYSV
269CF_SVR4
270CF_X_TOOLKIT
271
272AC_CHECK_HEADERS( \
273	X11/DECkeysym.h \
274	X11/Sunkeysym.h \
275	X11/XF86keysym.h \
276	X11/Xpoll.h \
277	)
278
279CF_X_ATHENA
280CF_TYPE_FD_MASK
281CF_TERMIO_C_ISPEED
282
283LIBS="$LIBS $X_EXTRA_LIBS"
284
285# Check for openpty() in -lutil if the UNIX98-style pty functions are not
286# available. E.g. for GNU libc 2.0.
287case $host_os in #(vi
288freebsd*|netbsd*)	# 2004/8/15 - revisit this if/when grantpt is known to work.
289	AC_CHECK_LIB(util,openpty)
290	;;
291*)
292	AC_CHECK_FUNCS(grantpt, [], AC_CHECK_LIB(util,openpty))
293	;;
294esac
295
296CF_XKB_BELL_EXT
297AC_CHECK_FUNCS(Xutf8LookupString, [],[
298	EXTRAHDRS="$EXTRAHDRS xutf8.h"
299	EXTRASRCS="$EXTRASRCS xutf8.c"
300	EXTRAOBJS="$EXTRAOBJS xutf8.o"
301])
302
303CF_WITH_IMAKE_CFLAGS($(MAIN_DEFINES) $(VENDORMANDEFS))
304
305CF_HELP_MESSAGE(Terminal Configuration:)
306
307AC_MSG_CHECKING(for default terminal-id)
308AC_ARG_WITH(terminal-id,
309	[  --with-terminal-id=V    set default decTerminalID (default: vt100)],
310	[default_termid=$withval],
311	[default_termid=vt100])
312AC_MSG_RESULT($default_termid)
313case $default_termid in
314vt*)	default_termid=`echo $default_termid | sed -e 's/^..//'`
315	;;
316esac
317AC_DEFINE_UNQUOTED(DFT_DECID,"$default_termid")
318
319AC_MSG_CHECKING(for default terminal-type)
320AC_ARG_WITH(terminal-type,
321	[  --with-terminal-type=T  set default $TERM (default: xterm)],
322	[default_TERM=$withval],
323	[default_TERM=xterm])
324AC_MSG_RESULT($default_TERM)
325AC_DEFINE_UNQUOTED(DFT_TERMTYPE,"$default_TERM")
326
327AC_MSG_CHECKING(for private terminfo-directory)
328AC_ARG_WITH(own-terminfo,
329	[  --with-own-terminfo=P   set default $TERMINFO (default: from environment)],
330	[TERMINFO_DIR=$withval],
331	[TERMINFO_DIR=${TERMINFO-none}])
332AC_MSG_RESULT($TERMINFO_DIR)
333if test "$TERMINFO_DIR" = yes ; then
334	AC_MSG_WARN(no value given)
335elif test "$TERMINFO_DIR" != none ; then
336	if test -d $TERMINFO_DIR ; then
337		AC_DEFINE_UNQUOTED(OWN_TERMINFO_DIR,"$TERMINFO_DIR")
338	else
339		AC_MSG_WARN(not a directory)
340	fi
341elif test "$prefix" != NONE ; then
342	TERMINFO_DIR='${prefix}/lib/terminfo'
343elif test -d /usr/lib/terminfo ; then
344	TERMINFO_DIR=/usr/lib/terminfo
345else
346	TERMINFO_DIR=
347fi
348SET_TERMINFO=
349if test -n "$TERMINFO_DIR" ; then
350	TERMINFO_DIR='$(DESTDIR)'$TERMINFO_DIR
351	SET_TERMINFO='TERMINFO=$(TERMINFO_DIR)'
352fi
353AC_SUBST(TERMINFO_DIR)
354AC_SUBST(SET_TERMINFO)
355
356###############################################################################
357CF_HELP_MESSAGE(Optional Features:)
358
359AC_MSG_CHECKING(if you want active-icons)
360CF_ARG_DISABLE(active-icon,
361	[  --disable-active-icon   disable X11R6.3 active-icon feature],
362	[enable_active_icon=no],
363	[enable_active_icon=yes])
364AC_MSG_RESULT($enable_active_icon)
365if test "$enable_active_icon" = no ; then
366	AC_DEFINE(NO_ACTIVE_ICON)
367fi
368
369AC_MSG_CHECKING(if you want ANSI color)
370CF_ARG_DISABLE(ansi-color,
371	[  --disable-ansi-color    disable ANSI color],
372	[enable_ansi_color=no],
373	[enable_ansi_color=yes])
374AC_MSG_RESULT($enable_ansi_color)
375test "$enable_ansi_color" = no && AC_DEFINE(OPT_ISO_COLORS,0)
376
377if test "$enable_ansi_color" = yes ; then
378
379	AC_MSG_CHECKING(if you want 16 colors like aixterm)
380	CF_ARG_DISABLE(16-color,
381		[  --disable-16-color      disable 16-color support],
382		[enable_16_color=no],
383		[enable_16_color=yes])
384	AC_MSG_RESULT($enable_16_color)
385	test "$enable_16_color" = no && AC_DEFINE(OPT_AIX_COLORS,0)
386
387	AC_MSG_CHECKING(if you want 256 colors)
388	CF_ARG_ENABLE(256-color,
389		[  --enable-256-color      enable 256-color support],
390		[enable_256_color=yes],
391		[enable_256_color=no])
392	AC_MSG_RESULT($enable_256_color)
393	if test "$enable_256_color" = yes ; then
394		CHARPROC_DEPS="$CHARPROC_DEPS 256colres.h"
395		EXTRAHDRS="$EXTRAHDRS 256colres.h"
396		AC_DEFINE(OPT_256_COLORS,1)
397	else
398	AC_MSG_CHECKING(if you want 88 colors)
399	CF_ARG_ENABLE(88-color,
400		[  --enable-88-color       enable 88-color support],
401		[enable_88_color=yes],
402		[enable_88_color=no])
403	AC_MSG_RESULT($enable_88_color)
404	if test "$enable_88_color" = yes ; then
405		CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h"
406		EXTRAHDRS="$EXTRAHDRS 88colres.h"
407		AC_DEFINE(OPT_88_COLORS,1)
408	fi
409	fi
410
411fi
412
413AC_MSG_CHECKING(if you want blinking cursor)
414CF_ARG_DISABLE(blink-cursor,
415	[  --disable-blink-cursor  disable support for blinking cursor],
416	[enable_blink_curs=no],
417	[enable_blink_curs=yes])
418AC_MSG_RESULT($enable_blink_curs)
419test "$enable_blink_curs" = no && AC_DEFINE(OPT_BLINK_CURS,0)
420
421AC_MSG_CHECKING(if you want to ignore Linux's broken palette-strings)
422
423case $host_os in #(vi
424linux*)
425	assume_broken_osc=yes ;; #(vi
426*)
427	assume_broken_osc=no ;;
428esac
429
430CF_ARG_OPTION(broken-osc,
431	[  --enable-broken-osc     allow broken Linux OSC-strings],
432	[enable_broken_osc=$enableval],
433	[enable_broken_osc=$enableval],
434	[$assume_broken_osc])
435AC_MSG_RESULT($enable_broken_osc)
436if test "$enable_broken_osc" = yes ; then
437	AC_DEFINE(OPT_BROKEN_OSC,1)
438else
439	AC_DEFINE(OPT_BROKEN_OSC,0)
440fi
441
442AC_MSG_CHECKING(if you want to allow broken string-terminators)
443CF_ARG_ENABLE(broken-st,
444	[  --enable-broken-st      allow broken string-terminators],
445	[enable_broken_st=yes],
446	[enable_broken_st=no])
447AC_MSG_RESULT($enable_broken_st)
448test "$enable_broken_st" = no && AC_DEFINE(OPT_BROKEN_ST,0)
449
450AC_MSG_CHECKING(if you want printable 128-159)
451CF_ARG_DISABLE(c1-print,
452	[  --disable-c1-print      disallow -k8 option for printable 128-159],
453	[enable_c1_print=no],
454	[enable_c1_print=yes])
455AC_MSG_RESULT($enable_c1_print)
456test "$enable_c1_print" = no && AC_DEFINE(OPT_C1_PRINT,0)
457
458if test "$enable_ansi_color" = yes ; then
459
460	AC_MSG_CHECKING(if you want bold colors mapped like IBM PC)
461	CF_ARG_DISABLE(bold-color,
462		[  --disable-bold-color    disable PC-style mapping of bold colors],
463		[enable_pc_color=no],
464		[enable_pc_color=yes])
465	AC_MSG_RESULT($enable_pc_color)
466	test "$enable_pc_color" = no && AC_DEFINE(OPT_PC_COLORS,0)
467
468	AC_MSG_CHECKING(if you want separate color-classes)
469	CF_ARG_DISABLE(color-class,
470		[  --disable-color-class   disable separate color class resources],
471		[enable_color_class=no],
472		[enable_color_class=yes])
473	AC_MSG_RESULT($enable_color_class)
474	test "$enable_color_class" = no && AC_DEFINE(OPT_COLOR_CLASS,FALSE)
475
476	AC_MSG_CHECKING(if you want color-mode enabled by default)
477	CF_ARG_DISABLE(color-mode,
478		[  --disable-color-mode    disable default colorMode resource],
479		[default_colormode=no],
480		[default_colormode=yes])
481	AC_MSG_RESULT($default_colormode)
482	test "$default_colormode" = no && AC_DEFINE(DFT_COLORMODE,FALSE)
483
484fi
485
486AC_MSG_CHECKING(if you want support for color highlighting)
487CF_ARG_DISABLE(highlighting,
488	[  --disable-highlighting  disable support for color highlighting],
489	[default_highlight=no],
490	[default_highlight=yes])
491AC_MSG_RESULT($default_highlight)
492test "$default_highlight" = no && AC_DEFINE(OPT_HIGHLIGHT_COLOR,0)
493
494AC_MSG_CHECKING(if you want support for doublesize characters)
495CF_ARG_DISABLE(doublechars,
496	[  --disable-doublechars   disable support for double-size chars],
497	[enable_doublechars=no],
498	[enable_doublechars=yes])
499AC_MSG_RESULT($enable_doublechars)
500test "$enable_doublechars" = no && AC_DEFINE(OPT_DEC_CHRSET,0)
501
502AC_MSG_CHECKING(if you want fallback-support for box characters)
503CF_ARG_DISABLE(boxchars,
504	[  --disable-boxchars      disable fallback-support for box chars],
505	[enable_boxchars=no],
506	[enable_boxchars=yes])
507AC_MSG_RESULT($enable_boxchars)
508test "$enable_boxchars" = no && AC_DEFINE(OPT_BOX_CHARS,0)
509
510AC_MSG_CHECKING(if you want to allow spawning new xterms)
511CF_ARG_ENABLE(exec-xterm,
512	[  --enable-exec-xterm     enable "spawn-new-terminal" action],
513	[enable_exec_xterm=yes],
514	[enable_exec_xterm=no])
515AC_MSG_RESULT($enable_exec_xterm)
516if test "$enable_exec_xterm" = yes ; then
517	CF_PROCFS_CWD
518	if test "$cf_cv_procfs_cwd" = no ; then
519		AC_MSG_WARN(no suitable proc filesystem found)
520	else
521		AC_DEFINE_UNQUOTED(PROCFS_ROOT,"$cf_cv_procfs_cwd")
522		AC_DEFINE(OPT_EXEC_XTERM)
523	fi
524fi
525
526AC_MSG_CHECKING(if you want to use FreeType library)
527CF_ARG_DISABLE(freetype,
528	[  --disable-freetype      disable freetype library-support],
529	[enable_freetype=no],
530	[enable_freetype=yes])
531AC_MSG_RESULT($enable_freetype)
532if test "$enable_freetype" = yes ; then
533	CF_X_FREETYPE
534else
535	CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//`
536fi
537
538AC_MSG_CHECKING(if you want support for HP-style function keys)
539CF_ARG_ENABLE(hp-fkeys,
540	[  --enable-hp-fkeys       enable support for HP-style function keys],
541	[enable_hp_fkeys=yes],
542	[enable_hp_fkeys=no])
543AC_MSG_RESULT($enable_hp_fkeys)
544if test "$enable_hp_fkeys" = yes ; then
545	AC_DEFINE(OPT_HP_FUNC_KEYS,1)
546fi
547
548AC_MSG_CHECKING(if you want support for SCO-style function keys)
549CF_ARG_ENABLE(sco-fkeys,
550	[  --enable-sco-fkeys      enable support for SCO-style function keys],
551	[enable_sco_fkeys=yes],
552	[enable_sco_fkeys=no])
553AC_MSG_RESULT($enable_sco_fkeys)
554if test "$enable_sco_fkeys" = yes ; then
555	AC_DEFINE(OPT_SCO_FUNC_KEYS,1)
556fi
557
558AC_MSG_CHECKING(if you want support for Sun-style function keys)
559CF_ARG_DISABLE(sun-fkeys,
560	[  --disable-sun-fkeys     disable support for Sun-style function keys],
561	[enable_sun_fkeys=no],
562	[enable_sun_fkeys=yes])
563AC_MSG_RESULT($enable_sun_fkeys)
564if test "$enable_sun_fkeys" = no ; then
565	AC_DEFINE(OPT_SUN_FUNC_KEYS,0)
566fi
567
568AC_MSG_CHECKING(if you want support for internationalization)
569CF_ARG_DISABLE(i18n,
570	[  --disable-i18n          disable internationalization],
571	[enable_i18n=no],
572	[enable_i18n=yes])
573AC_MSG_RESULT($enable_i18n)
574if test "$enable_i18n" = no ; then
575	AC_DEFINE(OPT_I18N_SUPPORT,0)
576fi
577
578AC_MSG_CHECKING(if you want support for initial-erase setup)
579CF_ARG_DISABLE(initial-erase,
580	[  --disable-initial-erase disable setup for stty erase],
581	[enable_ie=no],
582	[enable_ie=yes])
583AC_MSG_RESULT($enable_ie)
584if test "$enable_ie" = no ; then
585	AC_DEFINE(OPT_INITIAL_ERASE,0)
586fi
587
588AC_MSG_CHECKING(if you want support for input-method)
589CF_ARG_DISABLE(input-method,
590	[  --disable-input-method  disable input-method],
591	[enable_ximp=no],
592	[enable_ximp=yes])
593AC_MSG_RESULT($enable_ximp)
594CF_INPUT_METHOD
595test "$cf_cv_input_method" = no && enable_ximp=no
596if test "$enable_ximp" = no ; then
597	AC_DEFINE(OPT_INPUT_METHOD,0)
598fi
599
600AC_MSG_CHECKING(if you want support for load-vt-fonts)
601CF_ARG_ENABLE(load-vt-fonts,
602	[  --enable-load-vt-fonts  enable load-vt-fonts() action],
603	[enable_load_vt_fonts=yes],
604	[enable_load_vt_fonts=no])
605AC_MSG_RESULT($enable_load_vt_fonts)
606if test "$enable_load_vt_fonts" = yes ; then
607	AC_DEFINE(OPT_LOAD_VTFONTS,1)
608fi
609
610AC_MSG_CHECKING(if you want support for logging)
611CF_ARG_ENABLE(logging,
612	[  --enable-logging        enable logging],
613	[enable_logging=yes],
614	[enable_logging=no])
615AC_MSG_RESULT($enable_logging)
616if test "$enable_logging" = yes ; then
617	AC_DEFINE(ALLOWLOGGING)
618	AC_MSG_CHECKING(if you want to allow logging via a pipe)
619	CF_ARG_ENABLE(logfile-exec,
620		[  --enable-logfile-exec   enable exec'd logfile filter],
621		[enable_log_exec=yes],
622		[enable_log_exec=no])
623	AC_MSG_RESULT($enable_log_exec)
624	if test "$enable_log_exec" = yes ; then
625		AC_DEFINE(ALLOWLOGFILEEXEC)
626	fi
627fi
628
629AC_MSG_CHECKING(if you want support for iconify/maximize translations)
630CF_ARG_DISABLE(maximize,
631	[  --disable-maximize      disable actions for iconify/deiconify/maximize/restore],
632	[enable_maximize=no],
633	[enable_maximize=yes])
634AC_MSG_RESULT($enable_maximize)
635test "$enable_maximize" = no && AC_DEFINE(OPT_MAXIMIZE,0)
636
637AC_MSG_CHECKING(if you want NumLock to override keyboard tables)
638CF_ARG_DISABLE(num-lock,
639	[  --disable-num-lock      disable NumLock keypad support],
640	[enable_numlock=no],
641	[enable_numlock=yes])
642AC_MSG_RESULT($enable_numlock)
643test "$enable_numlock" = no && AC_DEFINE(OPT_NUM_LOCK,0)
644
645AC_MSG_CHECKING(if you want support for get/set of base64 selection data)
646
647CF_ARG_ENABLE(paste64,
648	[  --enable-paste64        enable get/set base64 selection data],
649	[enable_paste64=yes],
650	[enable_paste64=no])
651AC_MSG_RESULT($enable_paste64)
652if test "$enable_paste64" = yes ; then
653	AC_DEFINE(OPT_PASTE64,1)
654else
655	AC_DEFINE(OPT_PASTE64,0)
656fi
657
658AC_MSG_CHECKING(if you want support for pty-handshaking)
659
660CF_ARG_DISABLE(pty-handshake,
661	[  --disable-pty-handshake disable pty-handshake support],
662	[enable_pty_handshake=no],
663	[enable_pty_handshake=yes])
664AC_MSG_RESULT($enable_pty_handshake)
665if test "$enable_pty_handshake" = yes ; then
666	AC_DEFINE(OPT_PTY_HANDSHAKE,1)
667else
668	AC_DEFINE(OPT_PTY_HANDSHAKE,0)
669fi
670
671AC_MSG_CHECKING(if you want support for mouse in readline applications)
672CF_ARG_ENABLE(readline-mouse,
673	[  --enable-readline-mouse enable support for mouse in readline applications],
674	[enable_readline_mouse=yes],
675	[enable_readline_mouse=no])
676AC_MSG_RESULT($enable_readline_mouse)
677if test "$enable_readline_mouse" = yes ; then
678	AC_DEFINE(OPT_READLINE,1)
679fi
680
681AC_MSG_CHECKING(if you want support for regular-expression selections)
682CF_ARG_DISABLE(regex,
683	[  --disable-regex         disable regular-expression selections],
684	[enable_regex=no],
685	[enable_regex=yes])
686AC_MSG_RESULT($enable_regex)
687if test "$enable_regex" = yes ; then
688	CF_WITH_PCRE
689	if test "$with_pcre" = no ; then
690		CF_REGEX
691		if test "X$cf_cv_regex" != "Xregex.h" ; then
692			AC_MSG_ERROR(Only POSIX or PCRE regular expressions are supported)
693		fi
694	fi
695	AC_DEFINE(OPT_SELECT_REGEX)
696fi
697
698AC_MSG_CHECKING(if you want support for right-scrollbar)
699CF_ARG_DISABLE(rightbar,
700	[  --disable-rightbar      disable right-scrollbar support],
701	[enable_rightbar=no],
702	[enable_rightbar=yes])
703AC_MSG_RESULT($enable_rightbar)
704if test "$enable_rightbar" = yes ; then
705	AC_DEFINE(SCROLLBAR_RIGHT)
706fi
707
708AC_MSG_CHECKING(if you want check for redundant name-change)
709CF_ARG_DISABLE(samename,
710	[  --disable-samename      disable check for redundant name-change],
711	[enable_samename=no],
712	[enable_samename=yes])
713AC_MSG_RESULT($enable_samename)
714test "$enable_samename" = no && AC_DEFINE(OPT_SAME_NAME,0)
715
716AC_MSG_CHECKING(if you want support for session management)
717CF_ARG_DISABLE(session-mgt,
718	[  --disable-session-mgt   disable support for session management],
719	[enable_session_mgt=no],
720	[enable_session_mgt=yes])
721AC_MSG_RESULT($enable_session_mgt)
722test "$enable_session_mgt" = no && AC_DEFINE(OPT_SESSION_MGT,0)
723
724AC_MSG_CHECKING(if you want to use termcap function-keys)
725CF_ARG_DISABLE(tcap-fkeys,
726	[  --disable-tcap-fkeys    disable termcap function-keys support],
727	[enable_tcap_fkeys=no],
728	[enable_tcap_fkeys=yes])
729AC_MSG_RESULT($enable_tcap_fkeys)
730test "$enable_tcap_fkeys" = yes && AC_DEFINE(OPT_TCAP_FKEYS,1)
731
732AC_MSG_CHECKING(if you want to use termcap-query/report)
733CF_ARG_ENABLE(tcap-query,
734	[  --enable-tcap-query     compile-in termcap-query support],
735	[enable_tcap_query=yes],
736	[enable_tcap_query=no])
737AC_MSG_RESULT($enable_tcap_query)
738test "$enable_tcap_query" = yes && AC_DEFINE(OPT_TCAP_QUERY,1)
739
740AC_MSG_CHECKING(if you want support for tek4014)
741CF_ARG_DISABLE(tek4014,
742	[  --disable-tek4014       disable tek4014 emulation],
743	[enable_tek4014=no],
744	[enable_tek4014=yes])
745AC_MSG_RESULT($enable_tek4014)
746if test "$enable_tek4014" = no ; then
747	AC_DEFINE(OPT_TEK4014,0)
748else
749	EXTRAHDRS="$EXTRAHDRS Tekparse.h"
750	EXTRASRCS="$EXTRASRCS TekPrsTbl.c Tekproc.c"
751	EXTRAOBJS="$EXTRAOBJS TekPrsTbl.o Tekproc.o"
752fi
753
754AC_MSG_CHECKING(if you want pulldown menus with a toolbar)
755CF_ARG_ENABLE(toolbar,
756	[  --enable-toolbar        compile-in toolbar for pulldown menus],
757	[enable_toolbar=yes],
758	[enable_toolbar=no])
759AC_MSG_RESULT($enable_toolbar)
760if test "$enable_toolbar" = yes ; then
761	AC_DEFINE(OPT_TOOLBAR,1)
762fi
763
764AC_MSG_CHECKING(if you want VT52 emulation)
765CF_ARG_DISABLE(vt52,
766	[  --disable-vt52          disable VT52 emulation],
767	[enable_vt52=no],
768	[enable_vt52=yes])
769AC_MSG_RESULT($enable_vt52)
770test "$enable_vt52" = no && AC_DEFINE(OPT_VT52_MODE,0)
771
772AC_MSG_CHECKING(if you want to use mini-luit/Latin9 built-in support)
773CF_ARG_ENABLE(mini-luit,
774	[  --enable-mini-luit      enable mini-luit (built-in Latin9 support)],
775	[enable_mini_luit=yes],
776	[enable_mini_luit=no])
777AC_MSG_RESULT($enable_mini_luit)
778if test "$enable_mini_luit" = yes ; then
779	AC_DEFINE(OPT_MINI_LUIT,1)
780fi
781
782AC_MSG_CHECKING(if you want to use luit)
783CF_ARG_ENABLE(luit,
784	[  --enable-luit           enable luit filter (Unicode translation)],
785	[enable_luit=yes],
786	[enable_luit=$enable_mini_luit])
787AC_MSG_RESULT($enable_luit)
788if test "$enable_luit" = yes ; then
789	AC_DEFINE(OPT_LUIT_PROG,1)
790	CF_PATH_PROG(LUIT,luit)
791fi
792
793AC_MSG_CHECKING(if you want wide-character support)
794CF_ARG_OPTION(wide-chars,
795	[  --enable-wide-chars     enable wide-character support],
796	[enable_wchar=yes],
797	[enable_wchar=$enable_luit],
798	[$enable_luit])
799AC_MSG_RESULT($enable_wchar)
800if test "$enable_wchar" = yes ; then
801	AC_DEFINE(OPT_WIDE_CHARS,1)
802	EXTRAHDRS="$EXTRAHDRS charclass.h precompose.h wcwidth.h"
803	EXTRASRCS="$EXTRASRCS charclass.c precompose.c wcwidth.c"
804	EXTRAOBJS="$EXTRAOBJS charclass.o precompose.o wcwidth.o"
805fi
806
807AC_MSG_CHECKING(if you want dynamic-abbreviation support)
808CF_ARG_ENABLE(dabbrev,
809	[  --enable-dabbrev        enable dynamic-abbreviation support],
810	[enable_dabbrev=yes],
811	[enable_dabbrev=no])
812AC_MSG_RESULT($enable_dabbrev)
813if test "$enable_dabbrev" = yes ; then
814	AC_DEFINE(OPT_DABBREV,1)
815fi
816
817AC_MSG_CHECKING(if you want DECterm Locator support)
818CF_ARG_ENABLE(dec-locator,
819	[  --enable-dec-locator    enable DECterm Locator support],
820	[enable_dec_locator=yes],
821	[enable_dec_locator=no])
822AC_MSG_RESULT($enable_dec_locator)
823if test "$enable_dec_locator" = yes ; then
824	AC_DEFINE(OPT_DEC_LOCATOR,1)
825fi
826
827AC_MSG_CHECKING(if you want VT420 rectangle support)
828CF_ARG_DISABLE(rectangles,
829	[  --disable-rectangles    disable VT420 rectangle support],
830	[enable_rectangles=no],
831	[enable_rectangles=yes])
832AC_MSG_RESULT($enable_rectangles)
833if test "$enable_rectangles" = yes ; then
834	AC_DEFINE(OPT_DEC_RECTOPS,1)
835fi
836
837AC_MSG_CHECKING(if you want -ziconbeep option)
838CF_ARG_DISABLE(ziconbeep,
839	[  --disable-ziconbeep     disable -ziconbeep option],
840	[enable_ziconbeep=no],
841	[enable_ziconbeep=yes])
842AC_MSG_RESULT($enable_ziconbeep)
843test "$enable_ziconbeep" = no && AC_DEFINE(OPT_ZICONBEEP,0)
844
845###############################################################################
846CF_HELP_MESSAGE(Testing/development Options:)
847
848AC_MSG_CHECKING(if you want debugging traces)
849CF_ARG_ENABLE(trace,
850	[  --enable-trace          test: set to enable debugging traces],
851	[enable_trace=yes],
852	[enable_trace=no])
853AC_MSG_RESULT($enable_trace)
854if test "$enable_trace" = yes ; then
855	AC_DEFINE(OPT_TRACE)
856	EXTRASRCS="$EXTRASRCS trace.c"
857	EXTRAOBJS="$EXTRAOBJS trace.o"
858fi
859
860AC_MSG_CHECKING(if you want to test memory leaks)
861CF_ARG_DISABLE(leaks,
862	[  --disable-leaks         test: set to test memory leaks],
863	[disable_leaks=yes],
864	[disable_leaks=no])
865AC_MSG_RESULT($disable_leaks)
866if test "$disable_leaks" = yes ; then
867	AC_DEFINE(NO_LEAKS)
868fi
869
870CF_DISABLE_ECHO
871
872AC_MSG_CHECKING(if you want magic cookie emulation)
873CF_ARG_ENABLE(xmc-glitch,
874	[  --enable-xmc-glitch     test: enable xmc magic-cookie emulation],
875	[enable_xmc=yes],
876	[enable_xmc=no])
877AC_MSG_RESULT($enable_xmc)
878if test "$enable_xmc" = yes ; then
879	AC_DEFINE(OPT_XMC_GLITCH,1)
880	EXTRASRCS="$EXTRASRCS testxmc.c"
881	EXTRAOBJS="$EXTRAOBJS testxmc.o"
882fi
883
884dnl FIXME - extra test needed to make tcap-fkeys work on HPUX
885AC_CHECK_FUNCS(tigetstr)
886
887if test -n "$GCC" ; then
888AC_MSG_CHECKING(if you want to turn on gcc warnings)
889CF_ARG_ENABLE(warnings,
890	[  --enable-warnings       test: turn on GCC compiler warnings],
891	[with_warnings=yes],
892	[with_warnings=no])
893AC_MSG_RESULT($with_warnings)
894if test "$with_warnings" = yes
895then
896	CF_GCC_ATTRIBUTES
897	CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
898fi
899fi
900
901AC_SUBST(EXTRA_CFLAGS)
902AC_SUBST(CHARPROC_DEPS)
903AC_SUBST(EXTRAHDRS)
904AC_SUBST(EXTRASRCS)
905AC_SUBST(EXTRAOBJS)
906
907test "$disable_setuid" = yes && AC_DEFINE(DISABLE_SETUID)
908test "$disable_setgid" = yes && AC_DEFINE(DISABLE_SETGID)
909
910if test $disable_setuid = yes ; then
911	MAY_SETUID="#"
912	NOT_SETUID=
913elif test $disable_setgid = yes ; then
914	MAY_SETUID="#"
915	NOT_SETUID=
916else
917	MAY_SETUID=
918	NOT_SETUID="#"
919fi
920
921AC_SUBST(MAY_SETUID)
922AC_SUBST(NOT_SETUID)
923
924###	remove from CPPFLAGS the optional features we define in xtermcfg.h
925###	or other conflicting symbols that may be defined via imake:
926for cf_def in \
927	__STDC__ \
928	ALLOWLOGGING \
929	ALLOWLOGFILEEXEC \
930	OPT_LUIT_PROG \
931	OPT_WIDE_CHARS \
932	SCROLLBAR_RIGHT \
933	USE_TTY_GROUP \
934	USE_UTEMPTER \
935	XRENDERFONT
936do
937	CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-D$cf_def//`
938done
939
940###	output Makefile and xtermcfg.h
941AC_OUTPUT(Makefile)
942