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")
99 linux* | solaris* | gnu* | k*bsd*-gnu)
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)
177 dnl Detect libskeleton
180 if test "x$HAVE_PKG_CONFIG" = "xyes" ; then
181 PKG_CHECK_MODULES(SKELETON, skeleton, HAVE_SKELETON="yes", HAVE_SKELETON="no")
183 if test "x$HAVE_SKELETON" = "xyes" ; then
184 AC_DEFINE(HAVE_SKELETON, [], [Define if have libskeleton])
185 AC_SUBST(SKELETON_CFLAGS)
186 AC_SUBST(SKELETON_LIBS)
188 AC_MSG_RESULT($HAVE_SKELETON)
195 PKG_CHECK_MODULES(KATE, kate, HAVE_KATE="yes", HAVE_KATE="no")
196 if test "x$HAVE_KATE" = "xyes" ; then
197 AC_DEFINE(HAVE_KATE, [], [Define if have libkate])
198 AC_SUBST(KATE_CFLAGS)
201 AC_MSG_RESULT($HAVE_KATE)
211 [Enable rendering of Kate streams with the Tiger rendering library, using Pango and Cairo (default autodetect)]
213 [use_tiger="$withval"]
215 if test "x$use_tiger" != "xno"; then
216 PKG_CHECK_MODULES(TIGER, tiger >= 0.3.1, HAVE_TIGER="yes", HAVE_TIGER="no")
217 if test "x$HAVE_TIGER" = "xyes" ; then
218 AC_DEFINE(HAVE_TIGER, [], [Define if have libtiger])
219 AC_SUBST(TIGER_CFLAGS)
222 AC_MSG_RESULT($HAVE_TIGER)
223 if test "x$use_tiger" = "xyes"; then
224 AC_MSG_ERROR([libtiger could not be found and was explicitely requested])
232 dnl Detect Imlib2 (used by dump-all-streams example)
234 PKG_CHECK_MODULES(IMLIB2, imlib2, HAVE_IMLIB2="yes", HAVE_IMLIB2="no")
235 if test "x$HAVE_IMLIB2" = "xyes" ; then
236 oggplay_tools="$oggplay_tools oggplay-dump-first-frame"
237 AC_DEFINE(HAVE_IMLIB2, [], [Define if have Imlib2])
238 AC_SUBST(IMLIB2_LIBS)
239 AC_SUBST(IMLIB2_CFLAGS)
241 AC_MSG_RESULT($HAVE_IMLIB2)
243 AM_CONDITIONAL(HAVE_IMLIB2, [test "x$HAVE_IMLIB2" = "xyes"])
248 dnl Detect libsndfile1 (used by dump-all-streams example)
251 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
252 HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")
254 if test "x$HAVE_LIBSNDFILE1" = xyes ; then
255 oggplay_examples="$oggplay_examples dump-all-streams"
256 AC_DEFINE(HAVE_LIBSNDFILE1, [], [Define if have libsndfile])
257 AC_SUBST(SNDFILE_CFLAGS)
258 AC_SUBST(SNDFILE_LIBS)
260 AM_CONDITIONAL(HAVE_LIBSNDFILE1, [test "x$HAVE_LIBSNDFILE1" = "xyes"])
263 dnl Detect pthreads libraries
267 AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread")
268 if test "x$PTHREAD_LIBS" = xerror; then
269 AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads")
271 if test "x$PTHREAD_LIBS" = xerror; then
272 AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r")
274 if test "x$PTHREAD_LIBS" = xerror; then
275 AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
277 AC_SUBST(PTHREAD_LIBS)
288 [ --disable-glut disable building of GLUT player],
289 [ ac_enable_glut=no ], [ ac_enable_glut=yes ])
291 if test "x${ac_enable_glut}" != xno ; then
292 dnl XXX: On MacOSX, assume we have GLUT and OpenGL frameworks
293 if test "x$HAVE_FRAMEWORKS" = "xyes" ; then
296 GLUT_FRAMEWORKS="-framework GLUT -framework OpenGL"
298 AC_SUBST(GLUT_FRAMEWORKS)
300 AC_CHECK_LIB(glut, glutInit, HAVE_GLUT="maybe", , [-lGL -lm "$PTHREAD_LIBS"])
301 if test "x$HAVE_GLUT" = "xmaybe" ; then
302 AC_CHECK_HEADER([GL/glut.h], HAVE_GLUT="yes", HAVE_GLUT="no")
304 if test "x$HAVE_GLUT" = xyes ; then
305 GLUT_LIBS="-lglut -lGL -lm $PTHREAD_LIBS"
309 if test "x$HAVE_GLUT" = xyes ; then
310 oggplay_glut="glut-player"
311 AC_DEFINE([HAVE_GLUT], [], [Define if we have GLUT.])
314 *** glut-player will NOT be built. GLUT could not be found."
319 (glut-player will NOT be built, disabled by './configure --disable-glut')"
321 AM_CONDITIONAL(HAVE_GLUT, [test "x$HAVE_GLUT" = "xyes"])
323 SEMAPHORE_LIBS="-lpthread"
324 AC_SUBST(SEMAPHORE_LIBS)
326 dnl Use -Wall if we have gcc.
327 dnl changequote(,)dnl
328 if test "x$ac_cv_prog_gcc" = xyes ; then
329 CFLAGS="$CFLAGS -Wall -g"
331 dnl changequote([,])dnl
333 dnl Checks for __attribute__(aligned()) directive
334 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
335 [ac_cv_c_attribute_aligned],
336 [ac_cv_c_attribute_aligned=0
337 CFLAGS_save="${CFLAGS}"
338 CFLAGS="${CFLAGS} -Werror"
339 for ac_cv_c_attr_align_try in 64 32 16 8; do
341 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
342 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
343 if test "$ac_cv_c_attribute_aligned" != 0; then
347 CFLAGS="${CFLAGS_save}"])
348 if test "${ac_cv_c_attribute_aligned}" != "0"; then
349 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
350 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
357 dnl Configuration tests complete -- provide summary of results.
360 if test $oggplay_config_ok = no ; then
363 **************************************************************
365 *** $PACKAGE $VERSION: Automatic configuration FAILED.
367 *** The file config.log has full details.
369 *** The following required libraries are missing or
370 *** misconfigured on your system:
373 if test "x$HAVE_OGGZ" != xyes ; then
375 [*** liboggz, available from http://www.annodex.net/])
378 if test "x$HAVE_FISHSOUND" != xyes ; then
380 [*** libfishsound, available from http://www.annodex.net/])
384 [*** If you install the required libraries from source, you
385 *** need to inform the dynamic linker of their location. If
386 *** you install them in a system-wide directory such as
387 *** /usr/local (the default), you must ensure that
388 *** /usr/local/lib is listed in /etc/ld.so.conf, then run
389 *** ldconfig to update the dynamic linking system.
390 *** Alternatively, you can set your LD_LIBRARY_PATH environment
391 *** variable to include the library installation directory.
396 [**************************************************************
402 *** After fixing the above problems, you must run ./configure again.
408 AC_SUBST(SHLIB_VERSION_ARG)
409 AC_SUBST(SHARED_VERSION_INFO)
416 include/oggplay/Makefile
418 src/liboggplay/Makefile
419 src/liboggplay/Version_script
420 src/examples/Makefile
424 oggplay-uninstalled.pc
427 AS_AC_EXPAND(LIBDIR, ${libdir})
428 AS_AC_EXPAND(INCLUDEDIR, ${includedir})
429 AS_AC_EXPAND(BINDIR, ${bindir})
430 AS_AC_EXPAND(DOCDIR, ${datadir}/doc)
433 ------------------------------------------------------------------------
434 $PACKAGE $VERSION: Automatic configuration OK.
440 Examples (./src/examples):
442 $oggplay_examples $oggplay_glut
446 liboggplay: .................. ${LIBDIR}
447 C header files: .............. ${INCLUDEDIR}/oggplay
448 Documentation: ............... ${DOCDIR}/$PACKAGE
452 Type 'make' to compile $PACKAGE.
454 Type 'make install' to install $PACKAGE.
458 Example programs will be built but not installed.
460 Kate support: .................. ${HAVE_KATE}
461 Tiger support: ................. ${HAVE_TIGER}
462 ------------------------------------------------------------------------