123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- dnl Process this file with autoconf to produce a configure script
- dnl ------------------------------------------------
- dnl Initialization and Versioning
- dnl ------------------------------------------------
- AC_INIT(lib/mdct.c)
- AM_INIT_AUTOMAKE(libvorbis,1.0.0)
- dnl Library versioning
- LIB_CURRENT=0
- LIB_REVISION=0
- LIB_AGE=0
- AC_SUBST(LIB_CURRENT)
- AC_SUBST(LIB_REVISION)
- AC_SUBST(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
- 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
- if test -z "$GCC"; then
- case $host in
- *-*-irix*)
- dnl If we're on IRIX, we wanna use cc even if gcc
- dnl is there (unless the user has overriden us)...
- if test -z "$CC"; then
- CC=cc
- fi
- DEBUG="-g -signed"
- CFLAGS="-O2 -w -signed"
- PROFILE="-p -g3 -O2 -signed" ;;
- sparc-sun-solaris*)
- DEBUG="-v -g"
- CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
- PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
- *)
- DEBUG="-g"
- CFLAGS="-O"
- PROFILE="-g -p" ;;
- esac
- else
- case $host in
- *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"
- # 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
- # clobber is missing in the mathinline header, thus indicating
- # the buggy version
- AC_EGREP_CPP(log10.*fldlg2.*fxch,[
- #define __LIBC_INTERNAL_MATH_INLINES 1
- #define __OPTIMIZE__
- #include <math.h>
- ],bad=maybe,bad=no)
- if test ${bad} = "maybe" ;then
- AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
- [
- #define __LIBC_INTERNAL_MATH_INLINES 1
- #define __OPTIMIZE__
- #include <math.h>
- ],bad=no,bad=yes)
- fi
- if test ${bad} = "yes" ;then
- AC_MSG_WARN([ ])
- AC_MSG_WARN([********************************************************])
- AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
- AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
- AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
- AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
- AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
- AC_MSG_WARN([* will not fix any previously built programs; this is *])
- AC_MSG_WARN([* a compile-time time bug. *])
- AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
- AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
- AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
- AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
- AC_MSG_WARN([* configure and make to build with inlining. *])
- AC_MSG_WARN([********************************************************])
- AC_MSG_WARN([ ])
- CFLAGS=${OPT}" -D__NO_MATH_INLINES"
- PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
- fi;;
- *-*-linux*)
- DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
- PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
- sparc-sun-*)
- 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" ;;
- *)
- 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
- dnl --------------------------------------------------
- dnl Check for headers
- dnl --------------------------------------------------
- AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
- dnl --------------------------------------------------
- dnl Check for typedefs, structures, etc
- dnl --------------------------------------------------
- dnl none
- dnl --------------------------------------------------
- dnl Check for libraries
- dnl --------------------------------------------------
- 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!!!]))
- dnl --------------------------------------------------
- dnl Check for library functions
- dnl --------------------------------------------------
- AC_FUNC_ALLOCA
- AC_FUNC_MEMCMP
- 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)
|