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