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.2.0)
10 AM_CONFIG_HEADER(config.h)
12 SHARED_VERSION_INFO="2:0:1"
26 dnl Add parameters for aclocal
27 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
29 dnl Checks for library functions
30 AC_CHECK_FUNCS([assert])
32 dnl Check for pkg-config
33 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
36 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
37 AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
38 if test $HAVE_DOXYGEN = "false"; then
39 AC_MSG_WARN([*** doxygen not found, docs will not be built])
43 VALGRIND_ENVIRONMENT=""
45 AC_ARG_ENABLE(valgrind-testing,
46 [ --enable-valgrind-testing enable running of tests inside Valgrind ], [ ac_enable_valgrind=yes ], [ ac_enable_valgrind=no] )
48 if test "x${ac_enable_valgrind}" = xyes ; then
49 if test "x${enable_shared}" = xyes ; then
50 VALGRIND_ENVIRONMENT="libtool --mode=execute "
53 AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
54 if test "x$HAVE_VALGRIND" = xyes ; then
55 VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
56 AC_SUBST(VALGRIND_ENVIRONMENT)
57 TESTS_INFO="Type 'make check' to run test suite. Tests will be run under:
58 ${VALGRIND_ENVIRONMENT}"
60 TESTS_INFO="Type 'make check' to run test suite (Valgrind not found)"
62 else TESTS_INFO="Type 'make check' to run test suite (Valgrind testing not enabled)"
65 dnl Overall configuration success flag
68 oggplay_tools="oggplay-info"
69 oggplay_examples="get-stream-info"
73 dnl Configuration option to add -Werror to all Makefiles
76 AC_ARG_ENABLE(gcc-werror,
77 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
78 [ ac_enable_gcc_werror=yes ], [ ac_enable_gcc_werror=no] )
80 if test "x${ac_enable_gcc_werror}" = xyes ; then
81 CFLAGS="-Werror $CFLAGS"
85 dnl Configure for target platform
90 dnl Disable -Wall and -pedantic for Apple Darwin/Rhapsody.
91 dnl System headers on these systems are broken.
92 temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall -pedantic//"`
94 dnl add extra mac-specific directories to include path
95 CFLAGS="$CFLAGS -I/Developer/Headers/FlatCarbon/"
97 AC_SUBST(PLATFORM,"mac")
100 SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
101 AC_SUBST(PLATFORM,"linux")
107 dnl Define MACOSX for the benefit of altering link likes
108 dnl in the build for that platform
109 AM_CONDITIONAL(MACOS, test "x$HAVE_FRAMEWORKS" = "xyes")
115 dnl Minimum required version of liboggz
118 PKG_CHECK_MODULES(OGGZ, oggz >= "$oggplay_OGGZ", HAVE_OGGZ="yes", HAVE_OGGZ="no")
120 if test "$HAVE_OGGZ" = "yes" ; then
121 AC_DEFINE(HAVE_OGGZ, [], [Define if have liboggz])
122 AC_SUBST(OGGZ_CFLAGS)
125 PKG_CHECK_MODULES(OGGZ, oggz, HAVE_OGGZ="old")
127 if test "$HAVE_OGGZ" = "old" ; then
129 *** The version of liboggz installed on your system is too old. You need
130 *** liboggz version greater than $oggplay_OGGZ to build liboggplay.
134 *** liboggz-$oggplay_OGGZ or greater does not seem to exist on your system.
135 *** Please install it and run this ./configure again.
141 dnl Detect libfishsound
144 dnl Minimum required version of libfishsound
145 oggplay_FISHSOUND="0.9.1"
147 PKG_CHECK_MODULES(FISHSOUND, fishsound >= "$oggplay_FISHSOUND", HAVE_FISHSOUND="yes", HAVE_FISHSOUND="no")
149 if test "$HAVE_FISHSOUND" = "yes" ; then
150 AC_DEFINE(HAVE_FISHSOUND, [], [Define if have libfishsound])
151 AC_SUBST(FISHSOUND_CFLAGS)
152 AC_SUBST(FISHSOUND_LIBS)
154 PKG_CHECK_MODULES(FISHSOUND, fishsound, HAVE_FISHSOUND="old")
156 if test "$HAVE_FISHSOUND" = "old" ; then
158 *** The version of libfishsound installed on your system is too old. You need
159 *** at least libfishsound version $oggplay_FISHSOUND to build liboggplay.
163 *** libfishsound-$oggplay_FISHSOUND or greater does not seem to exist on your system.
164 *** Please install it and run this ./configure again.
172 PKG_CHECK_MODULES(THEORA, theora)
173 AC_SUBST(THEORA_CFLAGS)
174 AC_SUBST(THEORA_LIBS)
179 PKG_CHECK_MODULES(KATE, kate, HAVE_KATE="yes", HAVE_KATE="no")
180 if test "x$HAVE_KATE" = "xyes" ; then
181 AC_DEFINE(HAVE_KATE, [], [Define if have libkate])
182 AC_SUBST(KATE_CFLAGS)
185 AC_MSG_RESULT($HAVE_KATE)
195 [Enable rendering of Kate streams with the Tiger rendering library, using Pango and Cairo (default autodetect)]
197 [use_tiger="$withval"]
199 if test "x$use_tiger" != "xno"; then
200 PKG_CHECK_MODULES(TIGER, tiger >= 0.3.1, HAVE_TIGER="yes", HAVE_TIGER="no")
201 if test "x$HAVE_TIGER" = "xyes" ; then
202 AC_DEFINE(HAVE_TIGER, [], [Define if have libtiger])
203 AC_SUBST(TIGER_CFLAGS)
206 AC_MSG_RESULT($HAVE_TIGER)
207 if test "x$use_tiger" = "xyes"; then
208 AC_MSG_ERROR([libtiger could not be found and was explicitely requested])
216 dnl Detect Imlib2 (used by dump-all-streams example)
218 PKG_CHECK_MODULES(IMLIB2, imlib2, HAVE_IMLIB2="yes", HAVE_IMLIB2="no")
219 if test "x$HAVE_IMLIB2" = "xyes" ; then
220 oggplay_tools="$oggplay_tools oggplay-dump-first-frame"
221 AC_DEFINE(HAVE_IMLIB2, [], [Define if have Imlib2])
222 AC_SUBST(IMLIB2_LIBS)
223 AC_SUBST(IMLIB2_CFLAGS)
225 AC_MSG_RESULT($HAVE_IMLIB2)
227 AM_CONDITIONAL(HAVE_IMLIB2, [test "x$HAVE_IMLIB2" = "xyes"])
232 dnl Detect libsndfile1 (used by dump-all-streams example)
235 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
236 HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")
238 if test "x$HAVE_LIBSNDFILE1" = xyes ; then
239 oggplay_examples="$oggplay_examples dump-all-streams"
240 AC_DEFINE(HAVE_LIBSNDFILE1, [], [Define if have libsndfile])
241 AC_SUBST(SNDFILE_CFLAGS)
242 AC_SUBST(SNDFILE_LIBS)
244 AM_CONDITIONAL(HAVE_LIBSNDFILE1, [test "x$HAVE_LIBSNDFILE1" = "xyes"])
247 dnl Detect pthreads libraries
251 AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread")
252 if test "x$PTHREAD_LIBS" = xerror; then
253 AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads")
255 if test "x$PTHREAD_LIBS" = xerror; then
256 AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r")
258 if test "x$PTHREAD_LIBS" = xerror; then
259 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
261 AC_SUBST(PTHREAD_LIBS)
272 [ --disable-glut disable building of GLUT player],
273 [ ac_enable_glut=no ], [ ac_enable_glut=yes ])
275 if test "x${ac_enable_glut}" != xno ; then
276 dnl XXX: On MacOSX, assume we have GLUT and OpenGL frameworks
277 if test "x$HAVE_FRAMEWORKS" = "xyes" ; then
280 GLUT_FRAMEWORKS="-framework GLUT -framework OpenGL"
282 AC_SUBST(GLUT_FRAMEWORKS)
284 AC_CHECK_LIB(glut, glutInit, HAVE_GLUT="maybe", , [-lGL -lm "$PTHREAD_LIBS"])
285 if test "x$HAVE_GLUT" = "xmaybe" ; then
286 AC_CHECK_HEADER([GL/glut.h], HAVE_GLUT="yes", HAVE_GLUT="no")
288 if test "x$HAVE_GLUT" = xyes ; then
289 GLUT_LIBS="-lglut -lGL -lm $PTHREAD_LIBS"
293 if test "x$HAVE_GLUT" = xyes ; then
294 oggplay_glut="glut-player"
295 AC_DEFINE([HAVE_GLUT], [], [Define if we have GLUT.])
298 *** glut-player will NOT be built. GLUT could not be found."
303 (glut-player will NOT be built, disabled by './configure --disable-glut')"
305 AM_CONDITIONAL(HAVE_GLUT, [test "x$HAVE_GLUT" = "xyes"])
307 SEMAPHORE_LIBS="-lpthread"
308 AC_SUBST(SEMAPHORE_LIBS)
310 dnl Use -Wall if we have gcc.
311 dnl changequote(,)dnl
312 if test "x$ac_cv_prog_gcc" = xyes ; then
313 CFLAGS="$CFLAGS -Wall -g"
315 dnl changequote([,])dnl
317 dnl Checks for __attribute__(aligned()) directive
318 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
319 [ac_cv_c_attribute_aligned],
320 [ac_cv_c_attribute_aligned=0
321 CFLAGS_save="${CFLAGS}"
322 CFLAGS="${CFLAGS} -Werror"
323 for ac_cv_c_attr_align_try in 64 32 16 8; do
325 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
326 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
327 if test "$ac_cv_c_attribute_aligned" != 0; then
331 CFLAGS="${CFLAGS_save}"])
332 if test "${ac_cv_c_attribute_aligned}" != "0"; then
333 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
334 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
341 dnl Configuration tests complete -- provide summary of results.
344 if test $oggplay_config_ok = no ; then
347 **************************************************************
349 *** $PACKAGE $VERSION: Automatic configuration FAILED.
351 *** The file config.log has full details.
353 *** The following required libraries are missing or
354 *** misconfigured on your system:
357 if test "x$HAVE_OGGZ" != xyes ; then
359 [*** liboggz, available from http://www.annodex.net/])
362 if test "x$HAVE_FISHSOUND" != xyes ; then
364 [*** libfishsound, available from http://www.annodex.net/])
368 [*** If you install the required libraries from source, you
369 *** need to inform the dynamic linker of their location. If
370 *** you install them in a system-wide directory such as
371 *** /usr/local (the default), you must ensure that
372 *** /usr/local/lib is listed in /etc/ld.so.conf, then run
373 *** ldconfig to update the dynamic linking system.
374 *** Alternatively, you can set your LD_LIBRARY_PATH environment
375 *** variable to include the library installation directory.
380 [**************************************************************
386 *** After fixing the above problems, you must run ./configure again.
392 AC_SUBST(SHLIB_VERSION_ARG)
393 AC_SUBST(SHARED_VERSION_INFO)
400 include/oggplay/Makefile
402 src/liboggplay/Makefile
403 src/liboggplay/Version_script
404 src/examples/Makefile
408 oggplay-uninstalled.pc
411 AS_AC_EXPAND(LIBDIR, ${libdir})
412 AS_AC_EXPAND(INCLUDEDIR, ${includedir})
413 AS_AC_EXPAND(BINDIR, ${bindir})
414 AS_AC_EXPAND(DOCDIR, ${datadir}/doc)
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
432 Documentation: ............... ${DOCDIR}/$PACKAGE
436 Type 'make' to compile $PACKAGE.
438 Type 'make install' to install $PACKAGE.
442 Example programs will be built but not installed.
444 Kate support: .................. ${HAVE_KATE}
445 Tiger support: ................. ${HAVE_TIGER}
446 ------------------------------------------------------------------------