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