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