dnl ------------------------------------------------
AC_INIT(lib/mdct.c)
-AM_INIT_AUTOMAKE(libvorbis,1.0.0)
+AM_INIT_AUTOMAKE(libvorbis,1.0rc2)
dnl Library versioning
V_LIB_CURRENT=0
-V_LIB_REVISION=0
+V_LIB_REVISION=1
V_LIB_AGE=0
-VF_LIB_CURRENT=0
+VF_LIB_CURRENT=1
VF_LIB_REVISION=0
-VF_LIB_AGE=0
+VF_LIB_AGE=1
+VE_LIB_CURRENT=0
+VE_LIB_REVISION=1
+VE_LIB_AGE=0
AC_SUBST(V_LIB_CURRENT)
AC_SUBST(V_LIB_REVISION)
AC_SUBST(V_LIB_AGE)
AC_SUBST(VF_LIB_CURRENT)
AC_SUBST(VF_LIB_REVISION)
AC_SUBST(VF_LIB_AGE)
+AC_SUBST(VE_LIB_CURRENT)
+AC_SUBST(VE_LIB_REVISION)
+AC_SUBST(VE_LIB_AGE)
dnl --------------------------------------------------
dnl Check for programs
dnl if $CFLAGS is blank
cflags_save="$CFLAGS"
AC_PROG_CC
+AC_PROG_CPP
CFLAGS="$cflags_save"
AM_PROG_LIBTOOL
-dnl --------------------------------------------------
-dnl Additional arguments
-dnl --------------------------------------------------
-
-AC_ARG_WITH(ogg, [ --with-ogg=DIR Set where the Ogg library is located])
-
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
*-*-irix*)
*86-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
-# PROFILE="-Wall -W -pg -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
- PROFILE="-Wall -W -pg -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline -static"
+# PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+ PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline -static"
# glibc < 2.1.3 has a serious FP bug in the math inline header
# that will cripple Vorbis. Look to see if the magic FP stack
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
+ *-*-darwin*)
+ DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
+ CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
+ PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
esac
fi
-
-AC_HEADER_STDC
-
-dnl AC_PATH_X
-dnl AC_PATH_XTRA
-
-#AC_CHECK_LIB(pthread, pthread_create,
-# pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
-# We no longer use config.h
-AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
-
-#dnl Linuxthreads require you to define _REENTRANT in all threaded
-#dnl code. Bogus, bogus...
-#
-#if test -n "$pthread_lib"; then
-# case $host in
-# i?86-*-linux*)
-# AC_DEFINE(_REENTRANT)
-# ;;
-# esac
-#fi
-# We no longer use config.h
-
-#if test -n "$x_libraries"; then
-# XOGG="yes"
-#
-# dnl If we find libgtk installed, great; otherwise assume we have
-# dnl to build it ourselves.
-#
-# AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
-#
-# dnl libpthread is required for xogg.
-#
-# if test -z "$pthread_lib"; then XOGG=""; fi
-#
-# dnl If we don't have libgtk installed, and we don't have a libgtk
-# dnl subdirectory to build the library ourself, we can't build xogg.
-#
-# if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
-# XOGG=""
-# LIBGTKDIR=""
-# fi
-#fi
-
-dnl This seems to be the only way to make autoconf only *sometimes* configure
-dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
-dnl exist as a directory, so configure won't try to recursively enter it, unless
-dnl the shell variable $dummy is reset to an existing directory inside the
-dnl if clause.
-
-dummy="__noconf"
-
-#if test -d "$LIBGTKDIR"; then
-# enable_shared="no"; export enable_shared
-# dummy="libgtk"
-# AC_CONFIG_SUBDIRS("$dummy")
-# X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
-#fi
-
-# check macro modified from Jon Shiring's to compensate for autoconf's lagging
-# behind the times on type madness
-
-AC_MSG_CHECKING(for int16_t)
-AC_CACHE_VAL(has_int16_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int16_t foo;
-int main() {return 0;}
-],
-has_int16_t=yes,
-has_int16_t=no,
-has_int16_t=no
-)])
-AC_MSG_RESULT($has_int16_t)
-
-AC_MSG_CHECKING(for int32_t)
-AC_CACHE_VAL(has_int32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int32_t foo;
-int main() {return 0;}
-],
-has_int32_t=yes,
-has_int32_t=no,
-has_int32_t=no
-)])
-AC_MSG_RESULT($has_int32_t)
-
-AC_MSG_CHECKING(for uint32_t)
-AC_CACHE_VAL(has_uint32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-uint32_t foo;
-int main() {return 0;}
-],
-has_uint32_t=yes,
-has_uint32_t=no,
-has_uint32_t=no
-)])
-AC_MSG_RESULT($has_uint32_t)
-
-AC_MSG_CHECKING(for u_int32_t)
-AC_CACHE_VAL(has_u_int32_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-u_int32_t foo;
-int main() {return 0;}
-],
-has_u_int32_t=yes,
-has_u_int32_t=no,
-has_u_int32_t=no
-)])
-AC_MSG_RESULT($has_u_int32_t)
-
-AC_MSG_CHECKING(for int64_t)
-AC_CACHE_VAL(has_int64_t,
-[AC_TRY_RUN([
-#ifdef __BEOS__
-#include <inttypes.h>
-#endif
-#include <sys/types.h>
-int64_t foo;
-int main() {return 0;}
-],
-has_int64_t=yes,
-has_int64_t=no,
-has_int64_t=no
-)])
-AC_MSG_RESULT($has_int64_t)
-
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
-
-if test x$has_int16_t = "xyes" ; then
- SIZE16="int16_t"
-else
- case 2 in
- $ac_cv_sizeof_short) SIZE16="short";;
- $ac_cv_sizeof_int) SIZE16="int";;
- esac
-fi
+CFLAGS="$CFLAGS $cflags_save"
+LDFLAGS="$LDFLAGS $ldflags_save"
dnl --------------------------------------------------
dnl Check for headers
AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
-dnl Check for libogg
-if test -n $with_ogg; then
- CFLAGS="$CFLAGS -I$with_ogg/include -L$with_ogg/lib"
-fi
-AC_CHECK_LIB(ogg, oggpack_read, LIBS="$LIBS -logg", AC_MSG_ERROR([You must have libogg to compile vorbis!!!]))
+AM_PATH_OGG(LIBS="$LIBS $OGG_LIBS", AC_MSG_ERROR(must have Ogg installed!))
dnl --------------------------------------------------
dnl Check for library functions
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(sqrtf)
+AC_CHECK_FUNCS(logf)
+AC_CHECK_FUNCS(expf)
+AC_CHECK_FUNCS(acosf)
+AC_CHECK_FUNCS(atanf)
+AC_CHECK_FUNCS(frexpf)
+AC_CHECK_FUNCS(rintf)
+
dnl --------------------------------------------------
dnl Do substitutions
dnl --------------------------------------------------
-AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
-AC_SUBST(CC)
AC_SUBST(pthread_lib)
-AC_OUTPUT(Makefile lib/Makefile doc/Makefile include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile)
+AC_OUTPUT(Makefile lib/Makefile lib/modes/Makefile lib/books/Makefile doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile include/Makefile include/vorbis/Makefile examples/Makefile win32/Makefile debian/Makefile vq/Makefile)