Bump version to V3.90.
[terminatorX.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([terminatorX], [3.90], [https://terminatorx.org/bugs/], [terminatorX])
3
4 AC_CONFIG_SRCDIR([src/tX_global.h])
5 AM_INIT_AUTOMAKE
6 AM_CONFIG_HEADER(config.h)
7
8 AC_ARG_ENABLE(sox,              [  --enable-sox            use sox as input converter. (default=auto) ])
9 AC_ARG_ENABLE(mpg123,           [  --enable-mpg123         use mpg123 as input converter. (default=auto) ])
10 AC_ARG_ENABLE(ogg123,           [  --enable-ogg123         use ogg123 as input converter. (default=auto) ])
11 AC_ARG_ENABLE(scheduler,        [  --enable-scheduler      enable rt-scheduling (default=auto) ])
12 AC_ARG_ENABLE(debug,            [  --enable-debug          enable debug output. (default=no) ])
13 dnl AC_ARG_ENABLE(benchmark     [  --enable-benchmark      creates a non-functional test version (default=no) ])
14 AC_ARG_ENABLE(wav,              [  --enable-wav            enables the built-in wav-loader (default=yes) ])
15 AC_ARG_ENABLE(xsetpointer,      [  --enable-xsetpointer    enables executing of xsetpointer (default=auto) ])
16 AC_ARG_ENABLE(alsa,             [  --enable-alsa           use ALSA for sound output (default=auto) ])
17 AC_ARG_ENABLE(jack,             [  --enable-jack           use JACK for sound output (default=auto) ])
18 AC_ARG_ENABLE(oss,              [  --enable-oss            use OSS for sound output (default=auto) ])
19 dnl AC_ARG_ENABLE(dga2,         [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
20 AC_ARG_ENABLE(libxml2,          [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
21 AC_ARG_ENABLE(mad,              [  --disable-mad           disable mad for mp3 support (default=auto) ])
22 AC_ARG_ENABLE(vorbis,           [  --disable-vorbis        disable libvorbis support (default=auto) ])
23 AC_ARG_ENABLE(audiofile,        [  --disable-audiofile     disable audiofile support (default=auto) ])
24 AC_ARG_ENABLE(filechooser,      [  --disable-filechooser   disable gtk+ 2.4 filechooser (default=auto) ])
25 AC_ARG_ENABLE(startup,          [  --disable-startup       disable startup-notification (default=auto) ])
26 AC_ARG_ENABLE(legacy,           [  --enable-legacy         enable support for old terminatorX files (default=no) ])
27 AC_ARG_ENABLE(alsamidi,         [  --disable-alsamidi      disable support  ALSA MIDI in (default=auto) ])
28 AC_ARG_ENABLE(lrdf,             [  --disable-lrdf          disable support for liblrdf (default=auto) ])
29 AC_ARG_ENABLE(capabilities,     [  --enable-capabilities   to use rt-scheduling (default=auto) ])
30 AC_ARG_ENABLE(deprecated,       [  --disable-deprecated    compile without deprecated G*-headers (default=no) ])
31 AC_ARG_WITH(docdir,             [  --with-docdir=/some/dir the final location the docs will be installed to. ])
32
33 dnl Checks for programs.
34 AC_PROG_AWK
35 AC_PROG_CC
36 AC_PROG_CXX
37 AC_PROG_INSTALL
38 AC_PROG_LN_S
39 AC_PROG_RANLIB
40
41 OPTION_OSS="no"
42 OPTION_ALSA="no"
43 OPTION_JACK="no"
44 OPTION_SOX="no"
45 OPTION_MPG123="no"
46 OPTION_MAD="no"
47 OPTION_OGG123="no"
48 OPTION_VORBIS="no"
49 OPTION_AUDIOFILE="no"
50 OPTION_WAV="no"
51 OPTION_SCHEDULER="no"
52 OPTION_ALSAMIDI="no"
53 OPTION_LEGACY="no"
54 OPTION_LRDF="no"
55 OPTION_CAP="no"
56
57 dnl Checks for libraries.
58 AC_CHECK_LIB(m, floor,, AC_MSG_ERROR([** math-lib not installed or broken **]))
59
60 dnl Checking whether -pthreads, -lpthreads or simply nothing
61
62 tX_threads=no
63
64 dnl Some machines don't require any switches for pthread support...
65
66 AC_MSG_CHECKING([whether pthreads works without switches])
67         no_threads_flags=no
68         AC_LANG_SAVE
69         AC_LANG_C
70         AC_TRY_LINK([#include <pthread.h>], [ pthread_t thread; pthread_create(&thread, NULL, NULL, NULL);],
71                 no_threads_flags=yes,
72                 no_threads_flags=no
73         )
74         AC_LANG_RESTORE
75 AC_MSG_RESULT([$no_threads_flags])
76
77 if test "$no_threads_flags" = "yes"; then
78         tX_threads=auto
79 fi
80
81 dnl Some machines prefer the -lpthread...
82
83 if test "$tX_threads" = "no"; then
84         pthread_lib=no
85         AC_CHECK_LIB(pthread, pthread_detach, pthread_lib=yes, pthread_lib=no)
86         
87         if test "$pthread_lib" = "yes"; then
88                 tX_threads=lpthread
89                 LIBS="$LIBS -lpthread"
90         fi
91 fi
92
93 dnl Some machines prefer a -pthread...
94
95 if test "$tX_threads" = "no"; then
96         AC_MSG_CHECKING([whether -pthread is required for pthreads])
97                 use_gcc_threads=no
98                 ac_save_CFLAGS=$CFLAGS
99                 CFLAGS="$CFLAGS -pthread"
100                 AC_LANG_SAVE
101                 AC_LANG_C
102                 AC_TRY_LINK([#include <pthread.h>], [ pthread_t thread; pthread_create(&thread, NULL, NULL, NULL);],
103                         use_gcc_threads=yes,
104                         use_gcc_threads=no
105                 )
106                 AC_LANG_RESTORE
107                 CFLAGS=$ac_save_CFLAGS
108         AC_MSG_RESULT([$use_gcc_threads])
109         
110         if test "$use_gcc_threads" = "yes"; then
111                 tX_threads=gcc
112                 CFLAGS="$CFLAGS -pthread"
113         fi
114 fi
115
116 dnl If we still haven't found pthreads, we panic...
117
118 if test "$tX_threads" = "no"; then
119         AC_MSG_ERROR([** failed to detect pthreads implementation **])
120 fi
121
122
123 AC_SEARCH_LIBS([dlclose], [dl])
124
125 dnl GTK+ search. Enable FileChooser for gtk+>=2.4
126
127 AM_PATH_GTK_2_0(, [
128         GTK2_CFLAGS="$GTK_CFLAGS"
129         GTK2_LIBS="$GTK_LIBS"
130         gtk2="yes"
131         GTK2_VERSION="`$PKG_CONFIG --modversion gtk+-2.0`"], [ gtk2="yes" ]) 
132
133 OPTION_GTK_VERSION="Version 2 - ($GTK2_VERSION)"
134 vers=`echo $GTK2_VERSION | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
135
136 if test "$enable_filechooser" != "no"; then
137         AC_MSG_CHECKING([whether to use the FileChooser])
138         if test "$vers" -ge 2004000; then
139                 AC_MSG_RESULT([yes])
140                 AC_DEFINE_UNQUOTED([USE_FILECHOOSER], 1, [Use the new FileChooser.])
141         else
142                 AC_MSG_RESULT([no])
143         fi
144 fi
145
146 if test "$gtk2" = "no"; then
147         AC_MSG_ERROR([** couldn't find gtk+ > Version 2. Please upgrade (http://www.gtk.org). **])
148 fi
149
150 if test "$enable_startup" != "no"; then
151         AC_MSG_CHECKING([whether gtk+ does startup notification])
152         if test "$vers" -ge 2002000; then
153                 AC_MSG_RESULT([yes])
154                 AC_DEFINE_UNQUOTED([USE_STARTUP_NOTIFICATION], 1, [Use gtk+ statup notification.])
155         else
156                 AC_MSG_RESULT([no])
157         fi
158 fi
159
160 dnl Checks for header files.
161 AC_HEADER_STDC
162 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h unistd.h)
163
164 dnl Disable LADSPA caching..
165 unset ac_cv_header_ladspa_h
166
167 have_ladspa=no
168 AC_CHECK_HEADERS(ladspa.h, have_ladspa=yes, have_ladspa=no)
169
170 dnl Disable LADSPA caching..
171 unset ac_cv_header_ladspa_h
172
173 dnl Some people install LADSPA in /usr/local
174
175 if test "$have_ladspa" = "no"; then
176         ac_save_CFLAGS=$CFLAGS
177         CFLAGS="$CFLAGS -I/usr/local/include"
178         AC_CHECK_HEADERS(ladspa.h, have_ladspa=yes, have_ladspa=no)
179         CFLAGS=$ac_save_CFLAGS
180         
181         if test "$have_ladspa" = "yes"; then
182                 CFLAGS="$CFLAGS -I/usr/local/include"
183         fi
184 fi
185
186 if test "$have_ladspa" = "no"; then
187         AC_MSG_ERROR([** couldn't find ladspa.h - Install the LADSPA SDK from http://www.ladspa.org first. **])
188 fi
189
190 ac_save_CFLAGS=$CFLAGS
191 CFLAGS="$CFLAGS -finput-charset=utf-8"
192 AC_TRY_COMPILE([#include <stdio.h>],, have_utf8=yes, have_utf8=no)
193 CFLAGS=$ac_save_CFLAGS
194
195 if test "$have_utf8" = "yes"; then
196         CFLAGS="$CFLAGS -finput-charset=utf-8"
197 fi
198
199 AC_CHECK_HEADERS(zlib.h,, AC_MSG_ERROR([** couldn't find zlib.h **]))
200 AC_CHECK_LIB(z,gzprintf, LIBS="$LIBS -lz", AC_MSG_ERROR([** couldn't find libz library **]))
201
202 dnl Checks for typedefs, structures, and compiler characteristics.
203 AC_C_BIGENDIAN
204 AC_TYPE_SIZE_T
205
206 dnl Checks for library functions.
207 AC_PROG_GCC_TRADITIONAL
208
209 dnl Eval args
210 if test "$enable_closedev" = "no"; then
211         AC_DEFINE_UNQUOTED([KEEP_DEV_OPEN], 1, [Define if you want keep device open])
212 fi
213
214
215 if test "$enable_sox" != "no"; then
216         AC_CHECK_PROG(SOX_PROG, sox, yes)
217         if test "$SOX_PROG" = "yes"; then
218                 AC_DEFINE_UNQUOTED([USE_SOX_INPUT], 1, [Define if you want to use sox as input converter])
219                 OPTION_SOX="yes"
220         fi
221 fi
222
223 if test "$enable_mad" != "no"; then
224         AC_CHECK_HEADERS(mad.h,madheader=yes,madheader=no)
225         if test "$madheader" = "yes"; then
226                 AC_CHECK_LIB(mad,mad_decoder_init,madlib=yes,madlib=no)
227                 if test "$madlib" = "yes"; then
228                         LIBS="$LIBS -lmad"
229                         AC_DEFINE_UNQUOTED([USE_MAD_INPUT], 1, [Define to use MAD for mp3 support])
230                         OPTION_MAD="yes"
231                 fi
232         fi
233 fi
234
235 AC_CHECK_HEADERS(X11/extensions/Xxf86dga.h,newDgaHeader=yes,newDgaHeader=no, [#include <X11/Xlib.h>])
236
237 if test "$newDgaHeader" = "no"; then
238         AC_CHECK_HEADERS(X11/extensions/xf86dga.h,oldDgaHeader=yes,oldDgaHeader=no, [#include <X11/Xlib.h>])
239         
240         if test "$oldDgaHeader" = "no"; then
241                 AC_MSG_ERROR([** couldn't find xf86dga.h header - Install X11 headers first. **])
242         fi
243 fi
244
245 if test "$enable_vorbis" != "no"; then
246         AC_CHECK_HEADERS(vorbis/codec.h vorbis/vorbisfile.h,vorbis_headers=yes,vorbis_headers="no")
247         if test "$vorbis_headers" = "yes"; then
248                 AC_CHECK_LIB(vorbis,vorbis_info_init,vorbis_libs=yes,vorbis_libs=no)
249                 if test "$vorbis_libs" = "yes"; then
250                         PREV_LIBS=LIBS
251                         LIBS="$LIBS -lvorbis"
252                         AC_CHECK_LIB(vorbisfile,ov_open_callbacks,vorbisfile_libs=yes,vorbisfile_libs=no)
253                         if test "$vorbisfile_libs" = "yes"; then
254                                 LIBS="$LIBS -lvorbisfile"
255                                 AC_DEFINE_UNQUOTED([USE_VORBIS_INPUT], 1, [Define to use libvorbis for ogg support])
256                                 OPTION_VORBIS="yes"
257                         else
258                                 LIBS=PREV_LIBS
259                         fi
260                 fi
261         fi
262 fi
263
264 if test "$enable_audiofile" != "no"; then
265         AC_CHECK_PROG(af_config,audiofile-config,yes,no)
266         if test "$af_config" = "yes"; then
267                 af_cflags=`audiofile-config --cflags`
268                 if test "$af_cflags" != ""; then
269                         CFLAGS="$CFLAGS $af_cflags"
270                 fi
271                 af_libs=`audiofile-config --libs`
272                 LIBS="$LIBS $af_libs"
273                 AC_DEFINE_UNQUOTED([USE_AUDIOFILE_INPUT], 1, [Define to compile libaudiofile support])
274                 OPTION_AUDIOFILE="yes"
275         else
276                 AC_CHECK_HEADERS(audiofile.h,audiofile_headers=yes,audiofile_headers=no)
277                 if test "$audiofile_headers" = "yes"; then
278                         AC_CHECK_LIB(audiofile,afOpenFile,audiofile_libs=yes,audiofile_libs=no)
279                         if test "$audiofile_libs" = "yes"; then
280                                 LIBS="$LIBS -laudiofile"
281                                 AC_DEFINE_UNQUOTED([USE_AUDIOFILE_INPUT], 1, [Define to compile libaudiofile support])
282                                 OPTION_AUDIOFILE="yes"
283                         fi
284                 fi
285         fi
286 fi
287
288 if test "$enable_mpg123" != "no"; then
289         AC_CHECK_PROG(MPG123_PROG, mpg123, yes)
290         if test "$MPG123_PROG" = "yes"; then
291                 if test "$SOX_PROG" = "yes"; then       
292                         AC_DEFINE_UNQUOTED([USE_MPG123_INPUT], 1, [Define mp3-input through mpg123 - requires sox as well])
293                         OPTION_MPG123="yes"
294                 else
295                         AC_CHECK_PROG(SOX_PROG, sox, yes)
296                         if test "$SOX_PROG" = "yes"; then       
297                                 AC_DEFINE_UNQUOTED([USE_MPG123_INPUT], 1, [Define mp3-input through mpg123 - requires sox as well])
298                                 OPTION_MPG123="yes"
299                         else
300                                 AC_MSG_RESULT([** mpg123 support disabled: couldn't find sox! **])
301                         fi
302                 fi
303         fi
304 fi
305
306 if test "$enable_ogg123" != "no"; then
307         AC_CHECK_PROG(OGG123_PROG, ogg123, yes)
308         if test "$OGG123_PROG" = "yes"; then
309                 AC_DEFINE_UNQUOTED([USE_OGG123_INPUT], 1, [Define if you want UGLY ogg-input "support" - also requires sox])
310                 OPTION_OGG123="yes"
311         fi
312 fi
313
314 if test "$enable_xsetpointer" != "no"; then
315         AC_CHECK_PROG(XSETPOINTER_PROG, xsetpointer, yes)
316         if test "$XSETPOINTER_PROG" = "yes"; then
317                 AC_DEFINE_UNQUOTED([USE_XSETPOINTER], 1, [Exec xsetpointer instead of using Xlib-calls.])
318         else
319                 if test "$enable_xsetpointer" = "yes"; then
320                         AC_MSG_ERROR([** xsetpointer not found. **])
321                 fi
322         fi
323 fi
324
325 if test "$enable_movqfix" = "no"; then
326         AC_DEFINE_UNQUOTED([OVERRIDE_MOVQ_AUTODETECT], 1, [Don't use movqfix])
327 fi
328
329 using_alsa=no
330 using_oss=no
331 using_jack=no
332
333 if test "$enable_alsa" != "no"; then
334     AC_CHECK_LIB(asound, snd_pcm_writei,alsalib=yes,alsalib=no)
335     AC_CHECK_HEADERS(alsa/asoundlib.h,alsaheader=yes,alsaheader=no)
336
337     if test "$alsalib" = "yes"; then
338             if test "$alsaheader" = "yes"; then
339                     AC_DEFINE_UNQUOTED([USE_ALSA], 1, [ Define to enable ALSA audio backend. ])
340                     LIBS="$LIBS -lasound"
341                     using_alsa=yes
342                     OPTION_ALSA=yes
343             else 
344                     if test "$enable_alsa" = "yes"; then
345                             AC_MSG_ERROR([** Coulnd't find ALSA header file sys/asoundlib.h **])
346                     fi
347             fi
348     else
349             if test "$enable_alsa" = "yes"; then
350                     AC_MSG_ERROR([** Coulnd'f find ALSA library libasound. **])
351             fi
352     fi
353 fi
354
355 if test "$enable_jack" != "no"; then
356     AC_CHECK_LIB(jack,jack_activate,jacklib=yes,jacklib=no)
357     AC_CHECK_HEADERS(jack/jack.h,jackheader=yes,jackheader=no)
358
359     if test "$jacklib" = "yes"; then
360             if test "$jackheader" = "yes"; then
361                     AC_DEFINE_UNQUOTED([USE_JACK], 1, [ Define to enable JACK audio backend.])
362                     LIBS="$LIBS -ljack"
363                     using_jack=yes
364                     OPTION_JACK=yes
365             else 
366                     if test "$enable_jack" = "yes"; then
367                             AC_MSG_ERROR([** Coulnd't find JACK header file jack/jack.h **])
368                     fi
369             fi
370     else
371             if test "$enable_jack" = "yes"; then
372                     AC_MSG_ERROR([** Coulnd'f find JACK library libjack. **])
373             fi
374     fi
375 fi
376
377
378 if test "$enable_oss" != "no"; then
379         AC_CHECK_HEADERS(sys/ioctl.h sys/soundcard.h,oss=yes,oss=no)
380         
381         if test "$oss" = "yes"; then
382                 AC_DEFINE_UNQUOTED([USE_OSS], 1, [Use OSS])
383                 OPTION_OSS=yes
384                 using_oss=yes;
385         else
386                 if test "$enable_oss" = "yes"; then
387                         AC_MSG_ERROR([** Couldn't find OSS header files. ***])
388                 fi
389         fi
390 fi
391
392 if test "$enable_alsamidi" != "no"; then
393         if test "$using_alsa" = "yes"; then
394                 AC_DEFINE_UNQUOTED([USE_ALSA_MIDI_IN], 1, [Define for ALSA MIDI in support])
395                 OPTION_ALSAMIDI="yes"                           
396         else
397                 AC_CHECK_LIB(asound, snd_seq_open,alsalib=yes,alsalib=no)
398                 AC_CHECK_HEADERS(alsa/asoundlib.h,alsaheader=yes,alsaheader=no)
399
400                 if test "$alsalib" = "yes"; then
401                         if test "$alsaheader" = "yes"; then
402                                 AC_DEFINE_UNQUOTED([USE_ALSA_MIDI_IN], 1, [Define for ALSA MIDI in support])
403                                 LIBS="$LIBS -lasound"
404                                 OPTION_ALSAMIDI="yes"
405                         else 
406                                 if test "$enable_alsamidi" = "yes"; then
407                                         AC_MSG_ERROR([** Coulnd't find ALSA header file alsa/asoundlib.h **])
408                                 fi
409                         fi
410                 else
411                         if test "$enable_alsamidin" = "yes"; then
412                                 AC_MSG_ERROR([** Couldn't find ALSA library libasound. **])
413                         fi
414                 fi
415         fi
416 fi
417
418 if test "$using_alsa" != "yes"; then
419         if test "$using_oss" != "yes"; then
420                 if test "$using_jack" != "yes"; then
421                         AC_MSG_ERROR([** Found neither OSS, ALSA nor JACK - no output device! **])
422                 fi
423         fi
424 fi      
425         
426 if test "$enable_wav" != "no";
427 then
428         AC_DEFINE_UNQUOTED([USE_BUILTIN_WAV], 1, [Define to enable the built-in wav loading routines])
429         OPTION_WAV="yes"
430 fi
431
432 if test "$enable_3dnow" = "yes"; then
433         AC_DEFINE_UNQUOTED([USE_3DNOW], 1, [Do not define this])
434 fi 
435
436 if test "$enable_scheduler" != "no"; then
437         OPTION_SCHEDULER="yes";
438         AC_DEFINE_UNQUOTED([USE_SCHEDULER], 1, [Define this to compile with rt scheduling support])
439 fi
440
441 if test "$enable_debug" = yes; then
442         AC_DEFINE_UNQUOTED([ENABLE_DEBUG_OUTPUT], 1, [Define this to enable debug output.])
443 fi
444
445 if test "$enable_benchmark" = yes; then
446         AC_DEFINE_UNQUOTED([CREATE_BENCHMARK], 1, [Define this to build an performance benchmark - WARNING: You cannot use the resulting binary for normal operation])
447 fi
448
449 if test "$enable_capabilities" != "no"; then
450         AC_CHECK_HEADERS(sys/capability.h,capheader=yes,capheader=no)
451         AC_CHECK_HEADERS(sys/prctl.h,prctlheader=yes,prctlheader=no)
452         
453         if test "$capheader" = "yes"; then
454                 if test "$prctlheader" = "yes"; then
455                         AC_CHECK_LIB(cap,cap_get_proc,caplib=yes,caplib=no)
456                         if test "$caplib" = "yes"; then
457                                 LIBS="$LIBS -lcap"
458                                 AC_DEFINE_UNQUOTED([USE_CAPABILITIES], 1, [Define to use capabilities])
459                                 OPTION_CAP="yes"
460                         fi
461                 fi
462         fi
463 fi
464
465 if test "$enable_capabilities" = "yes"; then
466         if test "$OPTION_CAP" != "yes"; then
467                 AC_MSG_ERROR([** This system doesn't support capabilities. **])
468         fi
469 fi
470
471
472
473 if test "$enable_deprecated" = "no"; then
474         DEPRECATED_FLAGS="-DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED"
475 else 
476     DEPRECATED_FLAGS=""
477 fi
478
479 AC_SUBST(DEPRECATED_FLAGS)
480
481 AC_MSG_CHECKING(for necessary scratching skillz)
482 AC_MSG_RESULT(yes)
483
484 AC_DEFINE_UNQUOTED([USE_DIAL], 1, [ Define this. ])
485
486 dnl if test "$enable_bigdial" = yes; then
487 dnl     AC_DEFINE(USE_DIAL)
488 dnl     AC_DEFINE(USE_BIG_BUTTONS)
489 dnl fi
490
491 if test "$enable_legacy" = yes; then
492         AC_DEFINE_UNQUOTED([ENABLE_TX_LEGACY], 1, [Define this to enable support for old tX set files])
493         OPTION_LEGACY="yes"
494 fi
495
496 dnl if test "$enable_dga2" = yes; then
497 dnl     AC_DEFINE(USE_DGA2)
498 dnl fi
499
500 dnl Detecting libxml. Based on dia's test.
501 found_libxml=false
502
503 if test "$enable_libxml2" != "no"; then
504         if ! $found_libxml; then
505           AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config)
506           if test "x$XML2_CONFIG" != x ; then
507             AC_MSG_CHECKING(for libxml >= 2.3.9)
508             vers=`$XML2_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
509
510             if test "$vers" -ge 2003009; then
511               AC_MSG_RESULT(yes)
512               found_libxml=true
513               XML_LIBS="`$XML2_CONFIG --libs`"
514               XML_CFLAGS="`$XML2_CONFIG --cflags`"
515             else
516               AC_MSG_RESULT(no)
517             fi
518           fi
519         fi
520 fi      
521
522 if ! $found_libxml 
523 then
524         AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config)
525         if test "x$XML_CONFIG" != x ; then
526           AC_MSG_CHECKING(for libxml >= 1.8.14)
527           vers=`$XML_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
528
529           dnl 1.18.14 is required for xmlUseNewParser()    
530           if test "$vers" -ge 1008014; then
531             AC_MSG_RESULT(yes)
532             found_libxml=true
533             XML_LIBS="`$XML_CONFIG --libs`"
534             XML_CFLAGS="`$XML_CONFIG --cflags`"
535           else
536             AC_MSG_RESULT(no)
537           fi
538         fi
539 fi
540
541 if ! $found_libxml; then
542     AC_MSG_ERROR([** libxml not found. Get libxml(2) at http://www.libxml.org **])
543 fi
544
545 AC_SUBST(XML_LIBS)
546 AC_SUBST(XML_CFLAGS)
547
548 if test "$enable_lrdf" != "no"; then
549     AC_MSG_CHECKING(for liblrdf >= 0.2.4)
550         LRDF_VERS=`$PKG_CONFIG --modversion lrdf | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
551         if test "$LRDF_VERS" -ge 2004; then
552                 AC_MSG_RESULT(yes)
553                 OPTION_LRDF=yes
554
555                 lrdf_cflags=`$PKG_CONFIG --cflags lrdf`
556                 if test "$lrdf_cflags" != ""; then
557                         CFLAGS="$CFLAGS $lrdf_cflags"
558                 fi
559                 lrdf_libs=`$PKG_CONFIG --libs lrdf`
560                 LIBS="$LIBS $lrdf_libs"
561                 AC_DEFINE_UNQUOTED([USE_LRDF], 1, [Define to compile librdf support])
562                 OPTION_AUDIOFILE="yes"
563         else
564                 AC_MSG_RESULT(no)
565         fi
566
567 fi
568
569 dnl User Manual
570 GNOME_DOC_INIT
571
572 xml_man="\\\"${datadir}/gnome/help/terminatorX-manual/C/terminatorX-manual.xml\\\""
573
574 dnl Now Check for Xlibs - I do this here as other tests fail if these run earlier
575 AC_PATH_XTRA
576
577 AC_SUBST(X_CFLAGS)
578 AC_SUBST(X_PRE_LIBS)
579 AC_SUBST(X_EXTRA_LIBS)
580 AC_SUBST(X_LIBS)
581 AC_SUBST(x_libraries)
582
583 GTK_LIBS="$GTK_LIBS $X_LIBS"
584 AC_CHECK_LIB(X11, XOpenDisplay,, AC_MSG_ERROR([** X11-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
585 AC_CHECK_LIB(Xext, XShmQueryExtension,, AC_MSG_ERROR([** Xext-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
586 AC_CHECK_LIB(Xi, XOpenDevice,, AC_MSG_ERROR([** XInput not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
587 AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,, AC_MSG_ERROR([** DGA not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
588 if test "$enable_dga2" = yes; then
589         AC_CHECK_LIB(Xxf86dga, XDGASelectInput,, AC_MSG_ERROR([** DGA2 not installed. Try using dga1 instead. **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
590 fi
591
592 CFLAGS="$XML_CFLAGS $CFLAGS -DXML_MANUAL=$xml_man"
593 LIBS="$XML_LIBS $LIBS"
594
595 AC_OUTPUT(Makefile 
596         src/Makefile 
597         icons/Makefile 
598         src/icons/Makefile 
599         help/Makefile
600         terminatorX.keys 
601         terminatorX.spec 
602         terminatorX.1)
603
604 option_info() {
605         echo "$option support: $option_val"
606         if test "$option_val" != "yes"; then
607                 echo "  - If you want $option support get $option from"
608                 echo "  -       $option_url"
609                 echo "  - and reconfigure terminatorX"
610         fi
611 }
612
613 echo
614 echo configured terminatorX for:
615 echo ---------------------------
616 echo
617
618 option=sox; option_val=$OPTION_SOX; option_url=http://sox.sourceforge.net/
619 option_info;
620
621 echo "mpg123 support: $OPTION_MPG123"
622 if test "$OPTION_MPG123" = "no"; then
623 echo "  - If you want mpg123 support get either mpg321 from"
624 echo "  -       http://mpg321.sourceforge.net/ or mpg123 from"
625 echo "  -       http://www.mpg123.de/"
626 echo "  - and reconfigure terminatorX"
627 fi
628
629
630 option=oss; option_val=$OPTION_OSS; option_url=http://www.kernel.org
631 option_info;
632
633 option=alsa; option_val=$OPTION_ALSA; option_url=http://www.alsa-project.org
634 option_info;
635
636 option=jack; option_val=$OPTION_JACK; option_url=http://jackit.sourceforge.net
637 option_info;
638
639 option=mad; option_val=$OPTION_MAD; option_url=http://www.mars.org/home/rob/proj/mpeg/
640 option_info;
641
642 option=ogg123; option_val=$OPTION_OGG123; option_url=http://www.xiph.org/ogg/vorbis/
643 option_info;
644
645 option=libvorbis; option_val=$OPTION_VORBIS; option_url=http://www.xiph.org/ogg/vorbis/
646 option_info;
647
648 option=audiofile; option_val=$OPTION_AUDIOFILE; option_url=http://www.68k.org/~michael/audiofile/
649 option_info;
650
651 option="ALSA (MIDI in)"; option_val=$OPTION_ALSAMIDI; option_url=http://www.alsa-project.org
652 option_info;
653
654 option=lrdf; option_val=$OPTION_LRDF; option_url=http://plugin.org.uk/releases/lrdf/
655 option_info;
656
657 echo "legacy files support: $OPTION_LEGACY"
658 echo "builtin-wav support: $OPTION_WAV"
659 echo "enhanced scheduling support: $OPTION_SCHEDULER"
660 echo "capabilities support: $OPTION_CAP"
661 echo
662 echo You can now run \'make\' to compile terminatorX