ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.157
Committed: Fri Jul 23 19:18:52 2021 UTC (2 years, 9 months ago) by sf-exg
Branch: MAIN
Changes since 1.156: +7 -8 lines
Log Message:
Unbundle libptytty

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