annotate src/opusfile-0.9/configure.ac @ 169:223a55898ab9 tip default

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