ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/autoconf/configure.in
Revision: 1.5
Committed: Fri Jan 16 18:49:33 2004 UTC (20 years, 5 months ago) by pcg
Branch: MAIN
Changes since 1.4: +29 -3 lines
Log Message:
*** empty log message ***

File Contents

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