ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.141
Committed: Sat Feb 4 21:47:06 2012 UTC (12 years, 3 months ago) by sf-exg
Branch: MAIN
Changes since 1.140: +0 -52 lines
Log Message:
Remove deprecated libAfterImage image backend.

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