1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
8 AM_INIT_AUTOMAKE(libtheora,0.0)
10 dnl Library versioning
15 AC_SUBST(V_LIB_CURRENT)
16 AC_SUBST(V_LIB_REVISION)
19 dnl --------------------------------------------------
20 dnl Check for programs
21 dnl --------------------------------------------------
23 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
24 dnl if $CFLAGS is blank
30 dnl no shared linking for us
35 dnl --------------------------------------------------
36 dnl Set build flags based on environment
37 dnl --------------------------------------------------
41 dnl Set some target options
44 ldflags_save="$LDFLAGS"
45 if test -z "$GCC"; then
56 DEBUG="-g -W -D__NO_MATH_INLINES"
58 PROFILE="-W -pg -g -O2 -fno-inline-functions";;
61 CFLAGS="$CFLAGS $cflags_save -D_REENTRANT"
62 LDFLAGS="$LDFLAGS $ldflags_save"
64 dnl --------------------------------------------------
66 dnl --------------------------------------------------
70 dnl --------------------------------------------------
71 dnl Check for typedefs, structures, etc
72 dnl --------------------------------------------------
76 dnl --------------------------------------------------
77 dnl Check for library functions
78 dnl --------------------------------------------------
80 dnl substitue the included getopt if the system doesn't support long options
81 AC_CHECK_FUNC(getopt_long, [GETOPT_OBJS=''], [GETOPT_OBJS='getopt.$(OBJEXT) getopt1.$(OBJEXT)'])
84 XIPH_PATH_OGG(, AC_MSG_ERROR([
85 libogg is required to build this package!
86 please see http://www.xiph.org/ for how to
89 CFLAGS="$CFLAGS $OGG_CFLAGS"
90 LIBS="$LIBS $OGG_LIBS"
91 AC_CHECK_FUNC(oggpackB_read, , [
92 AC_MSG_ERROR([newer libogg version (>1.0) required])
97 SDL_LIBS=`$SDL_CONFIG --static-libs`
98 ],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))
100 AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
105 AC_CHECK_LIB(portaudio, Pa_OpenStream, [
106 AC_CHECK_HEADER(portaudio.h, [HAVE_PORTAUDIO=yes])
109 if test "$HAVE_PORTAUDIO" = "no"; then
110 AC_MSG_WARN([portaudio not found -- not compiling splayer example])
113 if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes; then
114 BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example"
116 if test x$HAVE_SDL = xyes -a x$HAVE_PORTAUDIO = xyes; then
117 BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES splayer"
119 AC_SUBST(BUILDABLE_EXAMPLES)
121 dnl --------------------------------------------------
123 dnl --------------------------------------------------
131 AC_OUTPUT(Makefile lib/Makefile include/Makefile include/theora/Makefile \
132 doc/Makefile examples/Makefile debian/Makefile)