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