Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-05-14 08:30:34 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-05-16 00:24:07 +0400
commit6c83b0bd965ef5ec2bf0bf131f1168d5ebe47bb4 (patch)
treecf5d6d0c2d9c522f3f08e90f8e17acb8259f2e11
parent981a2804ea5b240f75e59c00101dce63c91e1c77 (diff)
Improve portability to BeOS via some configure.ac fixes and cleanups.
-rw-r--r--configure.ac30
1 files changed, 19 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 77e09340..df65008c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,11 @@ has_alloca=no
)
AC_MSG_RESULT($has_alloca)
-AC_CHECK_LIB(m, sin)
+AC_CHECK_FUNC(exp,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno])
+if test x"$fp_libm_not_needed" = xdunno; then
+ AC_CHECK_LIB([m], [exp], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=])
+fi
+AC_SUBST([LIBM])
AC_DEFINE_UNQUOTED(OPUS_VERSION, "${OPUS_VERSION}", [Complete version string])
AC_DEFINE_UNQUOTED(OPUS_MAJOR_VERSION, ${OPUS_MAJOR_VERSION}, [Version major])
@@ -159,29 +163,37 @@ if test "$HAVE_DOXYGEN" != "yes" -o "$ac_enable_doc" != "yes"; then
fi
AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
-if test "$OPUS_BUILD" != "true" ; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
-AC_COMPILE_IFELSE([char foo;],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
[ AC_MSG_RESULT([yes])
SYMBOL_VISIBILITY="-fvisibility=hidden" ],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS $SYMBOL_VISIBILITY"
AC_SUBST(SYMBOL_VISIBILITY)
+
+if test $ac_cv_c_compiler_gnu = yes ; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-all"
AC_MSG_CHECKING([if ${CC} supports -fstack-protector-all])
-AC_COMPILE_IFELSE([char foo;],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
[ AC_MSG_RESULT([yes])
STACK_PROTECTOR="-fstack-protector-all" ],
AC_MSG_RESULT([no]))
CFLAGS="$saved_CFLAGS $STACK_PROTECTOR"
fi
-if test $ac_cv_c_compiler_gnu = yes ; then
- CFLAGS="$CFLAGS -W -Wstrict-prototypes -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow"
-fi
+CFLAGS="$CFLAGS -W"
+
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes"
+AC_MSG_CHECKING([if ${CC} supports -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
+ [ AC_MSG_RESULT([yes])
+ EXTRA_WARNS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes" ],
+ AC_MSG_RESULT([no]))
+CFLAGS="$saved_CFLAGS $EXTRA_WARNS"
AC_CHECK_FUNCS([lrintf])
AC_CHECK_FUNCS([lrint])
@@ -221,10 +233,6 @@ fi
AC_SUBST(SIZE16)
AC_SUBST(SIZE32)
-if test "$OPUS_BUILD" = "true" ; then
-AC_DEFINE(OPUS_BUILD, [], [We're part of Opus])
-fi
-
AM_CONDITIONAL([FIXED_POINT], [test x$ac_enable_fixed = xyes])
AM_CONDITIONAL([CUSTOM_MODES], [test x$ac_enable_custom_modes = xyes])