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