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