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