Commit c939c736 authored by Ron's avatar Ron

More autoconf housekeeping

Don't let AC_SEARCH_LIBS([lrintf]) add -lm to LIBS, otherwise we'll
unconditionally link everything with it.

Correctly handle the third possibility of AC_SEARCH_LIBS, that no
library at all was found.

Link libopusfile with $lrintf_lib, it uses it and will otherwise fail
with linkers that use --no-add-needed / --no-copy-dt-needed-entries.

Don't bother to test for doxygen if using it is --disable'd.
parent 8df43f7c
...@@ -12,7 +12,7 @@ libopusfile_la_SOURCES = \ ...@@ -12,7 +12,7 @@ libopusfile_la_SOURCES = \
src/info.c \ src/info.c \
src/internal.c src/internal.h \ src/internal.c src/internal.h \
src/opusfile.c src/stream.c src/opusfile.c src/stream.c
libopusfile_la_LIBADD = $(DEPS_LIBS) libopusfile_la_LIBADD = $(DEPS_LIBS) $(lrintf_lib)
libopusfile_la_LDFLAGS = -no-undefined \ libopusfile_la_LDFLAGS = -no-undefined \
-version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@ -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
......
...@@ -13,6 +13,7 @@ m4_define([CURRENT_VERSION], ...@@ -13,6 +13,7 @@ m4_define([CURRENT_VERSION],
AC_INIT([opusfile],[CURRENT_VERSION],[opus@xiph.org]) AC_INIT([opusfile],[CURRENT_VERSION],[opus@xiph.org])
AC_CONFIG_SRCDIR([src/opusfile.c]) AC_CONFIG_SRCDIR([src/opusfile.c])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
...@@ -23,8 +24,6 @@ LT_INIT ...@@ -23,8 +24,6 @@ LT_INIT
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
dnl Library versioning for libtool. dnl Library versioning for libtool.
dnl Please update these for releases. dnl Please update these for releases.
dnl CURRENT, REVISION, AGE dnl CURRENT, REVISION, AGE
...@@ -113,18 +112,22 @@ AS_IF([test "$enable_float" = "no"], ...@@ -113,18 +112,22 @@ AS_IF([test "$enable_float" = "no"],
AS_IF([test "$enable_fixed_point" = "yes"], AS_IF([test "$enable_fixed_point" = "yes"],
[AC_DEFINE([OP_FIXED_POINT], [1], [Enable fixed-point calculation])], [AC_DEFINE([OP_FIXED_POINT], [1], [Enable fixed-point calculation])],
[dnl This only has to be tested for if float->fixed conversions are required [dnl This only has to be tested for if float->fixed conversions are required
saved_LIBS="$LIBS"
AC_SEARCH_LIBS([lrintf], [m], [ AC_SEARCH_LIBS([lrintf], [m], [
AC_DEFINE([OP_HAVE_LRINTF], [1], [Enable use of lrintf function]) AC_DEFINE([OP_HAVE_LRINTF], [1], [Enable use of lrintf function])
lrintf_notice=" lrintf_notice="
Library for lrintf() ......... ${ac_cv_search_lrintf}" Library for lrintf() ......... ${ac_cv_search_lrintf}"
]) ])
LIBS="$saved_LIBS"
] ]
) )
lrintf_lib="$ac_cv_search_lrintf"
AS_IF([test "$ac_cv_search_lrintf" = "none required"], AS_CASE(["$ac_cv_search_lrintf"],
[lrintf_lib=""] ["no"],[],
) ["none required"],[],
AC_SUBST(lrintf_lib) [lrintf_lib="$ac_cv_search_lrintf"])
AC_SUBST([lrintf_lib])
CC_ATTRIBUTE_VISIBILITY([default], [ CC_ATTRIBUTE_VISIBILITY([default], [
CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"]) CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
...@@ -135,12 +138,14 @@ AC_ARG_ENABLE([doc], ...@@ -135,12 +138,14 @@ AC_ARG_ENABLE([doc],
AS_HELP_STRING([--disable-doc], [Do not build API documentation]),, AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
[enable_doc=yes] [enable_doc=yes]
) )
AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, yes, no)
if test "$HAVE_DOXYGEN" != "yes" -o "$enable_doc" != "yes" ; then AS_IF([test "$enable_doc" = "yes"], [
HAVE_DOXYGEN="no" AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
enable_doc="no" ],[
fi HAVE_DOXYGEN=no
AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes]) ])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment