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