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