ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/autoconf/configure.in
Revision: 1.12
Committed: Sun Feb 22 08:09:36 2004 UTC (20 years, 4 months ago) by pcg
Branch: MAIN
Changes since 1.11: +0 -6 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 dnl# -*- sh -*-
2 dnl#
3 dnl# Process this file with autoconf to produce a configure script.
4 dnl#
5 AC_INIT(src/feature.h)
6 AC_CONFIG_AUX_DIR(autoconf)
7 AC_CONFIG_HEADER(config.h:autoconf/config.h.in)
8
9 dnl RXVT version
10 changequote(, )dnl
11 VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
12 DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
13 LSMDATE=`sed -n -e 's/^.*[ \t]LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
14 LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
15 changequote([, ])dnl
16 AC_SUBST(VERSION)dnl
17 AC_SUBST(DATE)dnl
18 AC_SUBST(LSMDATE)dnl
19 AC_SUBST(LIBVERSION)dnl
20 echo ""
21 echo "configuring for rxvt $VERSION"
22 echo ""
23
24 dnl# Checks for programs.
25 dnl AC_MAKE_SET
26
27 AC_PROG_CC
28 AC_PROG_CXX
29 AC_PROG_CPP
30 AC_PROG_INSTALL
31 AC_PROG_AWK
32
33 dnl# system hacks
34 AC_AIX
35 AC_ISC_POSIX
36
37 AC_ENABLE_SHARED(no)dnl# libtool
38 AC_ENABLE_STATIC(yes)dnl# libtool
39 AC_PROG_LIBTOOL()dnl# libtool
40
41 MALLOC_TYPE=S
42 support_addstrings=no
43 support_frills=no
44 support_linespace=no
45 support_inheritpixmap=no
46 support_keepscrolling=no
47 support_selectionscrolling=no
48 support_menubar=no
49 support_mousewheel=no
50 support_mouseslipwheel=no
51 support_oldselection=no
52 support_utmp=no
53 support_wtmp=no
54 support_lastlog=no
55 support_cursor_blink=no
56 support_text_blink=no
57 support_pointer_blank=no
58 support_scroll_rxvt=no
59 support_scroll_next=no
60 support_scroll_xterm=no
61 support_scroll_plain=no
62 support_xim=no
63 support_xpm=no
64 support_xft=no
65 support_unicode3=no
66 codesets=
67
68 dnl# --------------------------------------------------------------------------
69 dnl# CHECKING COMMAND LINE OPTIONS
70 dnl# --------------------------------------------------------------------------
71
72 if test "x$enable_shared" = xyes; then
73 AC_DEFINE(LIBRXVT, 1, Build shared library version - specify via configure only)
74 INSTALL_LIBRXVT=yes
75 fi
76 AC_SUBST(INSTALL_LIBRXVT)
77
78 AC_ARG_ENABLE(everything,
79 [ --enable-everything enable standard non-multichoice features: marked *
80 NOTE: this option is order dependent
81 NOTE: automatically enabled with --enable-shared],
82 [if test x$enableval = xyes; then
83 support_24bit=yes
84 support_frills=yes
85 support_linespace=yes
86 support_inheritpixmap=yes
87 support_keepscrolling=yes
88 support_selectionscrolling=yes
89 support_lastlog=yes
90 support_menubar=yes
91 support_mousewheel=yes
92 support_mouseslipwheel=yes
93 support_oldselection=yes
94 support_cursor_blink=yes
95 support_text_blink=yes
96 support_pointer_blank=yes
97 support_scroll_rxvt=yes
98 support_scroll_next=yes
99 support_scroll_xterm=yes
100 support_scroll_plain=yes
101 support_utmp=yes
102 support_wtmp=yes
103 support_xim=yes
104 support_xpm=yes
105 support_xft=yes
106 support_unicode3=yes
107 codesets=all
108 fi])
109
110 echo
111 if test x$support_menubar = xyes; then
112 support_menubar=no
113 echo "******* menubar support disabled, does not work"
114 fi
115 echo
116
117 AC_ARG_ENABLE(unicode3,
118 [ --enable-unicode3 use 21 instead of 16 bits to represent unicode characters],
119 [if test x$enableval = xyes; then
120 support_unicode3=yes
121 fi])
122
123 AC_ARG_ENABLE(xft,
124 [ --enable-xft enable xft support on systems that have it],
125 [if test x$enableval = xyes; then
126 support_xft=yes
127 fi])
128
129 AC_ARG_WITH(codesets,
130 [ --with-codesets=NAME,... compile in additional codesets (jp,jp_ext,kr,cn,cn_ext,vn,all)],
131 [if test x$enableval = xyes; then
132 codesets="$withval"
133 fi])
134
135 AC_ARG_WITH(encoding,
136 [ --with-encoding=NAME set language default encoding to NAME (default: sjis)
137 (eucj|sjis|big5|gb|kr|noenc)],
138 [if test x$enableval = xyes; then
139 withval=`echo $withval | tr '[a-z]' '[A-Z]'`
140 AC_DEFINE_UNQUOTED(MULTICHAR_ENCODING, $withval, Define default multichar glyph encoding)
141 fi])
142
143 AC_ARG_ENABLE(utmp,
144 [ --enable-utmp enable utmp (utmpx) support],
145 [if test x$enableval = xyes -o x$enableval = xno; then
146 support_utmp=$enableval
147 fi])
148
149 AC_ARG_ENABLE(wtmp,
150 [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)],
151 [if test x$enableval = xyes -o x$enableval = xno; then
152 support_wtmp=$enableval
153 fi])
154
155 AC_ARG_ENABLE(lastlog,
156 [ --enable-lastlog enable lastlog support (requires --enable-utmp)],
157 [if test x$enableval = xyes -o x$enableval = xno; then
158 support_lastlog=$enableval
159 fi])
160
161 AC_ARG_ENABLE(xpm-background,
162 [ --enable-xpm-background enable XPM background pixmaps],
163 [if test x$enableval = xyes -o x$enableval = xno; then
164 support_xpm=$enableval
165 fi])
166
167 AC_ARG_ENABLE(transparency,
168 [ --enable-transparency enable transparent backgrounds],
169 [if test x$enableval = xyes -o x$enableval = xno; then
170 support_inheritpixmap=$enableval
171 fi])
172
173 AC_ARG_ENABLE(menubar,
174 [ --enable-menubar enable menubar],
175 [if test x$enableval = xyes -o x$enableval = xno; then
176 support_menubar=$enableval
177 fi])
178
179 AC_ARG_ENABLE(rxvt-scroll,
180 [ --enable-rxvt-scroll enable rxvt style scrollbar],
181 [if test x$enableval = xyes -o x$enableval = xno; then
182 support_scroll_rxvt=$enableval
183 fi])
184
185 AC_ARG_ENABLE(next-scroll,
186 [ --enable-next-scroll enable NeXT style scrollbar],
187 [if test x$enableval = xyes -o x$enableval = xno; then
188 support_scroll_next=$enableval
189 fi])
190
191 AC_ARG_ENABLE(xterm-scroll,
192 [ --enable-xterm-scroll enable Xterm style scrollbar],
193 [if test x$enableval = xyes -o x$enableval = xno; then
194 support_scroll_xterm=$enableval
195 fi])
196
197 AC_ARG_ENABLE(plain-scroll,
198 [ --enable-plain-scroll enable plain style scrollbar],
199 [if test x$enableval = xyes -o x$enableval = xno; then
200 support_scroll_plain=$enableval
201 fi])
202
203 AC_ARG_ENABLE(half-shadow,
204 [ --enable-half-shadow use half width/height shadow on rxvt scrollbar],
205 [if test x$enableval = xyes; then
206 AC_DEFINE(HALFSHADOW, 1, Define if you want the depth of scrollbars and menus to be less)
207 fi])
208
209 AC_ARG_ENABLE(xim,
210 [ --enable-xim XIM (X Input Method) protocol support],
211 [if test x$enableval = xyes -o x$enableval = xno; then
212 support_xim=$enableval
213 fi])
214
215 AC_ARG_ENABLE(ttygid,
216 [ --enable-ttygid enable tty setting to group named "tty"],
217 [if test x$enableval = xyes; then
218 AC_DEFINE(TTY_GID_SUPPORT, 1, Define to change gid of ttys to group tty)
219 fi])
220
221 AC_ARG_ENABLE(backspace-key,
222 [ --disable-backspace-key disable handling of the backspace key],
223 [if test x$enableval = xno; then
224 AC_DEFINE(NO_BACKSPACE_KEY, 1, Define if you don't want support for the backspace key)
225 fi])
226
227 AC_ARG_ENABLE(delete-key,
228 [ --disable-delete-key disable handling of the delete key],
229 [if test x$enableval = xno; then
230 AC_DEFINE(NO_DELETE_KEY, 1, Define if you don't want support for the (non-keypad) delete key)
231 fi])
232
233 AC_ARG_ENABLE(resources,
234 [ --disable-resources disable all resource checking],
235 [if test x$enableval = xno; then
236 AC_DEFINE(NO_RESOURCES, 1, Define if you don't want any resources read)
237 fi])
238
239 AC_ARG_ENABLE(xgetdefault,
240 [ --enable-xgetdefault enable resources via X instead of our small version],
241 [if test x$enableval = xyes; then
242 AC_DEFINE(USE_XGETDEFAULT, 1, Define if you want to use XGetDefault instead of our internal version)
243 fi])
244
245 AC_ARG_ENABLE(strings,
246 [ --enable-strings enable some replacement system functions],
247 [if test x$enableval = xyes -o x$enableval = xno; then
248 support_addstrings=$enableval
249 fi])
250
251 AC_ARG_ENABLE(swapscreen,
252 [ --disable-swapscreen disable swap screen support],
253 [if test x$enableval = xno; then
254 AC_DEFINE(NO_SECONDARY_SCREEN, 1, Disable the secondary screen. Many programs use the secondary screen as their workplace)
255 fi])
256
257 AC_ARG_ENABLE(frills,
258 [ --enable-frills enable support for rarely used features],
259 [if test x$enableval = xyes -o x$enableval = xno; then
260 support_frills=$enableval
261 fi])
262
263 AC_ARG_ENABLE(linespace,
264 [ --enable-linespace enable support for linespace],
265 [if test x$enableval = xyes -o x$enableval = xno; then
266 support_linespace=$enableval
267 fi])
268
269 AC_ARG_ENABLE(24bit,
270 [ --enable-24bit enable support for using 24bit visuals if available],
271 [if test x$enableval = xyes -o x$enableval = xno; then
272 support_24bit=$enableval
273 fi])
274
275 AC_ARG_ENABLE(keepscrolling,
276 [ --enable-keepscrolling enable continual scrolling on scrollbar arrow press],
277 [if test x$enableval = xyes -o x$enableval = xno; then
278 support_keepscrolling=$enableval
279 fi])
280
281 AC_ARG_ENABLE(selectionscrolling,
282 [ --enable-selectionscrolling enable scrolling during selections],
283 [if test x$enableval = xyes -o x$enableval = xno; then
284 support_selectionscrolling=$enableval
285 fi])
286
287 AC_ARG_ENABLE(mousewheel,
288 [ --enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5],
289 [if test x$enableval = xyes -o x$enableval = xno; then
290 support_mousewheel=$enableval
291 fi])
292
293 AC_ARG_ENABLE(slipwheeling,
294 [ --enable-slipwheeling enable slip wheel scrolling (requires previous)],
295 [if test x$enableval = xyes -o x$enableval = xno; then
296 support_mouseslipwheel=$enableval
297 fi])
298
299 AC_ARG_ENABLE(old-selection,
300 [ --enable-old-selection enable v2.20 (& prior) mouse selection style support],
301 [if test x$enableval = xyes -o x$enableval = xno; then
302 support_oldselection=$enableval
303 fi])
304
305 AC_ARG_ENABLE(new-selection,
306 [ --disable-new-selection disable new mouse (xterm) selection style support],
307 [if test x$enableval = xno; then
308 AC_DEFINE(NO_NEW_SELECTION, 1, Define to remove xterm style mouse selection)
309 fi])
310
311 AC_ARG_ENABLE(dmalloc,
312 [ --enable-dmalloc enable Gray Watson's malloc - for debugging use],
313 [if test x$enableval = xyes; then
314 MALLOC_TYPE=G
315 DEBUG=-DDEBUG_MALLOC
316 DLIB="-L/usr/local/lib -ldmalloc"
317 DINCLUDE=-I/usr/local/include
318 fi])
319
320 AC_ARG_ENABLE(dlmalloc,
321 [ --enable-dlmalloc enable Doug Lea's malloc - for production use
322 NOTE: enable only one malloc package],
323 [if test x$enableval = xyes; then
324 MALLOC_TYPE=D
325 DEBUG=
326 DLIB="-L/usr/local/lib -ldlmalloc"
327 DINCLUDE=
328 fi])
329
330 AC_ARG_ENABLE(smart-resize,
331 [ --enable-smart-resize enable smart growth/shrink behaviour],
332 [if test x$enableval = xyes; then
333 AC_DEFINE(SMART_RESIZE, 1, Define to use "smart" resize behavior)
334 fi])
335
336 AC_ARG_ENABLE(256-color,
337 [ --enable-256-color enable 256-color support],
338 [if test x$enableval = xyes; then
339 AC_DEFINE(TTY_256COLOR, 1, Define if you want 256 colour support)
340 fi])
341
342 AC_ARG_ENABLE(cursor-blink,
343 [ --enable-cursor-blink enable blinking cursor],
344 [if test x$enableval = xyes -o x$enableval = xno; then
345 support_cursor_blink=$enableval
346 fi])
347
348 AC_ARG_ENABLE(text-blink,
349 [ --enable-text-blink enable blinking text],
350 [if test x$enableval = xyes -o x$enableval = xno; then
351 support_text_blink=$enableval
352 fi])
353
354 AC_ARG_ENABLE(pointer-blank,
355 [ --enable-pointer-blank enable pointer blank when typing or inactive pointer],
356 [if test x$enableval = xyes -o x$enableval = xno; then
357 support_pointer_blank=$enableval
358 fi])
359
360 AC_ARG_WITH(term,
361 [ --with-term=NAME set the terminal to NAME (default \"xterm\")],
362 [if test x$withval != x; then
363 AC_DEFINE_UNQUOTED(TERMENV, "$withval",Set TERM to the value given by configure) term="$withval"
364 fi])
365
366 AC_ARG_WITH(terminfo,
367 [ --with-terminfo=PATH set the path to the terminfo tree to PATH],
368 [if test x$withval != x; then
369 AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval"
370 fi])
371
372 dnl# --------------------------------------------------------------------------
373
374 AC_DEFINE(PROTOTYPES, 1, Define if you need function prototypes)
375
376 dnl# --------------------------------------------------------------------------
377 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
378 dnl#
379 if test -z "$CFLAGS"; then
380 if test -z "$CCOPTS"; then
381 CCOPTS='-O'
382 dnl> if test "x$GCC" = xyes; then
383 dnl> if test x$system = xLinux; then
384 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
385 dnl> fi
386 dnl> fi
387 fi
388 CFLAGS="$CCOPTS"
389 fi
390
391 AC_PATH_PROG(MV, mv, mv)
392 AC_PATH_PROG(RM, rm, rm)
393 AC_PATH_PROG(CP, cp, cp)
394 AC_PATH_PROG(LN, ln, ln)
395 AC_PATH_PROG(SED, sed, sed)
396 AC_PATH_PROG(ECHO, echo, echo)
397 AC_PATH_PROG(CMP, cmp, cmp)
398 AC_PATH_PROG(TBL, tbl)
399
400 dnl# need a neat way to detect SVR4 or its features
401 dnl# in src/command.c we use these functions:
402 dnl# grantpt(), unlockpt(), ptsname(), which are defined in <sys/ptms.h>
403 dnl# - but are these also defined for other systems?
404
405 dnl# hack to find if this is SVR4 -- who knows?
406 dnl## AC_MSG_CHECKING(for SVR4)
407 dnl## AC_EGREP_CPP(yes,
408 dnl## [#if defined (SVR4) || defined (_SVR4) || defined (__svr4__)
409 dnl## yes;
410 dnl## #endif
411 dnl## ], [AC_MSG_RESULT(yes); AC_DEFINE(PERHAPS_SVR4)], AC_MSG_RESULT(perhaps not?))
412
413 AC_PATH_XTRA
414
415 dnl# the only reasonable way to find libXpm is do-it-yourself
416 dnl# only check if we want xpm-background
417
418 if test x$support_xpm = xyes; then
419 VT_FIND_LIBXPM
420 if test x$no_xpm = xyes; then
421 support_xpm=needsmanualspecification
422 fi
423 fi
424
425 dnl# --------------------------------------------------------------------------
426 dnl# CHECKING FOR HEADER FILES
427 dnl# --------------------------------------------------------------------------
428 AC_HEADER_SYS_WAIT
429 AC_CHECK_HEADERS( \
430 assert.h \
431 fcntl.h \
432 grp.h \
433 libc.h \
434 lastlog.h \
435 stdarg.h \
436 stdlib.h \
437 string.h \
438 termios.h \
439 unistd.h \
440 sys/byteorder.h \
441 sys/ioctl.h \
442 sys/select.h \
443 sys/sockio.h \
444 sys/strredir.h \
445 sys/time.h \
446 utmp.h \
447 utmpx.h \
448 stdint.h \
449 )
450
451 AC_HEADER_TIME
452
453 dnl# check to allow both <termios.h> and <sys/ioctl.h>
454 AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl,
455 [AC_TRY_COMPILE([#include <stdio.h>
456 #include <sys/ioctl.h>
457 #ifdef HAVE_TERMIOS_H
458 #include <termios.h>
459 #endif], [int a = ECHO;], rxvt_cv_header_sysioctl=yes, rxvt_cv_header_sysioctl=no)])
460
461 dnl# ELF systems may want to store paths for dynamic libraries.
462 dnl# Lets see if the compiler can accept "-Rpath" or "-Wl,-Rpath"
463 dnl# At least one version of SunOS wants "-R path" but it's not checked yet.
464 if test -n "$GCC"; then
465 LDARG="-Wl,"
466 else
467 LDARG=""
468 fi
469 changequote(, )dnl
470 R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-rpath '$LDARG'\1/g'
471 changequote([, ])dnl
472
473 ac_save_CFLAGS=$CFLAGS
474 ac_save_LIBS=$LIBS
475 CFLAGS="$CFLAGS $X_CFLAGS"
476 LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"`
477 AC_CACHE_CHECK([for -rpath dynamic library path recording], rxvt_cv_rpath,
478 [AC_TRY_RUN([
479 main()
480 {
481 exit(0);
482 (void) XOpenDisplay("foobar");
483 }], rxvt_cv_rpath=yes, rxvt_cv_rpath=no, dnl
484 AC_MSG_WARN([You may need to check the LIBS line]))])
485 if test x$rxvt_cv_rpath != xyes; then
486 changequote(, )dnl
487 R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g'
488 changequote([, ])dnl
489 LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"`
490 AC_CACHE_CHECK([for -R dynamic library path recording], rxvt_cv_R,
491 [AC_TRY_RUN([
492 main()
493 {
494 exit(0);
495 (void) XOpenDisplay("foobar");
496 }], rxvt_cv_R=yes, rxvt_cv_R=no, rxvt_cv_R=no)])
497 if test x$rxvt_cv_R != xyes; then
498 LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
499 fi
500 fi
501
502 AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer,
503 [AC_TRY_COMPILE([#include <X11/Xlib.h>], [XPointer dummy;],
504 rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)])
505 if test x$rxvt_cv_xpointer = xyes; then
506 AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef)
507 fi
508 LIBS=$ac_save_LIBS
509 CFLAGS=$ac_save_CFLAGS
510
511
512 AC_C_CONST
513 AC_C_INLINE
514
515 dnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow.
516
517 dnl# --------------------------------------------------------------------------
518 dnl# CHECKING FOR MISSING TYPEDEFS
519 dnl# --------------------------------------------------------------------------
520 dnl# Missing typedefs and replacements
521 AC_TYPE_MODE_T
522 dnl> AC_CHECK_TYPE(umode_t, int)
523 dnl> AC_CHECK_TYPE(off_t, long)
524 AC_TYPE_PID_T
525 AC_TYPE_UID_T
526
527
528 AC_CHECK_SIZEOF(char, 1)
529 AC_CHECK_SIZEOF(short, 2)
530 AC_CHECK_SIZEOF(int, 4)
531 AC_CHECK_SIZEOF(long, 4)
532 AC_CHECK_SIZEOF(long long, 8)
533 AC_CHECK_SIZEOF(int *, 4)
534
535 dnl# see usage below
536 AC_DEFUN(RXVT_CHECK_SIZE,
537 [AC_CACHE_CHECK([for $2], $1,
538 [AC_TRY_COMPILE([#include <stdint.h>], $2 dummy;,
539 [$1=yes],
540 [dnl
541 if test $ac_cv_sizeof_char -ge $3; then
542 $1="$4 char"
543 else
544 if test $ac_cv_sizeof_short -ge $3; then
545 $1="$4 short"
546 else
547 if test $ac_cv_sizeof_int -ge $3; then
548 $1="$4 int"
549 else
550 if test $ac_cv_sizeof_long -ge $3; then
551 $1="$4 long"
552 else
553 if test $ac_cv_sizeof_long_long -ge $3; then
554 $1="$4 long long"
555 else
556 $1="$4 $5" # we _must_ have a (possibly wrong) default
557 fi
558 fi
559 fi
560 fi
561 fi])])]
562 if test x"$$1" != xyes; then
563 $6="typedef $$1 $2;"
564 else
565 if test x"$4" = x; then
566 $6="/* typedef $5 $2; */"
567 else
568 $6="/* typedef $4 $5 $2; */"
569 fi
570 fi dnl
571 )
572 dnl#
573 dnl# Look for types the system may know about anyway.
574 dnl#
575 RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , short, rxvt_int16_typedef)
576 AC_SUBST(rxvt_int16_typedef)
577 RXVT_CHECK_SIZE(rxvt_cv_uint16_t, uint16_t, 2, unsigned, short, rxvt_uint16_typedef)
578 AC_SUBST(rxvt_uint16_typedef)
579 RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , int, rxvt_int32_typedef)
580 AC_SUBST(rxvt_int32_typedef)
581 RXVT_CHECK_SIZE(rxvt_cv_uint32_t, uint32_t, 4, unsigned, int, rxvt_uint32_typedef)
582 AC_SUBST(rxvt_uint32_typedef)
583 dnl RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , long long, rxvt_int64_typedef)
584 dnl AC_SUBST(rxvt_int64_typedef)
585 dnl RXVT_CHECK_SIZE(rxvt_cv_uint64_t, uint64_t, 8, unsigned, long long, rxvt_uint64_typedef)
586 dnl AC_SUBST(rxvt_uint64_typedef)
587 dnl#
588 dnl# Now look for another we use
589 dnl#
590 if test $ac_cv_sizeof_int_p -eq 8; then
591 rxvt_intp_define="#define intp_t int64_t"
592 rxvt_u_intp_define="#define u_intp_t u_int64_t"
593 else
594 if test $ac_cv_sizeof_int_p -eq 4; then
595 rxvt_intp_define="#define intp_t int32_t"
596 rxvt_u_intp_define="#define u_intp_t u_int32_t"
597 else
598 if test $ac_cv_sizeof_int_p -eq 2; then
599 rxvt_intp_define="#define intp_t int16_t"
600 rxvt_u_intp_define="#define u_intp_t u_int16_t"
601 else
602 rxvt_intp_define="#error set intp_t"
603 rxvt_u_intp_define="#error set u_intp_t"
604 fi
605 fi
606 fi
607 AC_SUBST(rxvt_intp_define)
608 AC_SUBST(rxvt_u_intp_define)
609
610 dnl# --------------------------------------------------------------------------
611 dnl# CHECKING FOR LIBRARY FUNCTIONS
612 dnl# --------------------------------------------------------------------------
613 AC_TYPE_SIGNAL
614 dnl> AC_FUNC_VPRINTF
615
616 dnl# Note: On Ultrix, setsid() does weirdo stuff, disable it
617 case "$host_alias" in
618 *ultrix) ac_cv_func_setsid='no' ;;
619 *) break;;
620 esac
621
622 AC_CHECK_FUNCS( \
623 atexit \
624 revoke \
625 unsetenv \
626 setutent \
627 seteuid \
628 setreuid \
629 setsid \
630 setpgrp \
631 setpgid \
632 openpty \
633 _getpty \
634 grantpt \
635 unlockpt \
636 isastream \
637 on_exit \
638 nanosleep \
639 updwtmp \
640 ttyslot \
641 )
642 dnl# Note: On NetBSD, openpty() exists in libutil. Don't pull it in
643
644 dnl# --------------------------------------------------------------------------
645 dnl# DO ALL UTMP AND WTMP CHECKING
646 dnl# --------------------------------------------------------------------------
647 dnl# check for host field in utmp structure
648
649 dnl# --------------------------------------------
650 AC_CHECK_HEADER(utmp.h,
651 [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp,
652 [AC_TRY_COMPILE([#include <sys/types.h>
653 #include <stdint.h>
654 #include <utmp.h>],
655 [struct utmp ut;],
656 rxvt_cv_struct_utmp=yes, rxvt_cv_struct_utmp=no)])
657 if test x$rxvt_cv_struct_utmp = xyes; then
658 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
659 fi
660 ]
661
662 AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host,
663 [AC_TRY_COMPILE([#include <sys/types.h>
664 #include <utmp.h>],
665 [struct utmp ut; ut.ut_host;],
666 rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)])
667 if test x$rxvt_cv_struct_utmp_host = xyes; then
668 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
669 fi
670
671 AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid,
672 [AC_TRY_COMPILE([#include <sys/types.h>
673 #include <utmp.h>],
674 [struct utmp ut; ut.ut_pid;],
675 rxvt_cv_struct_utmp_pid=yes, rxvt_cv_struct_utmp_pid=no)])
676 if test x$rxvt_cv_struct_utmp_pid = xyes; then
677 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
678 fi
679 ) dnl# AC_CHECK_HEADER(utmp.h
680
681 dnl# --------------------------------------------
682
683 AC_CHECK_HEADER(utmpx.h,
684 [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx,
685 [AC_TRY_COMPILE([#include <sys/types.h>
686 #include <utmpx.h>],
687 [struct utmpx ut;],
688 rxvt_cv_struct_utmpx=yes, rxvt_cv_struct_utmpx=no)])
689 if test x$rxvt_cv_struct_utmpx = xyes; then
690 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
691 fi
692 ]
693
694 AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host,
695 [AC_TRY_COMPILE([#include <sys/types.h>
696 #include <utmpx.h>],
697 [struct utmpx utx; utx.ut_host;],
698 rxvt_cv_struct_utmpx_host=yes, rxvt_cv_struct_utmpx_host=no)])
699 if test x$rxvt_cv_struct_utmpx_host = xyes; then
700 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
701 fi
702 ) dnl# AC_CHECK_HEADER(utmpx.h
703
704
705 dnl# --------------------------------------------------------------------------
706 dnl# check for struct lastlog
707 AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog,
708 [AC_TRY_COMPILE([#include <sys/types.h>
709 #include <utmp.h>
710 #ifdef HAVE_LASTLOG_H
711 #include <lastlog.h>
712 #endif
713 ],
714 [struct lastlog ll;],
715 rxvt_cv_struct_lastlog=yes, rxvt_cv_struct_lastlog=no)])
716 if test x$rxvt_cv_struct_lastlog = xyes; then
717 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
718 fi
719
720 dnl# check for struct lastlogx
721 AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx,
722 [AC_TRY_COMPILE([#include <sys/types.h>
723 #include <utmpx.h>
724 #ifdef HAVE_LASTLOG_H
725 #include <lastlog.h>
726 #endif
727 ],
728 [struct lastlogx ll;],
729 rxvt_cv_struct_lastlogx=yes, rxvt_cv_struct_lastlogx=no)])
730 if test x$rxvt_cv_struct_lastlogx = xyes; then
731 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
732 fi
733
734 dnl# --------------------------------------------------------------------------
735 dnl# FIND FILES
736 dnl# --------------------------------------------------------------------------
737
738 dnl# find utmp
739 AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp,
740 [AC_TRY_RUN([#include <stdio.h>
741 #include <sys/types.h>
742 #include <utmp.h>
743 #include <errno.h>
744 main()
745 {
746 char **u, *utmplist[] = {
747 "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL };
748 FILE *a, *f=fopen("conftestval", "w");
749 if (!f) exit(1);
750 #ifdef UTMP_FILE
751 fprintf(f, "%s\n", UTMP_FILE);
752 exit(0);
753 #endif
754 #ifdef _PATH_UTMP
755 fprintf(f, "%s\n", _PATH_UTMP);
756 exit(0);
757 #endif
758 for (u = utmplist; *u; u++) {
759 if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
760 fprintf(f, "%s\n", *u);
761 exit(0);
762 }
763 }
764 exit(0);
765 }], rxvt_cv_path_utmp=`cat conftestval`, rxvt_cv_path_utmp=, dnl
766 AC_MSG_WARN([Define RXVT_UTMP_FILE in config.h manually]))])
767 if test x$rxvt_cv_path_utmp != x; then
768 AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp)
769 fi
770
771 dnl# --------------------------------------------------------------------------
772
773 dnl# find utmpx - if a utmp file exists at the same location and is more than
774 dnl# a day newer, then dump the utmpx. People leave lots of junk around.
775 AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx,
776 [AC_TRY_RUN([#include <stdio.h>
777 #include <sys/types.h>
778 #include <utmpx.h>
779 #include <errno.h>
780 #include <sys/stat.h>
781 #ifdef HAVE_STRING_H
782 #include <string.h>
783 #endif
784 main()
785 {
786 char **u, *p, *utmplist[] = {
787 #ifdef UTMPX_FILE
788 UTMPX_FILE,
789 #endif
790 #ifdef _PATH_UTMPX
791 _PATH_UTMPX,
792 #endif
793 "/var/adm/utmpx", "/etc/utmpx", NULL };
794 FILE *a, *f=fopen("conftestval", "w");
795 struct stat statu, statux;
796 if (!f) exit(1);
797 for (u = utmplist; *u; u++) {
798 if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
799 if (stat(*u, &statux) < 0)
800 continue;
801 p = strdup(*u);
802 p[strlen(p) - 1] = '\0';
803 if (stat(p, &statu) >= 0
804 && (statu.st_mtime - statux.st_mtime > 86400))
805 continue;
806 fprintf(f, "%s\n", *u);
807 exit(0);
808 }
809 }
810 exit(0);
811 }], rxvt_cv_path_utmpx=`cat conftestval`, rxvt_cv_path_utmpx=, dnl
812 AC_MSG_WARN([Define RXVT_UTMPX_FILE in config.h manually]))])
813 if test x$rxvt_cv_path_utmpx != x; then
814 AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx)
815 fi
816
817 dnl# --------------------------------------------------------------------------
818
819 dnl# find wtmp
820 AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp,
821 [AC_TRY_RUN([#include <stdio.h>
822 #include <sys/types.h>
823 #ifdef HAVE_UTMP_H
824 #include <utmp.h>
825 #endif
826 #include <errno.h>
827 main()
828 {
829 char **w, *wtmplist[] = {
830 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
831 FILE *a, *f=fopen("conftestval", "w");
832 if (!f) exit(1);
833 #ifdef WTMP_FILE
834 fprintf(f, "%s\n", WTMP_FILE);
835 exit(0);
836 #endif
837 #ifdef _PATH_WTMP
838 fprintf(f, "%s\n", _PATH_WTMP);
839 exit(0);
840 #endif
841 for (w = wtmplist; *w; w++) {
842 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
843 fprintf(f, "%s\n", *w);
844 exit(0);
845 }
846 }
847 exit(0);
848 }], rxvt_cv_path_wtmp=`cat conftestval`, rxvt_cv_path_wtmp=, dnl
849 AC_MSG_WARN([Define RXVT_WTMP_FILE in config.h manually]))])
850 if test x$rxvt_cv_path_wtmp != x; then
851 AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp)
852 fi
853 dnl# --------------------------------------------------------------------------
854
855 dnl# find wtmpx
856 AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx,
857 [AC_TRY_RUN([#include <stdio.h>
858 #ifdef HAVE_UTMPX_H
859 #include <utmpx.h>
860 #endif
861 #include <errno.h>
862 main()
863 {
864 char **w, *wtmplist[] = {
865 "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
866 FILE *a, *f=fopen("conftestval", "w");
867 if (!f) exit(1);
868 #ifdef WTMPX_FILE
869 fprintf(f, "%s\n", WTMPX_FILE);
870 exit(0);
871 #endif
872 #ifdef _PATH_WTMPX
873 fprintf(f, "%s\n", _PATH_WTMPX);
874 exit(0);
875 #endif
876 for (w = wtmplist; *w; w++) {
877 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
878 fprintf(f, "%s\n", *w);
879 exit(0);
880 }
881 }
882 exit(0);
883 }], rxvt_cv_path_wtmpx=`cat conftestval`, rxvt_cv_path_wtmpx=, dnl
884 AC_MSG_WARN([Define RXVT_WTMPX_FILE in config.h manually]))])
885 if test x$rxvt_cv_path_wtmpx != x; then
886 AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx)
887 fi
888 dnl# --------------------------------------------------------------------------
889
890 dnl# find lastlog
891 AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog,
892 [AC_TRY_RUN([#include <stdio.h>
893 #include <sys/types.h>
894 #ifdef HAVE_UTMPX_H
895 #include <utmpx.h>
896 #elif defined(HAVE_UTMP_H)
897 #include <utmp.h>
898 #endif
899 #ifdef HAVE_LASTLOG_H
900 #include <lastlog.h>
901 #endif
902 #include <errno.h>
903 main()
904 {
905 char **w, *lastloglist[] = { "/var/log/lastlog", NULL };
906 FILE *a, *f=fopen("conftestval", "w");
907 if (!f) exit(1);
908 #ifdef LASTLOG_FILE
909 fprintf(f, "%s\n", LASTLOG_FILE);
910 exit(0);
911 #endif
912 #ifdef _PATH_LASTLOG
913 fprintf(f, "%s\n", _PATH_LASTLOG);
914 exit(0);
915 #endif
916 for (w = lastloglist; *w; w++) {
917 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
918 fprintf(f, "%s\n", *w);
919 exit(0);
920 }
921 }
922 exit(0);
923 }], rxvt_cv_path_lastlog=`cat conftestval`, rxvt_cv_path_lastlog=, dnl
924 AC_MSG_WARN([Define RXVT_LASTLOG_FILE in config.h manually]))])
925 if test x$rxvt_cv_path_lastlog != x; then
926 AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog)
927 if test -d "$rxvt_cv_path_lastlog"; then
928 AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory)
929 fi
930 fi
931 dnl# --------------------------------------------------------------------------
932
933 dnl# find lastlogx
934 AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx,
935 [AC_TRY_RUN([#include <stdio.h>
936 #ifdef HAVE_UTMPX_H
937 #include <utmpx.h>
938 #endif
939 #include <errno.h>
940 main()
941 {
942 char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
943 FILE *a, *f=fopen("conftestval", "w");
944 if (!f) exit(1);
945 #ifdef LASTLOGX_FILE
946 fprintf(f, "%s\n", LASTLOGX_FILE);
947 exit(0);
948 #endif
949 #ifdef _PATH_LASTLOGX
950 fprintf(f, "%s\n", _PATH_LASTLOGX);
951 exit(0);
952 #endif
953 for (w = wtmplist; *w; w++) {
954 if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
955 fprintf(f, "%s\n", *w);
956 exit(0);
957 }
958 }
959 exit(0);
960 }], rxvt_cv_path_lastlogx=`cat conftestval`, rxvt_cv_path_lastlogx=, dnl
961 AC_MSG_WARN([Define RXVT_LASTLOGX_FILE in config.h manually]))])
962 if test x$rxvt_cv_path_lastlogx != x; then
963 AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx)
964 fi
965
966 dnl# --------------------------------------------------------------------------
967
968 dnl# find ttys/ttytab
969 AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab,
970 [for ttys_file in dnl
971 /etc/ttys /etc/ttytab;
972 do
973 if test -f "$ttys_file" ; then
974 rxvt_cv_path_ttytab=$ttys_file
975 break
976 fi
977 done
978 ])
979 if test x$rxvt_cv_path_ttytab != x; then
980 AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab", Define location of ttys/ttytab)
981 fi
982
983 dnl# --------------------------------------------------------------------------
984 dnl# --------------------------------------------------------------------------
985
986 dnl# this is a really hack test for some basic Xlocale stuff
987 ac_save_LIBS=$LIBS
988 ac_save_CFLAGS=$CFLAGS
989 CFLAGS="$CFLAGS $X_CFLAGS"
990 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
991 if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
992 LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
993 fi
994 AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale,
995 [AC_TRY_RUN([#include <X11/Xlib.h>
996 main() {
997 char *p;
998 if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
999 exit (XSupportsLocale() ? 0 : 1);
1000 else
1001 exit (1);}], dnl
1002 rxvt_cv_func_xlocale=yes, rxvt_cv_func_xlocale=no, dnl
1003 AC_MSG_WARN([Define NO_XLOCALE in config.h manually]))])
1004 if test x$rxvt_cv_func_xlocale = xyes; then
1005 AC_DEFINE(HAVE_XLOCALE, 1, Define if Xlocale support works)
1006 fi
1007
1008 AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale,
1009 [AC_TRY_LINK([#define X_LOCALE 1
1010 #include <X11/Xlocale.h>],
1011 [setlocale(LC_CTYPE, "");],
1012 rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)])
1013 if test x$rxvt_cv_func_xsetlocale = xyes; then
1014 AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works)
1015 fi
1016 LIBS=$ac_save_LIBS
1017 CFLAGS=$ac_save_CFLAGS
1018
1019 AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale,
1020 [AC_TRY_LINK([#include <locale.h>],
1021 [setlocale(LC_CTYPE, "");],
1022 rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)])
1023 if test x$rxvt_cv_func_setlocale = xyes; then
1024 AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works)
1025 fi
1026
1027 AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo,
1028 [AC_TRY_LINK([#include <langinfo.h>],
1029 [nl_langinfo(CODESET);],
1030 rxvt_cv_func_nl_langinfo=yes, rxvt_cv_func_nl_langinfo=no)])
1031 if test x$rxvt_cv_func_nl_langinfo = xyes; then
1032 AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works)
1033 fi
1034
1035 AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt,
1036 [AC_TRY_LINK([#define _GNU_SOURCE
1037 #ifdef HAVE_STDLIB_H
1038 # include <stdlib.h>
1039 #endif],
1040 [(void)getpt();],
1041 rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)])
1042 if test x$rxvt_cv_func_getpt = xyes; then
1043 AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() )
1044 fi
1045
1046 dnl# if we don't guess right then it's up to the user
1047 AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys,
1048 [if test x$ac_cv_func_openpty = xyes; then
1049 rxvt_cv_ptys=OPENPTY
1050 else if test x$ac_cv_func__getpty = xyes; then
1051 rxvt_cv_ptys=SGI4
1052 else if test -c /dev/ttyp20; then
1053 rxvt_cv_ptys=SCO
1054 else if test -c /dev/ptym/clone; then
1055 rxvt_cv_ptys=HPUX
1056 else if test x$rxvt_cv_func_getpt = xyes; then
1057 rxvt_cv_ptys=GLIBC
1058 else if test -c /dev/ptc -a -c /dev/pts; then
1059 rxvt_cv_ptys=PTC
1060 else if test -c /dev/ptc -a -d /dev/pts; then
1061 rxvt_cv_ptys=PTC
1062 else if test -c /dev/ptmx -a -c /dev/pts/0; then
1063 rxvt_cv_ptys=STREAMS
1064 else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then
1065 dnl# catch CYGWIN
1066 rxvt_cv_ptys=STREAMS
1067 else
1068 rxvt_cv_ptys=BSD
1069 fi
1070 fi
1071 fi
1072 fi
1073 fi
1074 fi
1075 fi
1076 fi
1077 fi
1078 ])
1079
1080 if test x$rxvt_cv_ptys = xOPENPTY; then
1081 AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type)
1082 fi
1083 if test x$rxvt_cv_ptys = xSCO; then
1084 AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type)
1085 fi
1086 if test x$rxvt_cv_ptys = xSTREAMS; then
1087 AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type)
1088 fi
1089 if test x$rxvt_cv_ptys = xPTC; then
1090 AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type)
1091 fi
1092 if test x$rxvt_cv_ptys = xSGI4; then
1093 AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type)
1094 fi
1095 if test x$rxvt_cv_ptys = xCONVEX; then
1096 AC_DEFINE(PTYS_ARE_GETPTY, 1, Define for this pty type)
1097 fi
1098 if test x$rxvt_cv_ptys = xGLIBC; then
1099 AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type)
1100 fi
1101 if test x$rxvt_cv_ptys = xHPUX; then
1102 AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type)
1103 fi
1104 if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then
1105 AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type)
1106 fi
1107
1108
1109 AC_CHECKING(for pty ranges)
1110 ptys=`echo /dev/pty??`
1111 pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
1112 pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
1113 if test x$pch1 != x; then
1114 AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX)
1115 fi
1116 if test x$pch2 != x; then
1117 AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX)
1118 fi
1119
1120 dnl# FreeBSD needs to link libxpg4
1121 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1122
1123 dnl# --------------------------------------------------------------------------
1124 dnl# now add and remove other stuff
1125 dnl# --------------------------------------------------------------------------
1126 if test x$support_inheritpixmap = xyes; then
1127 AC_DEFINE(TRANSPARENT, 1, Define if you want your background to use the parent window background)
1128 fi
1129 if test x$support_keepscrolling = xno; then
1130 AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING, 1, Define for continual scrolling when you keep the scrollbar button pressed)
1131 fi
1132 if test x$support_selectionscrolling = xyes; then
1133 AC_DEFINE(SELECTION_SCROLLING, 1, Define to allow scrolling when the selection moves to the top or bottom of the screen)
1134 fi
1135 if test x$support_menubar = xyes; then
1136 AC_DEFINE(MENUBAR, 1, Define if you want Menubar support)
1137 fi
1138 if test x$support_frills = xno; then
1139 AC_DEFINE(NO_FRILLS, 1, Define if you don't want handling for rarely used features)
1140 fi
1141 if test x$support_linespace = xno; then
1142 AC_DEFINE(NO_LINESPACE, 1, Define if you don't want support linespace)
1143 fi
1144 if test x$support_24bit = xyes; then
1145 AC_DEFINE(PREFER_24BIT, 1, Define to use a 24 bit visual if the screen has 24 bit mode, even if the default is 8 bit)
1146 fi
1147 if test x$support_mousewheel = xyes; then
1148 AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll)
1149 fi
1150 if test x$support_mouseslipwheel = xyes; then
1151 AC_DEFINE(MOUSE_SLIP_WHEELING, 1, Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling)
1152 fi
1153 if test x$support_oldselection = xno; then
1154 AC_DEFINE(NO_OLD_SELECTION, 1, Define to remove old rxvt (ver 2.20 and before) style selection)
1155 fi
1156 if test x$support_utmp = xyes; then
1157 AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support)
1158 fi
1159 if test x$support_wtmp = xyes; then
1160 AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled)
1161 fi
1162 if test x$support_lastlog = xyes; then
1163 AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
1164 fi
1165 if test x$support_xim = xyes -o x$multichar_set = xyes; then
1166 if test x$rxvt_cv_func_xlocale = xyes; then
1167 AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input)
1168 fi
1169 fi
1170 if test x$support_xpm = xyes; then
1171 AC_DEFINE(XPM_BACKGROUND, 1, Define if you want to have sexy-looking background pixmaps. Needs libXpm)
1172 fi
1173 if test x$support_scroll_rxvt = xyes; then
1174 AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars)
1175 scrolltypes="rxvt"
1176 fi
1177 if test x$support_scroll_next = xyes; then
1178 AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars)
1179 scrolltypes="$scrolltypes next"
1180 fi
1181 if test x$support_scroll_xterm = xyes; then
1182 AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars)
1183 scrolltypes="$scrolltypes xterm"
1184 fi
1185 if test x$support_scroll_plain = xyes; then
1186 AC_DEFINE(PLAIN_SCROLLBAR, 1, Support plain style scrollbars)
1187 scrolltypes="$scrolltypes plain"
1188 fi
1189 if test x$support_pointer_blank = xyes; then
1190 AC_DEFINE(POINTER_BLANK, 1, Define if you want hide the pointer while typing)
1191 fi
1192 if test x$support_cursor_blink = xyes; then
1193 AC_DEFINE(CURSOR_BLINK, 1, Define if you want blinking cursor support)
1194 fi
1195 if test x$support_text_blink = xyes; then
1196 AC_DEFINE(TEXT_BLINK, 1, Define if you want blinking text support)
1197 fi
1198 if test x$support_unicode3 = xyes; then
1199 AC_DEFINE(UNICODE_3, 1, Define if you want to represent unicode characters outside plane 0)
1200 fi
1201 if test x$codesets = xall; then
1202 codesets=jp,jp-ext,kr,cn,cn-ext,vn
1203 fi
1204 for codeset in `echo $codesets | tr "[a-z,\\-]" "[A-Z _]"`; do
1205 AC_DEFINE(ENCODING_EU, 1, Define if you want european extended codesets)
1206 case "$codeset" in
1207 VN ) AC_DEFINE(ENCODING_VN, 1, Define if you want vietnamese codesets) ;;
1208 JP ) AC_DEFINE(ENCODING_JP, 1, Define if you want japanese codesets) ;;
1209 JP_EXT ) AC_DEFINE(ENCODING_JP_EXT, 1, Define if you want extended japanese codesets) ;;
1210 KR ) AC_DEFINE(ENCODING_KR, 1, Define if you want korean codesets) ;;
1211 CN ) AC_DEFINE(ENCODING_CN, 1, Define if you want chinese codesets) ;;
1212 CN_EXT ) AC_DEFINE(ENCODING_CN_EXT, 1, Define if you want extended chinese codesets) ;;
1213 esac
1214 done
1215
1216 dnl> AC_CHECK_FUNCS(gettimeofday putenv select socket)
1217
1218 CFLAGS=${CFLAGS--O}
1219 LDFLAGS=${LDFLAGS--O}
1220
1221 CPPFLAGS="$CPPFLAGS"
1222 AC_SUBST(DEBUG)
1223 AC_SUBST(DINCLUDE)
1224 AC_SUBST(CFLAGS)
1225 AC_SUBST(CPPFLAGS)
1226 AC_SUBST(LDFLAGS)
1227 AC_SUBST(X_CFLAGS)
1228
1229 dnl# Attack the libs
1230 if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
1231 DLIB=`echo $DLIB | sed "$R_TRANSLATE"`
1232 LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
1233 X_LIBS=`echo $X_LIBS | sed "$R_TRANSLATE"`
1234 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed "$R_TRANSLATE"`
1235 XPM_LIBS=`echo $XPM_LIBS | sed "$R_TRANSLATE"`
1236 fi
1237 AC_SUBST(DLIB)
1238 AC_SUBST(LIBS)
1239 AC_SUBST(X_LIBS)
1240 AC_SUBST(X_EXTRA_LIBS)
1241
1242 if test x$support_addstrings = xno; then
1243 AC_DEFINE(NO_STRINGS, 1, Define if you don't need to use our replacement string functions)
1244 fi
1245
1246 dnl# common parts of the Makefile
1247 MCOMMON=./autoconf/Make.common
1248 AC_SUBST_FILE(MCOMMON)
1249
1250 AC_ARG_PROGRAM
1251
1252 RXVTNAME=`echo rxvt|sed "$program_transform_name"`
1253 AC_SUBST(RXVTNAME)
1254
1255 dnl# test for "sun" or "__sun__" before include sys_ioctl
1256
1257 dnl# revert HAVE_BLAH_H into a "#include <blah.h>"
1258 AC_DEFUN(RXVT_DEFINE_TO_INCLUDE, dnl
1259 [if test "$$3" = "$4" -o "$$5" = "$6"; then
1260 $1="#include <$2>"
1261 else
1262 $1="/* #include <$2> */"
1263 fi dnl
1264 AC_SUBST($1)])
1265
1266 RXVT_DEFINE_TO_INCLUDE(include_stdint_h, stdint.h, ac_cv_header_stdint_h, yes, notset, dontmatch)
1267 RXVT_DEFINE_TO_INCLUDE(include_stdarg_h, stdarg.h, ac_cv_header_stdarg_h, yes, notset, dontmatch)
1268 RXVT_DEFINE_TO_INCLUDE(include_stdlib_h, stdlib.h, ac_cv_header_stdlib_h, yes, notset, dontmatch)
1269 RXVT_DEFINE_TO_INCLUDE(include_unistd_h, unistd.h, ac_cv_header_unistd_h, yes, notset, dontmatch)
1270 RXVT_DEFINE_TO_INCLUDE(include_string_h, string.h, ac_cv_header_string_h, yes, notset, dontmatch)
1271 RXVT_DEFINE_TO_INCLUDE(include_fcntl_h, fcntl.h, ac_cv_header_fcntl_h, yes, notset, dontmatch)
1272 RXVT_DEFINE_TO_INCLUDE(include_util_h, util.h, ac_cv_header_util_h, yes, notset, dontmatch)
1273 RXVT_DEFINE_TO_INCLUDE(include_assert_h, assert.h, ac_cv_header_assert_h, yes, notset, dontmatch)
1274 RXVT_DEFINE_TO_INCLUDE(include_sys_ioctl_h, sys/ioctl.h, rxvt_cv_header_sysioctl, yes, notset, dontmatch)
1275 RXVT_DEFINE_TO_INCLUDE(include_sys_select_h, sys/select.h, ac_cv_header_sys_select_h, yes, notset, dontmatch)
1276 RXVT_DEFINE_TO_INCLUDE(include_sys_strredir_h, sys/strredir.h, ac_cv_header_sys_strredir_h, yes, notset, dontmatch)
1277 RXVT_DEFINE_TO_INCLUDE(include_sys_time_h, sys/time.h, ac_cv_header_sys_time_h, yes, notset, dontmatch)
1278 RXVT_DEFINE_TO_INCLUDE(include_time_h, time.h, ac_cv_header_sys_time_h, no, ac_cv_header_time, yes)
1279
1280 if test x$support_xft = xyes; then
1281 LIBS="$LIBS `pkg-config xft --libs`"
1282 CFLAGS="$CFLAGS `pkg-config xft --cflags`"
1283 CPPFLAGS="$CPPFLAGS `pkg-config xft --cflags`"
1284
1285 AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no])
1286 AC_CHECK_LIB(Xft,XftDrawString32,,[support_xft=no])
1287
1288 if test x$support_xft = xyes; then
1289 AC_DEFINE(XFT, 1, Define to enable xft support)
1290 fi
1291 fi
1292
1293 AC_OUTPUT(autoconf/Make.common \
1294 Makefile \
1295 doc/Makefile \
1296 src/Makefile \
1297 src/test/Makefile \
1298 src/rxvtlib.h \
1299 W11/Makefile \
1300 )
1301
1302 echo "Configuration:
1303
1304 Rxvt version: $VERSION : $DATE
1305 Source code location: $srcdir
1306 Install path: ${prefix}/bin
1307 Compiler: $CC
1308 Compiler flags: $CFLAGS"
1309
1310 if test "$MALLOC_TYPE" = S; then
1311 echo " malloc support: system default"
1312 fi
1313 if test "$MALLOC_TYPE" = G; then
1314 echo " malloc support: Gray Watson's dmalloc"
1315 fi
1316 if test "$MALLOC_TYPE" = D; then
1317 echo " malloc support: Doug Lea's malloc"
1318 fi
1319
1320 if test x$support_xpm = xyes; then
1321 echo " Xpm library: $XPM_LIBS"
1322 fi
1323
1324 echo "
1325 The following are set in config.h
1326 "
1327 echo " pty/tty type: "$rxvt_cv_ptys
1328 if test x$support_utmp != xyes; then
1329 echo " utmp support: disabled
1330 "
1331 else
1332 echo " utmp support: enabled
1333 utmp file: $rxvt_cv_path_utmp
1334 utmpx file: $rxvt_cv_path_utmpx
1335 wtmp file: $rxvt_cv_path_wtmp
1336 wtmpx file: $rxvt_cv_path_wtmpx
1337 lastlog file: $rxvt_cv_path_lastlog
1338 ttys/ttytab file: $rxvt_cv_path_ttytab
1339 "
1340 fi
1341 if test x$term != x; then
1342 echo " set TERM to: $term
1343 "
1344 fi
1345 if test x$terminfo != x; then
1346 echo " set TERMINFO to: $terminfo
1347 "
1348 fi
1349 if test x$rxvt_cv_ptys = xUNKNOWN; then
1350 echo ".----------------------------------------------------------------."
1351 echo ". WARNING: could not determine pty/tty type. Do not build until ."
1352 echo ". the appropriate PTYS_ARE_* is defined in config.h ."
1353 echo ".----------------------------------------------------------------."
1354 fi
1355 if test x$support_xpm = xneedsmanualspecification; then
1356 echo ".----------------------------------------------------------------."
1357 echo ". WARNING: --enable-xpm-background was specified however the ."
1358 echo ". XPM includes files and libraries could not be found. ."
1359 echo ". XPM backgrounds are now being DISABLED! If you want ."
1360 echo ". to use them you should rerun configure with the ."
1361 echo ". appropriate --with-xpm-includes=/path/to/xpm/includes ."
1362 echo ". and --with-xpm-library=/path/to/xpm/library lines. ."
1363 echo ".----------------------------------------------------------------."
1364 fi
1365 if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then
1366 echo ".----------------------------------------------------------------."
1367 echo ". WARNING: --enable-xim was specified however the locale support ."
1368 echo ". functions could not be found. ."
1369 echo ". XIM is now being DISABLED! ."
1370 echo ".----------------------------------------------------------------."
1371 fi
1372 echo " *** Please check src/feature.h for further options ***
1373 "