ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/rxvt-unicode/configure.ac
Revision: 1.131
Committed: Tue Dec 13 19:13:27 2011 UTC (12 years, 7 months ago) by sf-exg
Branch: MAIN
Changes since 1.130: +9 -11 lines
Log Message:
Simplify.

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    
504 ayin 1.44 if test x$support_afterimage = xyes; then
505 ayin 1.42 support_afterimage=no
506 root 1.45
507 ayin 1.46 if test "x$afterimage_config" = "x" ; then
508 ayin 1.43 AC_PATH_PROG(afterimage_config, afterimage-config, no)
509 ayin 1.42 fi
510 root 1.69 if test "x$afterimage_config" != "xno" ; then
511     AC_MSG_CHECKING(for libAfterImage version >= 1.15)
512 sf-exg 1.131 AFTERIMAGE_VERSION=`$afterimage_config --version`
513     if test -n "$AFTERIMAGE_VERSION" ; then
514     AFTERIMAGE_CFLAGS=`$afterimage_config --cflags`
515     AFTERIMAGE_LIBS=`$afterimage_config --libs`
516     if test "x$AFTERIMAGE_LIBS" != "x"; then
517     libai_ver_major=`echo $AFTERIMAGE_VERSION | cut -f 1 -d .`
518     libai_ver_minor=`echo $AFTERIMAGE_VERSION | cut -f 2 -d .`
519 root 1.69 if test $libai_ver_major -gt 1 -o \( $libai_ver_major -eq 1 -a $libai_ver_minor -ge 15 \); then
520     support_afterimage=yes
521     fi
522 sasha 1.62 fi
523 ayin 1.42 fi
524 root 1.69 if test "x$support_afterimage" = "xyes"; then
525     AC_MSG_RESULT($AFTERIMAGE_LIBS)
526 sf-exg 1.119 image_lib=libafterimage
527 sf-exg 1.114 AC_DEFINE(HAVE_AFTERIMAGE, 1, Define if you want to use libAfterImage for image processing)
528     AC_DEFINE(BG_IMAGE_FROM_FILE, 1, Define if you want to have sexy-looking background pixmaps.)
529 root 1.69 else
530     AC_MSG_RESULT(no)
531 sf-exg 1.131 AFTERIMAGE_CFLAGS=
532     AFTERIMAGE_LIBS=
533 root 1.69 fi
534 ayin 1.42 fi
535 sasha 1.39 fi
536    
537 sf-exg 1.114 AC_SUBST(AFTERIMAGE_CFLAGS)
538     AC_SUBST(AFTERIMAGE_LIBS)
539    
540 ayin 1.1 dnl# --------------------------------------------------------------------------
541     dnl# CHECKING FOR HEADER FILES
542     dnl# --------------------------------------------------------------------------
543     AC_CHECK_HEADERS( \
544 sf-exg 1.124 sys/byteorder.h \
545 ayin 1.1 sys/ioctl.h \
546     sys/sockio.h \
547     sys/strredir.h \
548 ayin 1.14 stdint.h \
549     wchar.h \
550     cwchar \
551 ayin 1.1 )
552    
553 sf-exg 1.107 AC_CACHE_CHECK([for XLIB_ILLEGAL_ACCESS], rxvt_cv_xlib_illegal_access,
554 root 1.35 [AC_COMPILE_IFELSE(
555     [AC_LANG_PROGRAM([
556     #define XLIB_ILLEGAL_ACCESS
557     #include <X11/Xlib.h>
558     ],[
559     Display *dpy;
560     dpy->xdefaults = (char *)0;
561     ])],
562 sf-exg 1.107 [rxvt_cv_xlib_illegal_access=yes],[rxvt_cv_xlib_illegal_access=no]
563 root 1.35 )])
564 sf-exg 1.107 if test x$rxvt_cv_xlib_illegal_access = xyes; then
565 root 1.35 AC_DEFINE(XLIB_ILLEGAL_ACCESS, 1, Define ONLY iff Xlib.h supports it)
566     fi
567 ayin 1.1
568     dnl# --------------------------------------------------------------------------
569     dnl# CHECKING FOR MISSING TYPEDEFS
570     dnl# --------------------------------------------------------------------------
571     dnl# Missing typedefs and replacements
572     AC_TYPE_MODE_T
573     AC_TYPE_PID_T
574     AC_TYPE_UID_T
575 ayin 1.97 AC_TYPE_INT16_T
576     AC_TYPE_UINT16_T
577     AC_TYPE_INT32_T
578     AC_TYPE_UINT32_T
579 ayin 1.1
580     dnl# --------------------------------------------------------------------------
581     dnl# CHECKING FOR LIBRARY FUNCTIONS
582     dnl# --------------------------------------------------------------------------
583 ayin 1.80 AC_CHECK_FUNCS(unsetenv)
584 ayin 1.1
585 ayin 1.15 UTMP_CHECK
586 ayin 1.1
587     dnl# --------------------------------------------------------------------------
588    
589     dnl# --------------------------------------------------------------------------
590     dnl# --------------------------------------------------------------------------
591    
592     dnl# this is a really hack test for some basic Xlocale stuff
593 ayin 1.79 save_LIBS=$LIBS
594     save_CFLAGS=$CFLAGS
595 ayin 1.1 CFLAGS="$CFLAGS $X_CFLAGS"
596     LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
597 ayin 1.54 if test x$support_xim = xyes; then
598 ayin 1.74 AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale,
599 sf-exg 1.129 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
600     #include <X11/Xlib.h>
601 ayin 1.74 #include <stdlib.h>
602 sf-exg 1.128 int main() {
603 sf-exg 1.129 char *p;
604     if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
605     exit (XSupportsLocale() ? 0 : 1);
606     else
607     exit (1);
608     }
609     ]])],[rxvt_cv_func_xlocale=yes],[rxvt_cv_func_xlocale=no],[:])])
610 ayin 1.54 if test x$rxvt_cv_func_xlocale = xyes; then
611     AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input)
612 sf-exg 1.107 AC_CACHE_CHECK(for broken XIM callback, rxvt_cv_broken_ximcb,
613 sf-exg 1.127 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
614 ayin 1.74 #include <X11/Xlib.h>
615    
616     void im_destroy_cb (XIC unused1, XPointer client_data, XPointer unused3);
617    
618     void f() {
619     XIMCallback cb;
620     cb.callback = im_destroy_cb;
621     }
622 sf-exg 1.127 ]])],rxvt_cv_broken_ximcb=yes,rxvt_cv_broken_ximcb=no)])
623 ayin 1.74
624 sf-exg 1.107 if test x$rxvt_cv_broken_ximcb = xyes; then
625 ayin 1.74 AC_DEFINE(XIMCB_PROTO_BROKEN, 1, Define if your XIMCallback specifies XIC as first type.)
626     fi
627 ayin 1.54 fi
628     fi
629 ayin 1.1
630     AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale,
631     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define X_LOCALE 1
632     #include <X11/Xlocale.h>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_xsetlocale=yes],[rxvt_cv_func_xsetlocale=no])])
633     if test x$rxvt_cv_func_xsetlocale = xyes; then
634     AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works)
635     fi
636 ayin 1.79 LIBS=$save_LIBS
637     CFLAGS=$save_CFLAGS
638 ayin 1.1
639     AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale,
640     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <clocale>]], [[setlocale(LC_CTYPE, "");]])],[rxvt_cv_func_setlocale=yes],[rxvt_cv_func_setlocale=no])])
641     if test x$rxvt_cv_func_setlocale = xyes; then
642     AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works)
643     fi
644    
645     AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo,
646     [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(CODESET);]])],[rxvt_cv_func_nl_langinfo=yes],[rxvt_cv_func_nl_langinfo=no])])
647     if test x$rxvt_cv_func_nl_langinfo = xyes; then
648     AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works)
649     fi
650    
651 ayin 1.19 SCM_RIGHTS_CHECK
652 ayin 1.1
653 ayin 1.15 PTY_CHECK
654 ayin 1.1
655 ayin 1.23 TTY_GROUP_CHECK
656    
657 ayin 1.1 dnl# --------------------------------------------------------------------------
658     dnl# now add and remove other stuff
659     dnl# --------------------------------------------------------------------------
660 sf-exg 1.121 if test x$support_xft = xyes || test x$support_inheritpixmap = xyes; then
661     rxvt_have_xrender=no
662     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
663     if test $PKG_CONFIG != no && $PKG_CONFIG --exists xrender; then
664     X_LIBS="`$PKG_CONFIG xrender --libs` $X_LIBS"
665     CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xrender --cflags`"
666     rxvt_have_xrender=yes
667    
668     save_LIBS="$LIBS"
669     LIBS="$LIBS $X_LIBS"
670     AC_CHECK_HEADER(X11/extensions/Xrender.h,,[rxvt_have_xrender=no])
671     AC_CHECK_FUNC(XRenderFindStandardFormat,,[rxvt_have_xrender=no])
672     LIBS="$save_LIBS"
673     fi
674     fi
675    
676     if test x$support_xft = xyes && test x$rxvt_have_xrender = xyes; then
677 ayin 1.18 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
678     if test $PKG_CONFIG != no && $PKG_CONFIG --exists xft; then
679 root 1.83 X_LIBS="`$PKG_CONFIG xft --libs` $X_LIBS"
680 ayin 1.18 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG xft --cflags`"
681     else
682 ayin 1.22 AC_PATH_PROG(XFT_CONFIG, xft-config, no)
683 ayin 1.18 if test $XFT_CONFIG != no; then
684 root 1.83 X_LIBS="`$XFT_CONFIG --libs` $X_LIBS"
685 ayin 1.18 CPPFLAGS="$CPPFLAGS `$XFT_CONFIG --cflags`"
686     fi
687     fi
688 ayin 1.1
689 sf-exg 1.121 if test $PKG_CONFIG != no && $PKG_CONFIG --exists fontconfig; then
690     X_LIBS="`$PKG_CONFIG fontconfig --libs` $X_LIBS"
691     CPPFLAGS="$CPPFLAGS `$PKG_CONFIG fontconfig --cflags`"
692     fi
693    
694 root 1.83 save_LIBS="$LIBS"
695     LIBS="$LIBS $X_LIBS"
696 ayin 1.1 AC_CHECK_HEADERS(X11/Xft/Xft.h,,[support_xft=no])
697 root 1.83 AC_CHECK_LIB(Xft,XftDrawString32,:,[support_xft=no])
698 sf-exg 1.121 AC_CHECK_HEADERS(fontconfig/fontconfig.h,,[support_xft=no])
699     AC_CHECK_LIB(fontconfig,FcPatternGet,:,[support_xft=no])
700 root 1.83 LIBS="$save_LIBS"
701 ayin 1.1
702     if test x$support_xft = xyes; then
703     AC_DEFINE(XFT, 1, Define to enable xft support)
704     fi
705     fi
706     if test x$support_styles = xyes; then
707     AC_DEFINE(ENABLE_STYLES, 1, Define if you want bold and italic support)
708     fi
709     if test x$support_iso14755 = xyes; then
710     AC_DEFINE(ISO_14755, 1, Define if you want ISO 14755 extended support)
711     fi
712     if test x$support_8bitctrls = xyes; then
713     AC_DEFINE(EIGHT_BIT_CONTROLS, 1, Define if you want 8 bit control sequences)
714     fi
715     if test x$support_fading = xyes; then
716     AC_DEFINE(OFF_FOCUS_FADING, 1, Define if you want faded colors when focus is lost)
717     fi
718     if test x$support_inheritpixmap = xyes; then
719 sf-exg 1.121 if test x$rxvt_have_xrender = xyes; then
720     LIBS="$LIBS -lm"
721     AC_DEFINE(XRENDER, 1, Define to enable xrender support)
722     fi
723 root 1.56 AC_DEFINE(ENABLE_TRANSPARENCY, 1, Define if you want your background to use the parent window background)
724 ayin 1.1 fi
725     if test x$support_keepscrolling = xno; then
726     AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING, 1, Define for continual scrolling when you keep the scrollbar button pressed)
727     fi
728     if test x$support_selectionscrolling = xyes; then
729     AC_DEFINE(SELECTION_SCROLLING, 1, Define to allow scrolling when the selection moves to the top or bottom of the screen)
730     fi
731 ayin 1.73 if test x$support_frills = xyes; then
732     AC_DEFINE(ENABLE_FRILLS, 1, Define if you want handling for rarely used but handy features)
733     fi
734 ayin 1.1 if test x$support_mousewheel = xyes; then
735     AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll)
736     fi
737     if test x$support_mouseslipwheel = xyes; then
738     AC_DEFINE(MOUSE_SLIP_WHEELING, 1, Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling)
739     fi
740 sasha 1.39
741 ayin 1.105 scrolltypes=plain
742     AC_DEFINE(PLAIN_SCROLLBAR, 1, Support plain style scrollbars)
743    
744 ayin 1.1 if test x$support_scroll_rxvt = xyes; then
745     AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars)
746 ayin 1.105 scrolltypes="$scrolltypes rxvt"
747 ayin 1.1 fi
748     if test x$support_scroll_next = xyes; then
749     AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars)
750     scrolltypes="$scrolltypes next"
751     fi
752     if test x$support_scroll_xterm = xyes; then
753     AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars)
754     scrolltypes="$scrolltypes xterm"
755     fi
756     if test x$support_pointer_blank = xyes; then
757 sf-exg 1.117 AC_DEFINE(POINTER_BLANK, 1, Define if you want to hide the pointer while typing)
758 ayin 1.1 fi
759     if test x$support_text_blink = xyes; then
760     AC_DEFINE(TEXT_BLINK, 1, Define if you want blinking text support)
761     fi
762     if test x$support_unicode3 = xyes; then
763     AC_DEFINE(UNICODE_3, 1, Define if you want to represent unicode characters outside plane 0)
764     fi
765     if test x$support_combining = xyes; then
766     AC_DEFINE(ENABLE_COMBINING, 1, Define if you want to automatically compose combining characters)
767     fi
768     if test x$codesets = xall; then
769     codesets=jp,jp-ext,kr,zh,zh-ext
770     fi
771     AC_DEFINE(ENCODING_EU, 1, Define if you want european extended codesets)
772     AC_DEFINE(ENCODING_VN, 1, Define if you want vietnamese codesets)
773     for codeset in `echo $codesets | tr "[a-z,\\-]" "[A-Z _]"`; do
774     case "$codeset" in
775     JP ) AC_DEFINE(ENCODING_JP, 1, Define if you want japanese codesets) ;;
776     JP_EXT ) AC_DEFINE(ENCODING_JP_EXT, 1, Define if you want extended japanese codesets) ;;
777     KR ) AC_DEFINE(ENCODING_KR, 1, Define if you want korean codesets) ;;
778     ZH ) AC_DEFINE(ENCODING_ZH, 1, Define if you want chinese codesets) ;;
779     ZH_EXT ) AC_DEFINE(ENCODING_ZH_EXT, 1, Define if you want extended chinese codesets) ;;
780     esac
781     done
782    
783     IF_PERL=\#
784     if test x$support_perl = xyes; then
785     AC_PATH_PROG(PERL, perl5)
786     AC_PATH_PROG(PERL, perl)
787    
788     AC_MSG_CHECKING(for $PERL suitability)
789     if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>/dev/null; then
790    
791     save_CXXFLAGS="$CXXFLAGS"
792     save_LIBS="$LIBS"
793     CXXFLAGS="$CXXFLAGS `$PERL -MExtUtils::Embed -e ccopts`"
794     LIBS="$LIBS `$PERL -MExtUtils::Embed -e ldopts`"
795 root 1.100 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
796 ayin 1.1 #include <EXTERN.h>
797     #include <perl.h>
798     #include <XSUB.h>
799 root 1.100 ]], [[
800 ayin 1.1 PerlInterpreter *perl = perl_alloc ();
801 root 1.100 ]])],[rxvt_perl_link=yes],[rxvt_perl_link=no])
802 ayin 1.1 CXXFLAGS="$save_CXXFLAGS"
803     LIBS="$save_LIBS"
804    
805     if test x$rxvt_perl_link = xyes; then
806     AC_MSG_RESULT(ok)
807     AC_DEFINE(ENABLE_PERL, 1, Define if you can embed a perl interpreter)
808     IF_PERL=
809     PERL_O=rxvtperl.o
810     PERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
811     PERLLIB="`$PERL -MExtUtils::Embed -e ldopts`"
812     PERLPRIVLIBEXP="`$PERL -MConfig -e 'print $Config{privlibexp}'`"
813     else
814 root 1.63 AC_MSG_ERROR([no, unable to link])
815 ayin 1.1 fi
816     else
817 root 1.63 AC_MSG_ERROR([no working perl found, or perl not version >= 5.8])
818 ayin 1.1 fi
819     fi
820     AC_SUBST(PERLLIB)
821     AC_SUBST(PERLFLAGS)
822     AC_SUBST(PERLPRIVLIBEXP)
823     AC_SUBST(PERL)
824     AC_SUBST(IF_PERL)
825     AC_SUBST(PERL_O)
826    
827    
828     AC_CONFIG_FILES([Makefile \
829     doc/Makefile \
830     src/Makefile \
831     ])
832     AC_OUTPUT
833    
834     echo "Configuration:
835    
836     Rxvt version: $VERSION : $DATE
837     Source code location: $srcdir
838     Install path: ${prefix}/bin
839     Compiler: $CXX
840 root 1.36 Compiler flags: $CXXFLAGS
841 ayin 1.1 Linker: $LINKER"
842    
843     if test x$term != x; then
844     echo " set TERM to: $term"
845     fi
846     if test x$terminfo != x; then
847     echo " set TERMINFO to: $terminfo"
848     fi
849     echo " default resource name: $RESNAME"
850     echo " resource class: $RESCLASS"
851     if test x$RESFALLBACK != x; then
852     echo " resource class fallback: $RESFALLBACK"
853     fi
854     echo
855 root 1.20 echo " embedded perl: $support_perl"
856 sf-exg 1.119 echo " image library: $image_lib"
857 root 1.20 echo
858 ayin 1.1 if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then
859     echo ".----------------------------------------------------------------."
860     echo ". WARNING: --enable-xim was specified however the locale support ."
861     echo ". functions could not be found. ."
862     echo ". XIM is now being DISABLED! ."
863     echo ".----------------------------------------------------------------."
864     fi
865    
866 root 1.32 echo "*** Optionally check src/feature.h for further, rarely used options ***"
867 ayin 1.1 echo
868