ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.137
Committed: Thu Jan 19 11:08:19 2012 UTC (12 years, 5 months ago) by sf-exg
Branch: MAIN
Changes since 1.136: +0 -6 lines
Log Message:
Remove check that is now provided by ptytty.m4.

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