[xiph-cvs] cvs commit: theora configure.ac configure.in

Ralph Giles giles at xiph.org
Sun Mar 7 20:12:10 PST 2004



giles       04/03/07 23:12:10

  Added:       .        configure.ac
  Removed:     .        configure.in
  Log:
  Rename configure.in to configure.ac. (autotools modernization)

Revision  Changes    Path
1.1                  theora/configure.ac

Index: configure.ac
===================================================================
dnl Process this file with autoconf to produce a configure script

dnl ------------------------------------------------
dnl Initialization and Versioning
dnl ------------------------------------------------

AC_INIT(lib/dct.c)
AM_INIT_AUTOMAKE(libtheora,0.0)

dnl Library versioning

V_LIB_CURRENT=0
V_LIB_REVISION=0
V_LIB_AGE=0
AC_SUBST(V_LIB_CURRENT)
AC_SUBST(V_LIB_REVISION)
AC_SUBST(V_LIB_AGE)

dnl --------------------------------------------------  
dnl Check for programs
dnl --------------------------------------------------  

dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
dnl if $CFLAGS is blank
cflags_save="$CFLAGS"
AC_PROG_CC
AC_PROG_CPP
CFLAGS="$cflags_save"

dnl no shared linking for us
AM_DISABLE_SHARED
AM_ENABLE_STATIC
AM_PROG_LIBTOOL

dnl --------------------------------------------------
dnl Set build flags based on environment
dnl --------------------------------------------------

AC_CANONICAL_HOST

dnl Set some target options

cflags_save="$CFLAGS"
ldflags_save="$LDFLAGS"
if test -z "$GCC"; then
        case $host in 
        *)
                DEBUG="-g"
                CFLAGS="-O"
                PROFILE="-g -p" ;;
        esac
else

        case $host in 
        *)
                DEBUG="-g -W -D__NO_MATH_INLINES"
                CFLAGS="-O2 -Wall"
                PROFILE="-W -pg -g -O2 -fno-inline-functions";;
        esac
fi
CFLAGS="$CFLAGS $cflags_save -D_REENTRANT"
LDFLAGS="$LDFLAGS $ldflags_save"

dnl --------------------------------------------------
dnl Check for headers
dnl --------------------------------------------------

dnl none here

dnl --------------------------------------------------
dnl Check for typedefs, structures, etc
dnl --------------------------------------------------

dnl none

dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------

dnl substitue the included getopt if the system doesn't support long options
AC_CHECK_FUNC(getopt_long, [GETOPT_OBJS=''], [GETOPT_OBJS='getopt.$(OBJEXT) getopt1.$(OBJEXT)'])
AC_SUBST(GETOPT_OBJS)

XIPH_PATH_OGG(, AC_MSG_ERROR([
    libogg is required to build this package!
    please see http://www.xiph.org/ for how to
    obtain a copy.
]))
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_CHECK_FUNC(oggpackB_read, , [
  AC_MSG_ERROR([newer libogg version (>1.0) required])
])

AM_PATH_SDL(,[
        HAVE_SDL=yes
        SDL_LIBS=`$SDL_CONFIG --libs`
],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***]))

AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
  HAVE_OSS=yes
  break
])

AC_CHECK_LIB(portaudio, Pa_OpenStream, [
  AC_CHECK_HEADER(portaudio.h, [HAVE_PORTAUDIO=yes])
  ],,[-lpthread]
)
if test "$HAVE_PORTAUDIO" = "no"; then
  AC_MSG_WARN([portaudio not found -- not compiling splayer example])
fi

if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes; then
  BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example"
fi
if test x$HAVE_SDL = xyes -a x$HAVE_PORTAUDIO = xyes; then
  BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES splayer"
fi
AC_SUBST(BUILDABLE_EXAMPLES)

dnl --------------------------------------------------
dnl Do substitutions
dnl --------------------------------------------------

LIBS="$LIBS"

AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)

AC_OUTPUT(Makefile lib/Makefile include/Makefile include/theora/Makefile \
        doc/Makefile examples/Makefile debian/Makefile)

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list