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