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