ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.130
Committed: Sun Nov 13 16:03:31 2011 UTC (12 years, 6 months ago) by mikachu
Branch: MAIN
Changes since 1.129: +33 -0 lines
Log Message:
Apply startup notification patch from Michael Stapelberg

File Contents

# User Rev Content
1 ayin 1.1 dnl#
2     dnl# Process this file with autoconf to produce a configure script.
3     dnl#
4    
5     AC_INIT
6     AC_PREREQ(2.50)
7     AC_CONFIG_SRCDIR([src/feature.h])
8     AC_CONFIG_HEADER(config.h:config.h.in)
9    
10     AC_CANONICAL_HOST
11    
12     dnl RXVT version
13     changequote(, )dnl
14     VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
15     DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
16     changequote([, ])dnl
17 ayin 1.40 AC_SUBST(VERSION)dnl
18     AC_SUBST(DATE)dnl
19 root 1.83
20 ayin 1.1 echo ""
21     echo "configuring for rxvt $VERSION"
22     echo ""
23    
24     orig_CXXFLAGS="$CXXFLAGS"
25    
26     dnl# Checks for programs.
27     AC_PROG_CC
28     AC_PROG_CXX
29     AC_PROG_CPP
30     AC_PROG_INSTALL
31    
32 root 1.9 AC_AIX
33 ayin 1.90 AC_GNU_SOURCE
34 root 1.9 AC_ISC_POSIX
35 root 1.16 AC_LANG(C++)
36 root 1.9
37 sf-exg 1.109 dnl check whether we can link with gcc -lsupc++
38 root 1.9 if test x$GCC = xyes && test x$GXX = xyes; then
39 root 1.16 dnl FreeBSD (at least up to 5.3) has a broken GCC, workaround it
40     AC_MSG_CHECKING([for working libsupc++])
41     save_CXX="$CXX"
42     save_LIBS="$LIBS"
43     CXX="$CC"
44     LIBS="$LIBS -lsupc++"
45     LINKER="$CC"
46     AC_LINK_IFELSE(
47 root 1.35 [AC_LANG_PROGRAM([struct test { }; void f() try { throw new test; } catch (...) { throw; }],[])],
48 ayin 1.60 [AC_MSG_RESULT(ok)],
49 root 1.16 [
50 root 1.17 AC_MSG_RESULT([no, making everything bigger and slower])
51 root 1.16 LIBS="$save_LIBS"
52 root 1.17 LINKER="$save_CXX"
53 root 1.16 ]
54     )
55 root 1.17 CXX="$save_CXX"
56 root 1.9 fi
57     AC_SUBST(LINKER,[$LINKER])
58    
59 ayin 1.1 dnl# --------------------------------------------------------------------------
60 ayin 1.12 dnl# Supply default CXXFLAGS, if not specified by `CXXFLAGS=flags ./configure'
61 ayin 1.1 dnl#
62     if test -z "$orig_CXXFLAGS"; then
63     if test x$GCC = xyes && test "x$GXX" = xyes; then
64 root 1.85 CXXFLAGS="-g -O3 -fno-rtti -fvisibility-inlines-hidden -fno-threadsafe-statics -fno-enforce-eh-specs"
65 root 1.35 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="-g -O3"])
66 ayin 1.1 else
67     CXXFLAGS="-O"
68     fi
69     CFLAGS="$CXXFLAGS"
70     fi
71    
72     case $host in
73     *-*-solaris* )
74 ayin 1.55 AC_DEFINE(_XOPEN_SOURCE, 500, Needed to get declarations for msg_control and msg_controllen on Solaris)
75 ayin 1.1 ;;
76     esac
77    
78     dnl# FreeBSD needs to link libxpg4
79 sf-exg 1.111 AC_SEARCH_LIBS(setlocale, xpg4)
80 ayin 1.1
81     dnl# solaris needs to link libnsl and socket
82 sf-exg 1.111 AC_SEARCH_LIBS(gethostbyname, nsl)
83     AC_SEARCH_LIBS(socket, socket)
84 ayin 1.1
85     support_frills=yes
86     support_inheritpixmap=yes
87     support_fading=yes
88     support_keepscrolling=yes
89     support_selectionscrolling=yes
90     support_mousewheel=yes
91     support_mouseslipwheel=yes
92     support_text_blink=yes
93     support_pointer_blank=yes
94     support_scroll_rxvt=yes
95     support_scroll_next=yes
96     support_scroll_xterm=yes
97     support_xim=yes
98 sf-exg 1.125 support_pixbuf=yes
99 mikachu 1.130 support_startup_notification=yes
100 sasha 1.39 support_afterimage=yes
101 ayin 1.1 support_xft=yes
102     support_unicode3=no
103     support_combining=yes
104     support_8bitctrls=no
105     support_iso14755=yes
106     support_styles=yes
107     support_perl=yes
108     codesets=all
109    
110     dnl# --------------------------------------------------------------------------
111     dnl# CHECKING COMMAND LINE OPTIONS
112     dnl# --------------------------------------------------------------------------
113    
114     AC_ARG_ENABLE(everything,
115     [ --enable-everything enable standard non-multichoice features
116 root 1.104 NOTE: this option is order dependent],
117 ayin 1.1 [
118     if test x$enableval = xno; then
119     support_frills=no
120     support_inheritpixmap=no
121     support_fading=no
122     support_keepscrolling=no
123     support_selectionscrolling=no
124     support_lastlog=no
125     support_mousewheel=no
126     support_mouseslipwheel=no
127     support_text_blink=no
128     support_pointer_blank=no
129     support_scroll_rxvt=no
130     support_scroll_next=no
131     support_scroll_xterm=no
132     support_utmp=no
133     support_wtmp=no
134     support_xim=no
135 sf-exg 1.125 support_pixbuf=no
136 mikachu 1.130 support_startup_notification=no
137 sasha 1.39 support_afterimage=no
138 ayin 1.1 support_xft=no
139     support_unicode3=no
140     support_combining=no
141     support_8bitctrls=no
142     support_iso14755=no
143     support_styles=no
144     support_perl=no
145     codesets=
146     fi
147     if test x$enableval = xyes; then
148     support_frills=yes
149     support_inheritpixmap=yes
150     support_fading=yes
151     support_keepscrolling=yes
152     support_selectionscrolling=yes
153     support_lastlog=yes
154     support_mousewheel=yes
155     support_mouseslipwheel=yes
156     support_text_blink=yes
157     support_pointer_blank=yes
158     support_scroll_rxvt=yes
159     support_scroll_next=yes
160     support_scroll_xterm=yes
161     support_utmp=yes
162     support_wtmp=yes
163     support_xim=yes
164 sf-exg 1.125 support_pixbuf=yes
165 mikachu 1.130 support_startup_notification=yes
166 sasha 1.39 support_afterimage=yes
167 ayin 1.1 support_xft=yes
168     support_unicode3=yes
169     support_combining=yes
170     #support_8bitctrls=yes
171     support_iso14755=yes
172     support_styles=yes
173     support_perl=yes
174     codesets=all
175     fi
176     ])
177    
178 root 1.106 ASSERTIONS=no
179     AC_ARG_ENABLE(assert,
180     [ --enable-assert enable assertions],
181     [if test x$enableval = xyes; then
182     ASSERTIONS=yes
183     fi])
184     if test x$ASSERTIONS = xno; then
185     AC_DEFINE(NDEBUG, 1, Disable assertions (good for debugging))
186     fi
187    
188 ayin 1.78 WARNINGS=no
189     AC_ARG_ENABLE(warnings,
190     [ --enable-warnings turn on g++ warnings],
191     [if test x$enableval = xyes; then
192     WARNINGS=yes
193     fi])
194     if test x$GXX = xyes; then
195     if test $WARNINGS = yes; then
196     save_CXXFLAGS="$CXXFLAGS"
197     CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare -Wno-reorder -Wno-non-virtual-dtor"
198     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [], [CXXFLAGS="$save_CXXFLAGS"])
199     else
200     CXXFLAGS="$CXXFLAGS -w"
201     fi
202     fi
203    
204 sf-exg 1.110 support_256_color=no
205     AC_ARG_ENABLE(256-color,
206     [ --enable-256-color enable 256-color support],
207     [if test x$enableval = xyes; then
208     support_256_color=yes
209     fi])
210     if test x$support_256_color = xyes; then
211     AC_DEFINE(USE_256_COLORS, 1, Define if you want 256-color support)
212     fi
213    
214 ayin 1.1 AC_ARG_ENABLE(unicode3,
215     [ --enable-unicode3 use 21 instead of 16 bits to represent unicode characters],
216     [if test x$enableval = xyes -o x$enableval = xno; then
217     support_unicode3=$enableval
218     fi])
219    
220     AC_ARG_ENABLE(combining,
221     [ --enable-combining enable composition of base and combining characters],
222     [if test x$enableval = xyes -o x$enableval = xno; then
223     support_combining=$enableval
224     fi])
225    
226     AC_ARG_ENABLE(xft,
227     [ --enable-xft enable xft support on systems that have it],
228     [if test x$enableval = xyes -o x$enableval = xno; then
229     support_xft=$enableval
230     fi])
231    
232     AC_ARG_ENABLE(font-styles,
233     [ --enable-font-styles enable bold and italic support],
234     [if test x$enableval = xyes -o x$enableval = xno; then
235     support_styles=$enableval
236     fi])
237    
238 sasha 1.39 AC_ARG_ENABLE(afterimage,
239 root 1.104 [ --enable-afterimage enable integration with libAfterImage for background images],
240 sasha 1.39 [if test x$enableval = xyes -o x$enableval = xno; then
241     support_afterimage=$enableval
242     fi])
243    
244 ayin 1.41 AC_ARG_WITH(afterimage_config,
245     [ --with-afterimage-config=DIR use libAfterImage config script in DIR],
246 ayin 1.48 [if test "x$withval" != x; then
247     afterimage_config=$withval/afterimage-config
248     fi])
249 sasha 1.39
250 sf-exg 1.115 AC_ARG_ENABLE(pixbuf,
251     [ --enable-pixbuf enable integration with gdk-pixbuf for background images],
252     [if test x$enableval = xyes -o x$enableval = xno; then
253     support_pixbuf=$enableval
254     fi])
255    
256 mikachu 1.130 AC_ARG_ENABLE(startup-notification,
257     [ --enable-startup-notification enable freedesktop startup notification support],
258     [if test x$enableval = xyes -o x$enableval = xno; then
259     support_startup_notification=$enableval
260     fi])
261    
262 ayin 1.1 AC_ARG_ENABLE(transparency,
263     [ --enable-transparency enable transparent backgrounds],
264     [if test x$enableval = xyes -o x$enableval = xno; then
265     support_inheritpixmap=$enableval
266     fi])
267    
268     AC_ARG_ENABLE(fading,
269     [ --enable-fading enable colors fading when off focus],
270     [if test x$enableval = xyes -o x$enableval = xno; then
271     support_fading=$enableval
272     fi])
273    
274     AC_ARG_ENABLE(rxvt-scroll,
275     [ --enable-rxvt-scroll enable rxvt style scrollbar],
276     [if test x$enableval = xyes -o x$enableval = xno; then
277     support_scroll_rxvt=$enableval
278     fi])
279    
280     AC_ARG_ENABLE(next-scroll,
281     [ --enable-next-scroll enable NeXT style scrollbar],
282     [if test x$enableval = xyes -o x$enableval = xno; then
283     support_scroll_next=$enableval
284     fi])
285    
286     AC_ARG_ENABLE(xterm-scroll,
287     [ --enable-xterm-scroll enable Xterm style scrollbar],
288     [if test x$enableval = xyes -o x$enableval = xno; then
289     support_scroll_xterm=$enableval
290     fi])
291    
292     AC_ARG_ENABLE(perl,
293     [ --enable-perl enable embedded perl interpreter],
294     [if test x$enableval = xyes -o x$enableval = xno; then
295     support_perl=$enableval
296     fi])
297    
298     AC_ARG_WITH(codesets,
299 ayin 1.79 [ --with-codesets=CS,... compile in additional codesets (jp,jp_ext,kr,zh,zh_ext,all)],
300 ayin 1.1 [codesets="$withval"])
301    
302     AC_ARG_ENABLE(xim,
303     [ --enable-xim XIM (X Input Method) protocol support],
304     [if test x$enableval = xyes -o x$enableval = xno; then
305     support_xim=$enableval
306     fi])
307    
308     AC_ARG_ENABLE(backspace-key,
309     [ --disable-backspace-key disable handling of the backspace key],
310     [if test x$enableval = xno; then
311     AC_DEFINE(NO_BACKSPACE_KEY, 1, Define if you don't want support for the backspace key)
312     fi])
313    
314     AC_ARG_ENABLE(delete-key,
315     [ --disable-delete-key disable handling of the delete key],
316     [if test x$enableval = xno; then
317     AC_DEFINE(NO_DELETE_KEY, 1, Define if you don't want support for the (non-keypad) delete key)
318     fi])
319    
320     AC_ARG_ENABLE(resources,
321     [ --disable-resources disable all resource checking],
322     [if test x$enableval = xno; then
323     AC_DEFINE(NO_RESOURCES, 1, Define if you don't want any resources read)
324     fi])
325    
326     AC_ARG_ENABLE(8bitctrls,
327     [ --enable-8bitctrls enable 8 bit control sequences (not recommended)],
328     [if test x$enableval = xyes -o x$enableval = xno; then
329     support_8bitctrls=$enableval
330     fi])
331    
332     RESFALLBACK=Rxvt
333     AC_ARG_ENABLE(fallback,
334 ayin 1.77 [ --enable-fallback@<:@=CLASS@:>@ fall back on CLASS resources in addition to URxvt ones (default: Rxvt)],
335 ayin 1.1 [
336     test x$enableval = xyes && enableval=Rxvt
337     test x$enableval = xno && enableval=
338     RESFALLBACK="$enableval"
339     ])
340    
341     if test x$RESFALLBACK != x; then
342     AC_DEFINE_UNQUOTED(RESFALLBACK, "$RESFALLBACK", [Fallback resource class])
343     fi
344    
345     RESNAME=urxvt
346     AC_ARG_WITH(res-name,
347     [ --with-res-name=NAME use this as default resource name (default: urxvt)],
348     [RESNAME="$withval"])
349     AC_DEFINE_UNQUOTED(RESNAME,"$RESNAME", [Default resource name])
350    
351     RESCLASS=URxvt
352     AC_ARG_WITH(res-class,
353     [ --with-res-class=CLASS use this as the resource class (default: URxvt)],
354     [RESCLASS="$withval"])
355     AC_DEFINE_UNQUOTED(RESCLASS,"$RESCLASS", [Resource class])
356    
357     RXVTNAME=urxvt
358     AC_ARG_WITH(name,
359     [ --with-name=NAME set the basename for the installed binaries (default: urxvt)],
360     [RXVTNAME="$withval"])
361     AC_DEFINE_UNQUOTED(RXVTNAME,"$RXVTNAME", [Binary base name])
362    
363     AC_SUBST(RXVTNAME)
364    
365     AC_ARG_ENABLE(swapscreen,
366     [ --disable-swapscreen disable swap screen support],
367     [if test x$enableval = xno; then
368     AC_DEFINE(NO_SECONDARY_SCREEN, 1, Disable the secondary screen. Many programs use the secondary screen as their workplace)
369     fi])
370    
371     AC_ARG_ENABLE(iso14755,
372     [ --enable-iso14755 enable support for extended ISO 14755 modes],
373     [if test x$enableval = xyes -o x$enableval = xno; then
374     support_iso14755=$enableval
375     fi])
376    
377     AC_ARG_ENABLE(frills,
378     [ --enable-frills enable support for rarely used features],
379     [if test x$enableval = xyes -o x$enableval = xno; then
380     support_frills=$enableval
381     fi])
382    
383     AC_ARG_ENABLE(keepscrolling,
384     [ --enable-keepscrolling enable continual scrolling on scrollbar arrow press],
385     [if test x$enableval = xyes -o x$enableval = xno; then
386     support_keepscrolling=$enableval
387     fi])
388    
389     AC_ARG_ENABLE(selectionscrolling,
390     [ --enable-selectionscrolling enable scrolling during selections],
391     [if test x$enableval = xyes -o x$enableval = xno; then
392     support_selectionscrolling=$enableval
393     fi])
394    
395     AC_ARG_ENABLE(mousewheel,
396     [ --enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5],
397     [if test x$enableval = xyes -o x$enableval = xno; then
398     support_mousewheel=$enableval
399     fi])
400    
401     AC_ARG_ENABLE(slipwheeling,
402 ayin 1.77 [ --enable-slipwheeling enable slip wheel scrolling (requires --enable-mousewheel)],
403 ayin 1.1 [if test x$enableval = xyes -o x$enableval = xno; then
404     support_mouseslipwheel=$enableval
405     fi])
406    
407     AC_ARG_ENABLE(smart-resize,
408     [ --enable-smart-resize enable smart growth/shrink behaviour],
409     [if test x$enableval = xyes; then
410     AC_DEFINE(SMART_RESIZE, 1, Define to use "smart" resize behavior)
411     fi])
412    
413     AC_ARG_ENABLE(text-blink,
414     [ --enable-text-blink enable blinking text],
415     [if test x$enableval = xyes -o x$enableval = xno; then
416     support_text_blink=$enableval
417     fi])
418    
419     AC_ARG_ENABLE(pointer-blank,
420 sf-exg 1.108 [ --enable-pointer-blank enable pointer blanking when typing or inactive],
421 ayin 1.1 [if test x$enableval = xyes -o x$enableval = xno; then
422     support_pointer_blank=$enableval
423     fi])
424    
425     AC_ARG_WITH(term,
426     [ --with-term=NAME set the terminal to NAME (default: rxvt)],
427     [if test x$withval != x; then
428     AC_DEFINE_UNQUOTED(TERMENV, "$withval",Set TERM to the value given by configure) term="$withval"
429     fi])
430    
431     AC_ARG_WITH(terminfo,
432     [ --with-terminfo=PATH set the path to the terminfo tree to PATH],
433     [if test x$withval != x; then
434     AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval"
435     fi])
436    
437     dnl# --------------------------------------------------------------------------
438    
439 root 1.84 LIBEV_M4_AVOID_LIBRT=1
440 root 1.82 m4_include([libev/libev.m4])
441    
442     dnl# --------------------------------------------------------------------------
443    
444 ayin 1.76 AC_PATH_PROG(TIC, tic, :)
445 ayin 1.1
446     AC_PATH_XTRA
447    
448 sf-exg 1.119 image_lib=none
449    
450 sf-exg 1.115 PIXBUF_CFLAGS=
451     PIXBUF_LIBS=
452    
453     if test x$support_pixbuf = xyes; then
454     support_pixbuf=no
455     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
456     AC_MSG_CHECKING(for gdk-pixbuf)
457 sf-exg 1.122 if test $PKG_CONFIG != no && $PKG_CONFIG --exists gdk-pixbuf-2.0; then
458     PIXBUF_CFLAGS="`$PKG_CONFIG gdk-pixbuf-2.0 --cflags`"
459     PIXBUF_LIBS="`$PKG_CONFIG gdk-pixbuf-2.0 --libs`"
460 sf-exg 1.115 support_pixbuf=yes
461     fi
462    
463     if test x$support_pixbuf = xyes; then
464     AC_MSG_RESULT(ok)
465 sf-exg 1.119 image_lib=gdk-pixbuf
466 sf-exg 1.115 support_afterimage=no
467     AC_DEFINE(HAVE_PIXBUF, 1, Define if you want to use gdk-pixbuf for image processing)
468     AC_DEFINE(BG_IMAGE_FROM_FILE, 1, Define if you want to have sexy-looking background pixmaps.)
469     else
470     AC_MSG_RESULT(no)
471     fi
472     fi
473    
474     AC_SUBST(PIXBUF_CFLAGS)
475     AC_SUBST(PIXBUF_LIBS)
476    
477 mikachu 1.130 STARTUP_NOTIFICATION_CFLAGS=
478     STARTUP_NOTIFICATION_LIBS=
479    
480     if test x$support_startup_notification = xyes; then
481     support_startup_notification=no
482     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
483     AC_MSG_CHECKING(for libstartup-notification)
484     if test $PKG_CONFIG != no && $PKG_CONFIG --exists libstartup-notification-1.0; then
485     STARTUP_NOTIFICATION_CFLAGS="`$PKG_CONFIG libstartup-notification-1.0 --cflags`"
486     STARTUP_NOTIFICATION_LIBS="`$PKG_CONFIG libstartup-notification-1.0 --libs`"
487     support_startup_notification=yes
488     fi
489    
490     if test x$support_startup_notification = xyes; then
491     AC_MSG_RESULT(ok)
492     AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, Define if freedesktop startup notifications should be supported)
493     else
494     AC_MSG_RESULT(no)
495     fi
496     fi
497    
498     AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
499     AC_SUBST(STARTUP_NOTIFICATION_LIBS)
500    
501 ayin 1.65 AFTERIMAGE_CFLAGS=
502 sasha 1.39 AFTERIMAGE_LIBS=
503 sasha 1.62 AFTERIMAGE_VERSION=
504 sasha 1.39
505 ayin 1.44 if test x$support_afterimage = xyes; then
506 ayin 1.42 support_afterimage=no
507 root 1.45
508 ayin 1.46 if test "x$afterimage_config" = "x" ; then
509 ayin 1.43 AC_PATH_PROG(afterimage_config, afterimage-config, no)
510 ayin 1.42 fi
511 root 1.69 if test "x$afterimage_config" != "xno" ; then
512     AC_MSG_CHECKING(for libAfterImage version >= 1.15)
513     xAFTERIMAGE_VERSION=`$afterimage_config --version`
514     if test -n "$xAFTERIMAGE_VERSION" ; then
515     xAFTERIMAGE_CFLAGS=`$afterimage_config --cflags`
516     xAFTERIMAGE_LIBS=`$afterimage_config --libs`
517     if test "x$xAFTERIMAGE_LIBS" != "x"; then
518     libai_ver_major=`echo $xAFTERIMAGE_VERSION | cut -f 1 -d .`
519     libai_ver_minor=`echo $xAFTERIMAGE_VERSION | cut -f 2 -d .`
520     if test $libai_ver_major -gt 1 -o \( $libai_ver_major -eq 1 -a $libai_ver_minor -ge 15 \); then
521     support_afterimage=yes
522     AFTERIMAGE_CFLAGS="$xAFTERIMAGE_CFLAGS"
523     AFTERIMAGE_LIBS="$xAFTERIMAGE_LIBS"
524     AFTERIMAGE_VERSION="$xAFTERIMAGE_VERSION"
525     fi
526 sasha 1.62 fi
527 ayin 1.42 fi
528 root 1.69 if test "x$support_afterimage" = "xyes"; then
529     AC_MSG_RESULT($AFTERIMAGE_LIBS)
530 sf-exg 1.119 image_lib=libafterimage
531 sf-exg 1.114 AC_DEFINE(HAVE_AFTERIMAGE, 1, Define if you want to use libAfterImage for image processing)
532     AC_DEFINE(BG_IMAGE_FROM_FILE, 1, Define if you want to have sexy-looking background pixmaps.)
533 root 1.69 else
534     AC_MSG_RESULT(no)
535     fi
536 ayin 1.42 fi
537 sasha 1.39 fi
538    
539 sf-exg 1.114 AC_SUBST(AFTERIMAGE_CFLAGS)
540     AC_SUBST(AFTERIMAGE_LIBS)
541    
542 ayin 1.1 dnl# --------------------------------------------------------------------------
543     dnl# CHECKING FOR HEADER FILES
544     dnl# --------------------------------------------------------------------------
545     AC_CHECK_HEADERS( \
546 sf-exg 1.124 sys/byteorder.h \
547 ayin 1.1 sys/ioctl.h \
548     sys/sockio.h \
549     sys/strredir.h \
550 ayin 1.14 stdint.h \
551     wchar.h \
552     cwchar \
553 ayin 1.1 )
554    
555 sf-exg 1.107 AC_CACHE_CHECK([for XLIB_ILLEGAL_ACCESS], rxvt_cv_xlib_illegal_access,
556 root 1.35 [AC_COMPILE_IFELSE(
557     [AC_LANG_PROGRAM([
558     #define XLIB_ILLEGAL_ACCESS
559     #include <X11/Xlib.h>
560     ],[
561     Display *dpy;
562     dpy->xdefaults = (char *)0;
563     ])],
564 sf-exg 1.107 [rxvt_cv_xlib_illegal_access=yes],[rxvt_cv_xlib_illegal_access=no]
565 root 1.35 )])
566 sf-exg 1.107 if test x$rxvt_cv_xlib_illegal_access = xyes; then
567 root 1.35 AC_DEFINE(XLIB_ILLEGAL_ACCESS, 1, Define ONLY iff Xlib.h supports it)
568     fi
569 ayin 1.1
570     dnl# --------------------------------------------------------------------------
571     dnl# CHECKING FOR MISSING TYPEDEFS
572     dnl# --------------------------------------------------------------------------
573     dnl# Missing typedefs and replacements
574     AC_TYPE_MODE_T
575     AC_TYPE_PID_T
576     AC_TYPE_UID_T
577 ayin 1.97 AC_TYPE_INT16_T
578     AC_TYPE_UINT16_T
579     AC_TYPE_INT32_T
580     AC_TYPE_UINT32_T
581 ayin 1.1
582     dnl# --------------------------------------------------------------------------
583     dnl# CHECKING FOR LIBRARY FUNCTIONS
584     dnl# --------------------------------------------------------------------------
585 ayin 1.80 AC_CHECK_FUNCS(unsetenv)
586 ayin 1.1
587 ayin 1.15 UTMP_CHECK
588 ayin 1.1
589     dnl# --------------------------------------------------------------------------
590    
591     dnl# --------------------------------------------------------------------------
592     dnl# --------------------------------------------------------------------------
593    
594     dnl# this is a really hack test for some basic Xlocale stuff
595 ayin 1.79 save_LIBS=$LIBS
596     save_CFLAGS=$CFLAGS
597 ayin 1.1 CFLAGS="$CFLAGS $X_CFLAGS"
598     LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
599 ayin 1.54 if test x$support_xim = xyes; then
600 ayin 1.74 AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale,
601 sf-exg 1.129 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
602     #include <X11/Xlib.h>
603 ayin 1.74 #include <stdlib.h>
604 sf-exg 1.128 int main() {
605 sf-exg 1.129 char *p;
606     if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
607     exit (XSupportsLocale() ? 0 : 1);
608     else
609     exit (1);
610     }
611     ]])],[rxvt_cv_func_xlocale=yes],[rxvt_cv_func_xlocale=no],[:])])
612 ayin 1.54 if test x$rxvt_cv_func_xlocale = xyes; then
613     AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input)
614 sf-exg 1.107 AC_CACHE_CHECK(for broken XIM callback, rxvt_cv_broken_ximcb,
615 sf-exg 1.127 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
616 ayin 1.74 #include <X11/Xlib.h>
617    
618     void im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3);
619    
620     void f() {
621     XIMCallback cb;
622     cb.callback = im_destroy_cb;
623     }
624 sf-exg 1.127 ]])],rxvt_cv_broken_ximcb=yes,rxvt_cv_broken_ximcb=no)])
625 ayin 1.74
626 sf-exg 1.107 if test x$rxvt_cv_broken_ximcb = xyes; then
627 ayin 1.74 AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.)
628     fi
629 ayin 1.54 fi
630     fi
631 ayin 1.1
632     AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale,
633     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define X_LOCALE 1
634     #include <X11/Xlocale.h>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_xsetlocale=yes],[rxvt_cv_func_xsetlocale=no])])
635     if test x$rxvt_cv_func_xsetlocale = xyes; then
636     AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works)
637     fi
638 ayin 1.79 LIBS=$save_LIBS
639     CFLAGS=$save_CFLAGS
640 ayin 1.1
641     AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale,
642     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <clocale>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_setlocale=yes],[rxvt_cv_func_setlocale=no])])
643     if test x$rxvt_cv_func_setlocale = xyes; then
644     AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works)
645     fi
646    
647     AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo,
648     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],[rxvt_cv_func_nl_langinfo=yes],[rxvt_cv_func_nl_langinfo=no])])
649     if test x$rxvt_cv_func_nl_langinfo = xyes; then
650     AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works)
651     fi
652    
653 ayin 1.19 SCM_RIGHTS_CHECK
654 ayin 1.1
655 ayin 1.15 PTY_CHECK
656 ayin 1.1
657 ayin 1.23 TTY_GROUP_CHECK
658    
659 ayin 1.1 dnl# --------------------------------------------------------------------------
660     dnl# now add and remove other stuff
661     dnl# --------------------------------------------------------------------------
662 sf-exg 1.121 if test x$support_xft = xyes || test x$support_inheritpixmap = xyes; then
663     rxvt_have_xrender=no
664     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
665     if test $PKG_CONFIG != no && $PKG_CONFIG --exists xrender; then
666     X_LIBS="`$PKG_CONFIG xrender --libs` $X_LIBS"
667     CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xrender --cflags`"
668     rxvt_have_xrender=yes
669    
670     save_LIBS="$LIBS"
671     LIBS="$LIBS $X_LIBS"
672     AC_CHECK_HEADER(X11/extensions/Xrender.h,,[rxvt_have_xrender=no])
673     AC_CHECK_FUNC(XRenderFindStandardFormat,,[rxvt_have_xrender=no])
674     LIBS="$save_LIBS"
675     fi
676     fi
677    
678     if test x$support_xft = xyes && test x$rxvt_have_xrender = xyes; then
679 ayin 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
680     if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then
681 root 1.83 X_LIBS="`$PKG_CONFIG xft --libs` $X_LIBS"
682 ayin 1.18 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`"
683     else
684 ayin 1.22 AC_PATH_PROG(XFT_CONFIG, xft-config, no)
685 ayin 1.18 if test $XFT_CONFIG != no; then
686 root 1.83 X_LIBS="`$XFT_CONFIG --libs` $X_LIBS"
687 ayin 1.18 CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`"
688     fi
689     fi
690 ayin 1.1
691 sf-exg 1.121 if test $PKG_CONFIG != no && $PKG_CONFIG --exists fontconfig; then
692     X_LIBS="`$PKG_CONFIG fontconfig --libs` $X_LIBS"
693     CPPFLAGS="$CPPFLAGS `$PKG_CONFIG fontconfig --cflags`"
694     fi
695    
696 root 1.83 save_LIBS="$LIBS"
697     LIBS="$LIBS $X_LIBS"
698 ayin 1.1 AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no])
699 root 1.83 AC_CHECK_LIB(Xft,XftDrawString32,:,[support_xft=no])
700 sf-exg 1.121 AC_CHECK_HEADERS(fontconfig/fontconfig.h,,[support_xft=no])
701     AC_CHECK_LIB(fontconfig,FcPatternGet,:,[support_xft=no])
702 root 1.83 LIBS="$save_LIBS"
703 ayin 1.1
704     if test x$support_xft = xyes; then
705     AC_DEFINE(XFT, 1, Define to enable xft support)
706     fi
707     fi
708     if test x$support_styles = xyes; then
709     AC_DEFINE(ENABLE_STYLES, 1, Define if you want bold and italic support)
710     fi
711     if test x$support_iso14755 = xyes; then
712     AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support)
713     fi
714     if test x$support_8bitctrls = xyes; then
715     AC_DEFINE(EIGHT_BIT_CONTROLS, 1, Define if you want 8 bit control sequences)
716     fi
717     if test x$support_fading = xyes; then
718     AC_DEFINE(OFF_FOCUS_FADING, 1, Define if you want faded colors when focus is lost)
719     fi
720     if test x$support_inheritpixmap = xyes; then
721 sf-exg 1.121 if test x$rxvt_have_xrender = xyes; then
722     LIBS="$LIBS -lm"
723     AC_DEFINE(XRENDER, 1, Define to enable xrender support)
724     fi
725 root 1.56 AC_DEFINE(ENABLE_TRANSPARENCY, 1, Define if you want your background to use the parent window background)
726 ayin 1.1 fi
727     if test x$support_keepscrolling = xno; then
728     AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING, 1, Define for continual scrolling when you keep the scrollbar button pressed)
729     fi
730     if test x$support_selectionscrolling = xyes; then
731     AC_DEFINE(SELECTION_SCROLLING, 1, Define to allow scrolling when the selection moves to the top or bottom of the screen)
732     fi
733 ayin 1.73 if test x$support_frills = xyes; then
734     AC_DEFINE(ENABLE_FRILLS, 1, Define if you want handling for rarely used but handy features)
735     fi
736 ayin 1.1 if test x$support_mousewheel = xyes; then
737     AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll)
738     fi
739     if test x$support_mouseslipwheel = xyes; then
740     AC_DEFINE(MOUSE_SLIP_WHEELING, 1, Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling)
741     fi
742 sasha 1.39
743 ayin 1.105 scrolltypes=plain
744     AC_DEFINE(PLAIN_SCROLLBAR, 1, Support plain style scrollbars)
745    
746 ayin 1.1 if test x$support_scroll_rxvt = xyes; then
747     AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars)
748 ayin 1.105 scrolltypes="$scrolltypes rxvt"
749 ayin 1.1 fi
750     if test x$support_scroll_next = xyes; then
751     AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars)
752     scrolltypes="$scrolltypes next"
753     fi
754     if test x$support_scroll_xterm = xyes; then
755     AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars)
756     scrolltypes="$scrolltypes xterm"
757     fi
758     if test x$support_pointer_blank = xyes; then
759 sf-exg 1.117 AC_DEFINE(POINTER_BLANK, 1, Define if you want to hide the pointer while typing)
760 ayin 1.1 fi
761     if test x$support_text_blink = xyes; then
762     AC_DEFINE(TEXT_BLINK, 1, Define if you want blinking text support)
763     fi
764     if test x$support_unicode3 = xyes; then
765     AC_DEFINE(UNICODE_3, 1, Define if you want to represent unicode characters outside plane 0)
766     fi
767     if test x$support_combining = xyes; then
768     AC_DEFINE(ENABLE_COMBINING, 1, Define if you want to automatically compose combining characters)
769     fi
770     if test x$codesets = xall; then
771     codesets=jp,jp-ext,kr,zh,zh-ext
772     fi
773     AC_DEFINE(ENCODING_EU, 1, Define if you want european extended codesets)
774     AC_DEFINE(ENCODING_VN, 1, Define if you want vietnamese codesets)
775     for codeset in `echo $codesets | tr "[a-z,\\-]" "[A-Z _]"`; do
776     case "$codeset" in
777     JP ) AC_DEFINE(ENCODING_JP, 1, Define if you want japanese codesets) ;;
778     JP_EXT ) AC_DEFINE(ENCODING_JP_EXT, 1, Define if you want extended japanese codesets) ;;
779     KR ) AC_DEFINE(ENCODING_KR, 1, Define if you want korean codesets) ;;
780     ZH ) AC_DEFINE(ENCODING_ZH, 1, Define if you want chinese codesets) ;;
781     ZH_EXT ) AC_DEFINE(ENCODING_ZH_EXT, 1, Define if you want extended chinese codesets) ;;
782     esac
783     done
784    
785     IF_PERL=\#
786     if test x$support_perl = xyes; then
787     AC_PATH_PROG(PERL, perl5)
788     AC_PATH_PROG(PERL, perl)
789    
790     AC_MSG_CHECKING(for $PERL suitability)
791     if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>/dev/null; then
792    
793     save_CXXFLAGS="$CXXFLAGS"
794     save_LIBS="$LIBS"
795     CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts`"
796     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
797 root 1.100 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
798 ayin 1.1 #include <EXTERN.h>
799     #include <perl.h>
800     #include <XSUB.h>
801 root 1.100 ]], [[
802 ayin 1.1 PerlInterpreter *perl = perl_alloc ();
803 root 1.100 ]])],[rxvt_perl_link=yes],[rxvt_perl_link=no])
804 ayin 1.1 CXXFLAGS="$save_CXXFLAGS"
805     LIBS="$save_LIBS"
806    
807     if test x$rxvt_perl_link = xyes; then
808     AC_MSG_RESULT(ok)
809     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
810     IF_PERL=
811     PERL_O=rxvtperl.o
812     PERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
813     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
814     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
815     else
816 root 1.63 AC_MSG_ERROR([no, unable to link])
817 ayin 1.1 fi
818     else
819 root 1.63 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
820 ayin 1.1 fi
821     fi
822     AC_SUBST(PERLLIB)
823     AC_SUBST(PERLFLAGS)
824     AC_SUBST(PERLPRIVLIBEXP)
825     AC_SUBST(PERL)
826     AC_SUBST(IF_PERL)
827     AC_SUBST(PERL_O)
828    
829    
830     AC_CONFIG_FILES([Makefile \
831     doc/Makefile \
832     src/Makefile \
833     ])
834     AC_OUTPUT
835    
836     echo "Configuration:
837    
838     Rxvt version: $VERSION : $DATE
839     Source code location: $srcdir
840     Install path: ${prefix}/bin
841     Compiler: $CXX
842 root 1.36 Compiler flags: $CXXFLAGS
843 ayin 1.1 Linker: $LINKER"
844    
845     if test x$term != x; then
846     echo " set TERM to: $term"
847     fi
848     if test x$terminfo != x; then
849     echo " set TERMINFO to: $terminfo"
850     fi
851     echo " default resource name: $RESNAME"
852     echo " resource class: $RESCLASS"
853     if test x$RESFALLBACK != x; then
854     echo " resource class fallback: $RESFALLBACK"
855     fi
856     echo
857 root 1.20 echo " embedded perl: $support_perl"
858 sf-exg 1.119 echo " image library: $image_lib"
859 root 1.20 echo
860 ayin 1.1 if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then
861     echo ".----------------------------------------------------------------."
862     echo ". WARNING: --enable-xim was specified however the locale support ."
863     echo ". functions could not be found. ."
864     echo ". XIM is now being DISABLED! ."
865     echo ".----------------------------------------------------------------."
866     fi
867    
868 root 1.32 echo "*** Optionally check src/feature.h for further, rarely used options ***"
869 ayin 1.1 echo
870