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