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