ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/configure.ac
Revision: 1.139
Committed: Thu Jan 19 15:08:55 2012 UTC (12 years, 5 months ago) by sf-exg
Branch: MAIN
Changes since 1.138: +0 -6 lines
Log Message:
Remove check for setlocale, it is required.

File Contents

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