Fix unintentional unicode character.
[terminatorX.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([terminatorX], [4.0.0], [https://terminatorX.org/bugs/], [terminatorX], [https://terminatorX.org])
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 PulseAudio 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,   [  --enable-suidroot      install terminatorX setuid root (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 AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources])
143 AS_IF([test "$GLIB_COMPILE_RESOURCES" == ""],[
144         AC_MSG_ERROR([glib-compile-resources not found])
145         ])
146
147 dnl Checks for header files.
148 AC_HEADER_STDC
149 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h unistd.h)
150
151 dnl Disable LADSPA caching..
152 unset ac_cv_header_ladspa_h
153
154 have_ladspa=no
155 AC_CHECK_HEADERS(ladspa.h, have_ladspa=yes, have_ladspa=no)
156
157 dnl Disable LADSPA caching..
158 unset ac_cv_header_ladspa_h
159
160 dnl Some people install LADSPA in /usr/local
161
162 if test "$have_ladspa" = "no"; then
163         ac_save_CFLAGS=$CFLAGS
164         CFLAGS="$CFLAGS -I/usr/local/include"
165         AC_CHECK_HEADERS(ladspa.h, have_ladspa=yes, have_ladspa=no)
166         CFLAGS=$ac_save_CFLAGS
167         
168         if test "$have_ladspa" = "yes"; then
169                 CFLAGS="$CFLAGS -I/usr/local/include"
170         fi
171 fi
172
173 if test "$have_ladspa" = "no"; then
174         AC_MSG_ERROR([** couldn't find ladspa.h - Install the LADSPA SDK from http://www.ladspa.org first. **])
175 fi
176
177 ac_save_CFLAGS=$CFLAGS
178 CFLAGS="$CFLAGS -finput-charset=utf-8"
179 AC_TRY_COMPILE([#include <stdio.h>],, have_utf8=yes, have_utf8=no)
180 CFLAGS=$ac_save_CFLAGS
181
182 if test "$have_utf8" = "yes"; then
183         CFLAGS="$CFLAGS -finput-charset=utf-8"
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_movqfix" = "no"; then
292         AC_DEFINE_UNQUOTED([OVERRIDE_MOVQ_AUTODETECT], 1, [Do nott use movqfix])
293 fi
294
295 using_alsa=no
296 using_oss=no
297 using_jack=no
298 using_pulse=no
299
300 if test "$enable_alsa" != "no"; then
301     AC_CHECK_LIB(asound, snd_pcm_writei,alsalib=yes,alsalib=no)
302     AC_CHECK_HEADERS(alsa/asoundlib.h,alsaheader=yes,alsaheader=no)
303
304     if test "$alsalib" = "yes"; then
305             if test "$alsaheader" = "yes"; then
306                     AC_DEFINE_UNQUOTED([USE_ALSA], 1, [ Define to enable ALSA audio backend. ])
307                     LIBS="$LIBS -lasound"
308                     using_alsa=yes
309                     OPTION_ALSA=yes
310             else 
311                     if test "$enable_alsa" = "yes"; then
312                             AC_MSG_ERROR([** Could not find ALSA header file sys/asoundlib.h **])
313                     fi
314             fi
315     else
316             if test "$enable_alsa" = "yes"; then
317                     AC_MSG_ERROR([** Could not find ALSA library libasound. **])
318             fi
319     fi
320 fi
321
322 if test "$enable_jack" != "no"; then
323     AC_CHECK_LIB(jack,jack_activate,jacklib=yes,jacklib=no)
324     AC_CHECK_HEADERS(jack/jack.h,jackheader=yes,jackheader=no)
325
326     if test "$jacklib" = "yes"; then
327             if test "$jackheader" = "yes"; then
328                     AC_DEFINE_UNQUOTED([USE_JACK], 1, [ Define to enable JACK audio backend.])
329                     LIBS="$LIBS -ljack"
330                     using_jack=yes
331                     OPTION_JACK=yes
332             else 
333                     if test "$enable_jack" = "yes"; then
334                             AC_MSG_ERROR([** Could not find JACK header file jack/jack.h **])
335                     fi
336             fi
337     else
338             if test "$enable_jack" = "yes"; then
339                     AC_MSG_ERROR([** Could not find JACK library libjack. **])
340             fi
341     fi
342 fi
343
344 if test "$enable_pulse" != "no"; then
345     AC_CHECK_LIB(pulse-simple,pa_simple_new,pulselib=yes,pulselib=no)
346     AC_CHECK_HEADERS(pulse/pulseaudio.h,pulseheader=yes,pulseheader=no)
347
348     if test "$pulselib" = "yes"; then
349             if test "$pulseheader" = "yes"; then
350                     AC_DEFINE_UNQUOTED([USE_PULSE], 1, [ Define to enable PULSE audio backend.])
351                     LIBS="$LIBS -lpulse-simple -lpulse"
352                     using_pulse=yes
353                     OPTION_PULSE=yes
354             else 
355                     if test "$enable_pulse" = "yes"; then
356                             AC_MSG_ERROR([** Could not find PULSE header file pulse/pulseaudio.h **])
357                     fi
358             fi
359     else
360             if test "$enable_pulse" = "yes"; then
361                     AC_MSG_ERROR([** Could not find PULSE library libpulse. **])
362             fi
363     fi
364
365 fi
366
367
368 if test "$enable_oss" != "no"; then
369         AC_CHECK_HEADERS(sys/ioctl.h sys/soundcard.h,oss=yes,oss=no)
370         
371         if test "$oss" = "yes"; then
372                 AC_DEFINE_UNQUOTED([USE_OSS], 1, [Use OSS])
373                 OPTION_OSS=yes
374                 using_oss=yes;
375         else
376                 if test "$enable_oss" = "yes"; then
377                         AC_MSG_ERROR([** Could not find OSS header files. ***])
378                 fi
379         fi
380 fi
381
382 if test "$enable_alsamidi" != "no"; then
383         if test "$using_alsa" = "yes"; then
384                 AC_DEFINE_UNQUOTED([USE_ALSA_MIDI_IN], 1, [Define for ALSA MIDI in support])
385                 OPTION_ALSAMIDI="yes"                           
386         else
387                 AC_CHECK_LIB(asound, snd_seq_open,alsalib=yes,alsalib=no)
388                 AC_CHECK_HEADERS(alsa/asoundlib.h,alsaheader=yes,alsaheader=no)
389
390                 if test "$alsalib" = "yes"; then
391                         if test "$alsaheader" = "yes"; then
392                                 AC_DEFINE_UNQUOTED([USE_ALSA_MIDI_IN], 1, [Define for ALSA MIDI in support])
393                                 LIBS="$LIBS -lasound"
394                                 OPTION_ALSAMIDI="yes"
395                         else 
396                                 if test "$enable_alsamidi" = "yes"; then
397                                         AC_MSG_ERROR([** Coulnd't find ALSA header file alsa/asoundlib.h **])
398                                 fi
399                         fi
400                 else
401                         if test "$enable_alsamidin" = "yes"; then
402                                 AC_MSG_ERROR([** Couldn't find ALSA library libasound. **])
403                         fi
404                 fi
405         fi
406 fi
407
408 if test "$using_alsa" != "yes"; then
409         if test "$using_oss" != "yes"; then
410                 if test "$using_jack" != "yes"; then
411                         if test "$using_pulse" != "yes"; then
412                                 AC_MSG_ERROR([** Found neither OSS, ALSA, JACK nor PULSE - no output device! **])
413                         fi
414                 fi
415         fi
416 fi      
417
418 if test "$enable_x11" != "no"; then
419                 AC_CHECK_LIB(X11, XOpenDisplay, x11lib=yes, x11lib=no)
420                 AC_CHECK_HEADERS(X11/Xlib.h, x11header=yes, x11header=no)
421
422     if test "$x11lib" = "yes"; then
423             if test "$x11header" = "yes"; then
424                     AC_DEFINE_UNQUOTED([USE_X11], 1, [ Define to enable X11 specific code (e.g. fullscreen mode ).])
425                                                 LIBS="$LIBS -lX11"
426                     using_x11=yes
427                                                 OPTION_X11=yes
428             else 
429                     if test "$enable_x11" = "yes"; then
430                             AC_MSG_ERROR([** X11 headers not installed or broken **])
431                     fi
432             fi
433     else
434             if test "$enable_x11" = "yes"; then
435                     AC_MSG_ERROR([** X11 libs not installed or broken **])
436             fi
437     fi
438 fi
439         
440 if test "$enable_wav" != "no";
441 then
442         AC_DEFINE_UNQUOTED([USE_BUILTIN_WAV], 1, [Define to enable the built-in wav loading routines])
443         OPTION_WAV="yes"
444 fi
445
446 if test "$enable_3dnow" = "yes"; then
447         AC_DEFINE_UNQUOTED([USE_3DNOW], 1, [Do not define this])
448 fi 
449
450 if test "$enable_scheduler" != "no"; then
451         OPTION_SCHEDULER="yes";
452         AC_DEFINE_UNQUOTED([USE_SCHEDULER], 1, [Define this to compile with rt scheduling support])
453 fi
454
455 if test "$enable_debug" = yes; then
456         AC_DEFINE_UNQUOTED([ENABLE_DEBUG_OUTPUT], 1, [Define this to enable debug output.])
457 fi
458
459 if test "$enable_benchmark" = yes; then
460         AC_DEFINE_UNQUOTED([CREATE_BENCHMARK], 1, [Define this to build an performance benchmark - WARNING: You cannot use the resulting binary for normal operation])
461 fi
462
463 if test "$enable_capabilities" != "no"; then
464         AC_CHECK_HEADERS(sys/capability.h,capheader=yes,capheader=no)
465         AC_CHECK_HEADERS(sys/prctl.h,prctlheader=yes,prctlheader=no)
466         
467         if test "$capheader" = "yes"; then
468                 if test "$prctlheader" = "yes"; then
469                         AC_CHECK_LIB(cap,cap_get_proc,caplib=yes,caplib=no)
470                         if test "$caplib" = "yes"; then
471                                 LIBS="$LIBS -lcap"
472                                 AC_DEFINE_UNQUOTED([USE_CAPABILITIES], 1, [Define to use capabilities])
473                                 OPTION_CAP="yes"
474                         fi
475                 fi
476         fi
477 fi
478
479 if test "$enable_capabilities" = "yes"; then
480         if test "$OPTION_CAP" != "yes"; then
481                 AC_MSG_ERROR([** This system doesn't support capabilities. **])
482         fi
483 fi
484
485 if test "$enable_deprecated" = "no"; then
486         DEPRECATED_FLAGS="-DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED"
487 else 
488     DEPRECATED_FLAGS=""
489 fi
490
491 AC_SUBST(DEPRECATED_FLAGS)
492
493 if test "$enable_suidroot" = "yes"; then
494         OPTION_SUIDROOT="yes"
495 else
496         OPTION_SUIDROOT="no"
497 fi
498
499 AM_CONDITIONAL([SUIDROOT], [ test x$OPTION_SUIDROOT = xyes])
500
501 AC_MSG_CHECKING(for necessary scratching skillz)
502 AC_MSG_RESULT(yes)
503
504 AC_DEFINE_UNQUOTED([USE_DIAL], 1, [ Define this. ])
505
506 dnl if test "$enable_bigdial" = yes; then
507 dnl     AC_DEFINE(USE_DIAL)
508 dnl     AC_DEFINE(USE_BIG_BUTTONS)
509 dnl fi
510
511 if test "$enable_legacy" = yes; then
512         AC_DEFINE_UNQUOTED([ENABLE_TX_LEGACY], 1, [Define this to enable support for old tX set files])
513         OPTION_LEGACY="yes"
514 fi
515
516 dnl Detecting libxml. Based on dia's test.
517 found_libxml=false
518
519 if test "$enable_libxml2" != "no"; then
520         if ! $found_libxml; then
521           AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config)
522           if test "x$XML2_CONFIG" != x ; then
523             AC_MSG_CHECKING(for libxml >= 2.3.9)
524             vers=`$XML2_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
525
526             if test "$vers" -ge 2003009; then
527               AC_MSG_RESULT(yes)
528               found_libxml=true
529               XML_LIBS="`$XML2_CONFIG --libs`"
530               XML_CFLAGS="`$XML2_CONFIG --cflags`"
531             else
532               AC_MSG_RESULT(no)
533             fi
534           fi
535         fi
536 fi      
537
538 if ! $found_libxml 
539 then
540         AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config)
541         if test "x$XML_CONFIG" != x ; then
542           AC_MSG_CHECKING(for libxml >= 1.8.14)
543           vers=`$XML_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
544
545           dnl 1.18.14 is required for xmlUseNewParser()    
546           if test "$vers" -ge 1008014; then
547             AC_MSG_RESULT(yes)
548             found_libxml=true
549             XML_LIBS="`$XML_CONFIG --libs`"
550             XML_CFLAGS="`$XML_CONFIG --cflags`"
551           else
552             AC_MSG_RESULT(no)
553           fi
554         fi
555 fi
556
557 if ! $found_libxml; then
558     AC_MSG_ERROR([** libxml not found. Get libxml(2) at http://www.libxml.org **])
559 fi
560
561 AC_SUBST(XML_LIBS)
562 AC_SUBST(XML_CFLAGS)
563
564 if test "$enable_lrdf" != "no"; then
565     AC_MSG_CHECKING(for liblrdf >= 0.2.4)
566         LRDF_VERS=`$PKG_CONFIG --modversion lrdf | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
567         if test "$LRDF_VERS" -ge 2004; then
568                 AC_MSG_RESULT(yes)
569                 OPTION_LRDF=yes
570
571                 lrdf_cflags=`$PKG_CONFIG --cflags lrdf`
572                 if test "$lrdf_cflags" != ""; then
573                         CFLAGS="$CFLAGS $lrdf_cflags"
574                 fi
575                 lrdf_libs=`$PKG_CONFIG --libs lrdf`
576                 LIBS="$LIBS $lrdf_libs"
577                 AC_DEFINE_UNQUOTED([USE_LRDF], 1, [Define to compile librdf support])
578                 OPTION_AUDIOFILE="yes"
579         else
580                 AC_MSG_RESULT(no)
581         fi
582
583 fi
584
585 dnl User Manual
586 GNOME_DOC_INIT
587
588 xml_man="\\\"${datadir}/gnome/help/terminatorX-manual/C/terminatorX-manual.xml\\\""
589
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=pulse; option_val=$OPTION_PULSE; option_url=http://www.freedesktop.org/wiki/Software/PulseAudio/
639 option_info;
640
641 option=mad; option_val=$OPTION_MAD; option_url=http://www.mars.org/home/rob/proj/mpeg/
642 option_info;
643
644 option=ogg123; option_val=$OPTION_OGG123; option_url=http://www.xiph.org/ogg/vorbis/
645 option_info;
646
647 option=libvorbis; option_val=$OPTION_VORBIS; option_url=http://www.xiph.org/ogg/vorbis/
648 option_info;
649
650 option=audiofile; option_val=$OPTION_AUDIOFILE; option_url=http://www.68k.org/~michael/audiofile/
651 option_info;
652
653 option="ALSA (MIDI in)"; option_val=$OPTION_ALSAMIDI; option_url=http://www.alsa-project.org
654 option_info;
655
656 option=lrdf; option_val=$OPTION_LRDF; option_url=http://plugin.org.uk/releases/lrdf/
657 option_info;
658
659 echo "x11 support: $OPTION_X11"
660 echo "legacy files support: $OPTION_LEGACY"
661 echo "builtin-wav support: $OPTION_WAV"
662 echo "enhanced scheduling support: $OPTION_SCHEDULER"
663 echo "capabilities support: $OPTION_CAP"
664 echo "install setuid-root: $OPTION_SUIDROOT"
665 echo
666 echo You can now run \'make\' to compile terminatorX
667
668 if test "$OPTION_SUIDROOT" = "yes"; then
669     echo As setuid-root is enabled, \'make install\' must be run with root privileges.
670 fi
671