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