annotate src/opusfile-0.9/configure.ac @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 7aeed7906520
children
rev   line source
Chris@69 1 # autoconf source script for generating configure
Chris@69 2
Chris@69 3 dnl The package_version file will be automatically synced to the git revision
Chris@69 4 dnl by the update_version script when configured in the repository, but will
Chris@69 5 dnl remain constant in tarball releases unless it is manually edited.
Chris@69 6 m4_define([CURRENT_VERSION],
Chris@69 7 m4_esyscmd([ ./update_version 2>/dev/null || true
Chris@69 8 if test -e package_version; then
Chris@69 9 . ./package_version
Chris@69 10 printf "$PACKAGE_VERSION"
Chris@69 11 else
Chris@69 12 printf "unknown"
Chris@69 13 fi ]))
Chris@69 14
Chris@69 15 AC_INIT([opusfile],[CURRENT_VERSION],[opus@xiph.org])
Chris@69 16 AC_CONFIG_SRCDIR([src/opusfile.c])
Chris@69 17 AC_CONFIG_MACRO_DIR([m4])
Chris@69 18
Chris@69 19 AC_USE_SYSTEM_EXTENSIONS
Chris@69 20 AC_SYS_LARGEFILE
Chris@69 21
Chris@69 22 AM_INIT_AUTOMAKE([1.11 foreign no-define dist-zip subdir-objects])
Chris@69 23 AM_MAINTAINER_MODE([enable])
Chris@69 24 LT_INIT
Chris@69 25
Chris@69 26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Chris@69 27
Chris@69 28 dnl Library versioning for libtool.
Chris@69 29 dnl Please update these for releases.
Chris@69 30 dnl CURRENT, REVISION, AGE
Chris@69 31 dnl - library source changed -> increment REVISION
Chris@69 32 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
Chris@69 33 dnl - interfaces added -> increment AGE
Chris@69 34 dnl - interfaces removed -> AGE = 0
Chris@69 35
Chris@69 36 OP_LT_CURRENT=4
Chris@69 37 OP_LT_REVISION=2
Chris@69 38 OP_LT_AGE=4
Chris@69 39
Chris@69 40 AC_SUBST(OP_LT_CURRENT)
Chris@69 41 AC_SUBST(OP_LT_REVISION)
Chris@69 42 AC_SUBST(OP_LT_AGE)
Chris@69 43
Chris@69 44 CC_CHECK_CFLAGS_APPEND(
Chris@69 45 [-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long])
Chris@69 46
Chris@69 47 # Platform-specific tweaks
Chris@69 48 case $host in
Chris@69 49 *-mingw*)
Chris@69 50 # -std=c89 causes some warnings under mingw.
Chris@69 51 CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
Chris@69 52 # We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
Chris@69 53 # It's okay to define this even when HTTP support is disabled, as it only
Chris@69 54 # affects header declarations, not linking (unless we actually use some
Chris@69 55 # XP-only functions).
Chris@69 56 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
Chris@69 57 [We need at least WindowsXP for getaddrinfo/freeaddrinfo])
Chris@69 58 host_mingw=true
Chris@69 59 ;;
Chris@69 60 esac
Chris@69 61 AM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true")
Chris@69 62
Chris@69 63 AC_ARG_ENABLE([assertions],
Chris@69 64 AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
Chris@69 65 enable_assertions=no)
Chris@69 66
Chris@69 67 AS_IF([test "$enable_assertions" = "yes"], [
Chris@69 68 AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
Chris@69 69 ])
Chris@69 70
Chris@69 71 AC_ARG_ENABLE([http],
Chris@69 72 AS_HELP_STRING([--disable-http], [Disable HTTP support]),,
Chris@69 73 enable_http=yes)
Chris@69 74
Chris@69 75 AM_COND_IF(OP_WIN32,
Chris@69 76 AS_IF([test "$enable_http" != "no"],
Chris@69 77 AC_CHECK_HEADER([winsock2.h],,
Chris@69 78 AC_MSG_WARN([HTTP support requires a Winsock socket library.])
Chris@69 79 enable_http=no
Chris@69 80 )
Chris@69 81 ),
Chris@69 82 AS_IF([test "$enable_http" != "no"],
Chris@69 83 AC_CHECK_HEADER([sys/socket.h],,
Chris@69 84 AC_MSG_WARN([HTTP support requires a POSIX socket library.])
Chris@69 85 enable_http=no
Chris@69 86 )
Chris@69 87 )
Chris@69 88 )
Chris@69 89 AC_SEARCH_LIBS(ftime, [compat], , [enable_http=no])
Chris@69 90
Chris@69 91 m4_ifndef([PKG_PROG_PKG_CONFIG],
Chris@69 92 [m4_fatal([Could not locate the pkg-config autoconf macros.
Chris@69 93 Please make sure pkg-config is installed and, if necessary, set the environment
Chris@69 94 variable ACLOCAL="aclocal -I/path/to/pkg.m4".])])
Chris@69 95
Chris@69 96 AS_IF([test "$enable_http" != "no"], [
Chris@69 97 openssl="openssl"
Chris@69 98 AC_DEFINE([OP_ENABLE_HTTP], [1], [Enable HTTP support])
Chris@69 99 PKG_CHECK_MODULES([URL_DEPS], [openssl])
Chris@69 100 ])
Chris@69 101 AM_CONDITIONAL(OP_ENABLE_HTTP, [test "$enable_http" != "no"])
Chris@69 102 AC_SUBST([openssl])
Chris@69 103
Chris@69 104 PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 opus >= 1.0.1])
Chris@69 105
Chris@69 106 AC_ARG_ENABLE([fixed-point],
Chris@69 107 AS_HELP_STRING([--enable-fixed-point], [Enable fixed-point calculation]),,
Chris@69 108 enable_fixed_point=no)
Chris@69 109 AC_ARG_ENABLE([float],
Chris@69 110 AS_HELP_STRING([--disable-float], [Disable floating-point API]),,
Chris@69 111 enable_float=yes)
Chris@69 112
Chris@69 113 AS_IF([test "$enable_float" = "no"],
Chris@69 114 [enable_fixed_point=yes
Chris@69 115 AC_DEFINE([OP_DISABLE_FLOAT_API], [1], [Disable floating-point API])
Chris@69 116 ]
Chris@69 117 )
Chris@69 118
Chris@69 119 AS_IF([test "$enable_fixed_point" = "yes"],
Chris@69 120 [AC_DEFINE([OP_FIXED_POINT], [1], [Enable fixed-point calculation])],
Chris@69 121 [dnl This only has to be tested for if float->fixed conversions are required
Chris@69 122 saved_LIBS="$LIBS"
Chris@69 123 AC_SEARCH_LIBS([lrintf], [m], [
Chris@69 124 AC_DEFINE([OP_HAVE_LRINTF], [1], [Enable use of lrintf function])
Chris@69 125 lrintf_notice="
Chris@69 126 Library for lrintf() ......... ${ac_cv_search_lrintf}"
Chris@69 127 ])
Chris@69 128 LIBS="$saved_LIBS"
Chris@69 129 ]
Chris@69 130 )
Chris@69 131
Chris@69 132 AC_ARG_ENABLE([examples],
Chris@69 133 AS_HELP_STRING([--disable-examples], [Do not build example applications]),,
Chris@69 134 enable_examples=yes)
Chris@69 135 AM_CONDITIONAL([OP_ENABLE_EXAMPLES], [test "$enable_examples" = "yes"])
Chris@69 136
Chris@69 137 AS_CASE(["$ac_cv_search_lrintf"],
Chris@69 138 ["no"],[],
Chris@69 139 ["none required"],[],
Chris@69 140 [lrintf_lib="$ac_cv_search_lrintf"])
Chris@69 141
Chris@69 142 AC_SUBST([lrintf_lib])
Chris@69 143
Chris@69 144 CC_ATTRIBUTE_VISIBILITY([default], [
Chris@69 145 CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
Chris@69 146 ])
Chris@69 147
Chris@69 148 dnl Check for doxygen
Chris@69 149 AC_ARG_ENABLE([doc],
Chris@69 150 AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
Chris@69 151 [enable_doc=yes]
Chris@69 152 )
Chris@69 153
Chris@69 154 AS_IF([test "$enable_doc" = "yes"], [
Chris@69 155 AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
Chris@69 156 AC_CHECK_PROG([HAVE_DOT], [dot], [yes], [no])
Chris@69 157 ],[
Chris@69 158 HAVE_DOXYGEN=no
Chris@69 159 ])
Chris@69 160
Chris@69 161 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
Chris@69 162
Chris@69 163 AC_CONFIG_FILES([
Chris@69 164 Makefile
Chris@69 165 opusfile.pc
Chris@69 166 opusurl.pc
Chris@69 167 opusfile-uninstalled.pc
Chris@69 168 opusurl-uninstalled.pc
Chris@69 169 doc/Doxyfile
Chris@69 170 ])
Chris@69 171 AC_CONFIG_HEADERS([config.h])
Chris@69 172 AC_OUTPUT
Chris@69 173
Chris@69 174 AC_MSG_NOTICE([
Chris@69 175 ------------------------------------------------------------------------
Chris@69 176 $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
Chris@69 177
Chris@69 178 Assertions ................... ${enable_assertions}
Chris@69 179
Chris@69 180 HTTP support ................. ${enable_http}
Chris@69 181 Fixed-point .................. ${enable_fixed_point}
Chris@69 182 Floating-point API ........... ${enable_float}${lrintf_notice}
Chris@69 183
Chris@69 184 Hidden visibility ............ ${cc_cv_flag_visibility}
Chris@69 185
Chris@69 186 API code examples ............ ${enable_examples}
Chris@69 187 API documentation ............ ${enable_doc}
Chris@69 188 ------------------------------------------------------------------------
Chris@69 189 ])