1 # Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR([src/liboggplay/oggplay.c])
9 AM_INIT_AUTOMAKE(liboggplay, 0.0.1)
10 AM_CONFIG_HEADER(config.h)
12 SHARED_VERSION_INFO="1:0:0"
26 dnl Add parameters for aclocal
27 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
29 dnl Checks for library functions
30 AC_CHECK_FUNCS([assert])
33 VALGRIND_ENVIRONMENT=""
35 AC_ARG_ENABLE(valgrind-testing,
36 [ --enable-valgrind-testing enable running of tests inside Valgrind ], [ ac_enable_valgrind=yes ], [ ac_enable_valgrind=no] )
38 if test "x${ac_enable_valgrind}" = xyes ; then
39 if test "x${enable_shared}" = xyes ; then
40 VALGRIND_ENVIRONMENT="libtool --mode=execute "
43 AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
44 if test "x$HAVE_VALGRIND" = xyes ; then
45 VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
46 AC_SUBST(VALGRIND_ENVIRONMENT)
47 TESTS_INFO="Type 'make check' to run test suite. Tests will be run under:
48 ${VALGRIND_ENVIRONMENT}"
50 TESTS_INFO="Type 'make check' to run test suite (Valgrind not found)"
52 else TESTS_INFO="Type 'make check' to run test suite (Valgrind testing not enabled)"
55 dnl Overall configuration success flag
58 oggplay_tools="oggplay-info"
59 oggplay_examples="get-stream-info"
63 dnl Configuration option to add -Werror to all Makefiles
66 AC_ARG_ENABLE(gcc-werror,
67 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
68 [ ac_enable_gcc_werror=yes ], [ ac_enable_gcc_werror=no] )
70 if test "x${ac_enable_gcc_werror}" = xyes ; then
71 CFLAGS="-Werror $CFLAGS"
75 dnl Configure for target platform
80 dnl Disable -Wall and -pedantic for Apple Darwin/Rhapsody.
81 dnl System headers on these systems are broken.
82 temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall -pedantic//"`
84 dnl add extra mac-specific directories to include path
85 CFLAGS="$CFLAGS -I/Developer/Headers/FlatCarbon/"
87 AC_SUBST(PLATFORM,"mac")
90 SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
91 AC_SUBST(PLATFORM,"linux")
97 dnl Define MACOSX for the benefit of altering link likes
98 dnl in the build for that platform
99 AM_CONDITIONAL(MACOS, test "x$HAVE_FRAMEWORKS" = "xyes")
105 dnl Minimum required version of liboggz
108 PKG_CHECK_MODULES(OGGZ, oggz >= "$oggplay_OGGZ", HAVE_OGGZ="yes", HAVE_OGGZ="no")
110 if test "$HAVE_OGGZ" = "yes" ; then
111 AC_DEFINE(HAVE_OGGZ, [], [Define if have liboggz])
112 AC_SUBST(OGGZ_CFLAGS)
115 PKG_CHECK_MODULES(OGGZ, oggz, HAVE_OGGZ="old")
117 if test "$HAVE_OGGZ" = "old" ; then
119 *** The version of liboggz installed on your system is too old. You need
120 *** liboggz version greater than $oggplay_OGGZ to build liboggplay.
124 *** liboggz-$oggplay_OGGZ or greater does not seem to exist on your system.
125 *** Please install it and run this ./configure again.
131 dnl Detect libfishsound
134 dnl Minimum required version of libfishsound
135 oggplay_FISHSOUND="0.8.0"
137 PKG_CHECK_MODULES(FISHSOUND, fishsound >= "$oggplay_FISHSOUND", HAVE_FISHSOUND="yes", HAVE_FISHSOUND="no")
139 if test "$HAVE_FISHSOUND" = "yes" ; then
140 AC_DEFINE(HAVE_FISHSOUND, [], [Define if have libfishsound])
141 AC_SUBST(FISHSOUND_CFLAGS)
142 AC_SUBST(FISHSOUND_LIBS)
144 PKG_CHECK_MODULES(FISHSOUND, fishsound, HAVE_FISHSOUND="old")
146 if test "$HAVE_FISHSOUND" = "old" ; then
148 *** The version of libfishsound installed on your system is too old. You need
149 *** at least libfishsound version $oggplay_FISHSOUND to build liboggplay.
153 *** libfishsound-$oggplay_FISHSOUND or greater does not seem to exist on your system.
154 *** Please install it and run this ./configure again.
162 PKG_CHECK_MODULES(THEORA, theora)
163 AC_SUBST(THEORA_CFLAGS)
164 AC_SUBST(THEORA_LIBS)
167 dnl Detect libschroedinger
169 PKG_CHECK_MODULES(SCHRO, schroedinger-1.0 >= 1.0.6, HAVE_SCHRO="yes", HAVE_SCHRO="no")
170 if test "x$HAVE_SCHRO" = "xyes" ; then
171 AC_DEFINE(HAVE_SCHRO, [], [Define if have libschroedinger-1.0])
172 SCHRO_CFLAGS="$SCHRO_CFLAGS"
173 AC_SUBST(SCHRO_CFLAGS)
176 AC_MSG_RESULT($HAVE_SCHRO)
182 PKG_CHECK_MODULES(KATE, kate, HAVE_KATE="yes", HAVE_KATE="no")
183 if test "x$HAVE_KATE" = "xyes" ; then
184 AC_DEFINE(HAVE_KATE, [], [Define if have libkate])
185 AC_SUBST(KATE_CFLAGS)
188 AC_MSG_RESULT($HAVE_KATE)
198 [Enable rendering of Kate streams with the Tiger rendering library, using Pango and Cairo (default autodetect)]
200 [use_tiger="$withval"]
202 if test "x$use_tiger" != "xno"; then
203 PKG_CHECK_MODULES(TIGER, tiger >= 0.3.1, HAVE_TIGER="yes", HAVE_TIGER="no")
204 if test "x$HAVE_TIGER" = "xyes" ; then
205 AC_DEFINE(HAVE_TIGER, [], [Define if have libtiger])
206 AC_SUBST(TIGER_CFLAGS)
209 AC_MSG_RESULT($HAVE_TIGER)
210 if test "x$use_tiger" = "xyes"; then
211 AC_MSG_ERROR([libtiger could not be found and was explicitely requested])
219 dnl Detect Imlib2 (used by dump-all-streams example)
221 PKG_CHECK_MODULES(IMLIB2, imlib2, HAVE_IMLIB2="yes", HAVE_IMLIB2="no")
222 if test "x$HAVE_IMLIB2" = "xyes" ; then
223 oggplay_tools="$oggplay_tools oggplay-dump-first-frame"
224 AC_DEFINE(HAVE_IMLIB2, [], [Define if have Imlib2])
225 AC_SUBST(IMLIB2_LIBS)
226 AC_SUBST(IMLIB2_CFLAGS)
228 AC_MSG_RESULT($HAVE_IMLIB2)
230 AM_CONDITIONAL(HAVE_IMLIB2, [test "x$HAVE_IMLIB2" = "xyes"])
235 dnl Detect libsndfile1 (used by dump-all-streams example)
238 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
239 HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")
241 if test "x$HAVE_LIBSNDFILE1" = xyes ; then
242 oggplay_examples="$oggplay_examples dump-all-streams"
243 AC_DEFINE(HAVE_LIBSNDFILE1, [], [Define if have libsndfile])
244 AC_SUBST(SNDFILE_CFLAGS)
245 AC_SUBST(SNDFILE_LIBS)
247 AM_CONDITIONAL(HAVE_LIBSNDFILE1, [test "x$HAVE_LIBSNDFILE1" = "xyes"])
250 dnl Detect pthreads libraries
254 AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread")
255 if test "x$PTHREAD_LIBS" = xerror; then
256 AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads")
258 if test "x$PTHREAD_LIBS" = xerror; then
259 AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r")
261 if test "x$PTHREAD_LIBS" = xerror; then
262 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
264 AC_SUBST(PTHREAD_LIBS)
275 [ --disable-glut disable building of GLUT player],
276 [ ac_enable_glut=no ], [ ac_enable_glut=yes ])
278 if test "x${ac_enable_glut}" != xno ; then
279 dnl XXX: On MacOSX, assume we have GLUT and OpenGL frameworks
280 if test "x$HAVE_FRAMEWORKS" = "xyes" ; then
283 GLUT_FRAMEWORKS="-framework GLUT -framework OpenGL"
285 AC_SUBST(GLUT_FRAMEWORKS)
287 AC_CHECK_LIB(glut, glutInit, HAVE_GLUT="maybe", , [-lGL -lm "$PTHREAD_LIBS"])
288 if test "x$HAVE_GLUT" = "xmaybe" ; then
289 AC_CHECK_HEADER([GL/glut.h], HAVE_GLUT="yes", HAVE_GLUT="no")
291 if test "x$HAVE_GLUT" = xyes ; then
292 GLUT_LIBS="-lglut -lGL -lm $PTHREAD_LIBS"
296 if test "x$HAVE_GLUT" = xyes ; then
297 oggplay_glut="glut-player"
298 AC_DEFINE([HAVE_GLUT], [], [Define if we have GLUT.])
301 *** glut-player will NOT be built. GLUT could not be found."
306 (glut-player will NOT be built, disabled by './configure --disable-glut')"
308 AM_CONDITIONAL(HAVE_GLUT, [test "x$HAVE_GLUT" = "xyes"])
310 SEMAPHORE_LIBS="-lpthread"
311 AC_SUBST(SEMAPHORE_LIBS)
313 dnl Use -Wall if we have gcc.
314 dnl changequote(,)dnl
315 if test "x$ac_cv_prog_gcc" = xyes ; then
316 CFLAGS="$CFLAGS -Wall -g"
318 dnl changequote([,])dnl
320 dnl Checks for __attribute__(aligned()) directive
321 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
322 [ac_cv_c_attribute_aligned],
323 [ac_cv_c_attribute_aligned=0
324 CFLAGS_save="${CFLAGS}"
325 CFLAGS="${CFLAGS} -Werror"
326 for ac_cv_c_attr_align_try in 64 32 16 8; do
328 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
329 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
330 if test "$ac_cv_c_attribute_aligned" != 0; then
334 CFLAGS="${CFLAGS_save}"])
335 if test "${ac_cv_c_attribute_aligned}" != "0"; then
336 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
337 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
344 dnl Configuration tests complete -- provide summary of results.
347 if test $oggplay_config_ok = no ; then
350 **************************************************************
352 *** $PACKAGE $VERSION: Automatic configuration FAILED.
354 *** The file config.log has full details.
356 *** The following required libraries are missing or
357 *** misconfigured on your system:
360 if test "x$HAVE_OGGZ" != xyes ; then
362 [*** liboggz, available from http://www.annodex.net/])
365 if test "x$HAVE_FISHSOUND" != xyes ; then
367 [*** libfishsound, available from http://www.annodex.net/])
371 [*** If you install the required libraries from source, you
372 *** need to inform the dynamic linker of their location. If
373 *** you install them in a system-wide directory such as
374 *** /usr/local (the default), you must ensure that
375 *** /usr/local/lib is listed in /etc/ld.so.conf, then run
376 *** ldconfig to update the dynamic linking system.
377 *** Alternatively, you can set your LD_LIBRARY_PATH environment
378 *** variable to include the library installation directory.
383 [**************************************************************
389 *** After fixing the above problems, you must run ./configure again.
395 AC_SUBST(SHLIB_VERSION_ARG)
396 AC_SUBST(SHARED_VERSION_INFO)
401 include/oggplay/Makefile
403 src/liboggplay/Makefile
404 src/liboggplay/Version_script
405 src/examples/Makefile
409 oggplay-uninstalled.pc
412 AS_AC_EXPAND(LIBDIR, ${libdir})
413 AS_AC_EXPAND(INCLUDEDIR, ${includedir})
414 AS_AC_EXPAND(BINDIR, ${bindir})
417 ------------------------------------------------------------------------
418 $PACKAGE $VERSION: Automatic configuration OK.
424 Examples (./src/examples):
426 $oggplay_examples $oggplay_glut
430 liboggplay: .................. ${LIBDIR}
431 C header files: .............. ${INCLUDEDIR}/oggplay
435 Type 'make' to compile $PACKAGE.
437 Type 'make install' to install $PACKAGE.
441 Example programs will be built but not installed.
443 Kate support: .................. ${HAVE_KATE}
444 Dirac support: ................. ${HAVE_SCHRO}
445 Tiger support: ................. ${HAVE_TIGER}
446 ------------------------------------------------------------------------