ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.161
Committed: Fri Dec 30 16:51:59 2022 UTC (16 months, 2 weeks ago) by root
Branch: MAIN
Changes since 1.160: +2 -1 lines
Log Message:
*** empty log message ***

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