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