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