ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/autoconf/configure.in
Revision: 1.9
Committed: Sat Jan 31 00:20:21 2004 UTC (20 years, 5 months ago) by pcg
Branch: MAIN
Changes since 1.8: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

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