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