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