annotate src/libsamplerate-0.1.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 481f5f8c5634
children
rev   line source
Chris@41 1 # Copyright (C) 2002-2011 Erik de Castro Lopo (erikd AT mega-nerd DOT com).
Chris@41 2
Chris@41 3 dnl Require autoconf version
Chris@41 4 AC_PREREQ(2.57)
Chris@41 5
Chris@41 6 AC_INIT([libsamplerate],[0.1.9],[erikd@mega-nerd.com],
Chris@41 7 [libsamplerate],[http://www.mega-nerd.com/libsamplerate/])
Chris@41 8
Chris@41 9 # Put config stuff in Cfg.
Chris@41 10 AC_CONFIG_AUX_DIR(Cfg)
Chris@41 11
Chris@41 12 AC_CONFIG_SRCDIR([src/samplerate.c])
Chris@41 13 AC_CANONICAL_TARGET([])
Chris@41 14
Chris@41 15 AC_CONFIG_MACRO_DIR([M4])
Chris@41 16 AC_CONFIG_HEADERS([src/config.h])
Chris@41 17
Chris@41 18 AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
Chris@41 19 AM_SILENT_RULES([yes])
Chris@41 20
Chris@41 21 dnl Add parameters for aclocal
Chris@41 22 AC_SUBST(ACLOCAL_AMFLAGS, "-I M4")
Chris@41 23
Chris@41 24 AC_LANG([C])
Chris@41 25
Chris@41 26 AC_PROG_CC
Chris@41 27 AM_PROG_CC_C_O
Chris@41 28 AC_PROG_CXX
Chris@41 29 AC_PROG_SED
Chris@41 30
Chris@41 31 # Do not check for F77.
Chris@41 32 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
Chris@41 33
Chris@41 34 AM_PROG_LIBTOOL
Chris@41 35 LT_PROG_RC
Chris@41 36
Chris@41 37 AC_PROG_INSTALL
Chris@41 38 AC_PROG_LN_S
Chris@41 39
Chris@41 40 #------------------------------------------------------------------------------------
Chris@41 41 # Rules for library version information:
Chris@41 42 #
Chris@41 43 # 1. Start with version information of `0:0:0' for each libtool library.
Chris@41 44 # 2. Update the version information only immediately before a public release of
Chris@41 45 # your software. More frequent updates are unnecessary, and only guarantee
Chris@41 46 # that the current interface number gets larger faster.
Chris@41 47 # 3. If the library source code has changed at all since the last update, then
Chris@41 48 # increment revision (`c:r:a' becomes `c:r+1:a').
Chris@41 49 # 4. If any interfaces have been added, removed, or changed since the last update,
Chris@41 50 # increment current, and set revision to 0.
Chris@41 51 # 5. If any interfaces have been added since the last public release, then increment
Chris@41 52 # age.
Chris@41 53 # 6. If any interfaces have been removed since the last public release, then set age
Chris@41 54 # to 0.
Chris@41 55
Chris@41 56 SHARED_VERSION_INFO="1:8:1"
Chris@41 57
Chris@41 58
Chris@41 59
Chris@41 60
Chris@41 61
Chris@41 62 AC_PROG_MAKE_SET
Chris@41 63 AC_PROG_LN_S
Chris@41 64 AC_PROG_MKDIR_P
Chris@41 65
Chris@41 66 if test "x-$build_os-$host_os-$target_os" = x-mingw32-mingw32-mingw32 ; then
Chris@41 67 AC_CHECK_PROG(DLLTOOL, dlltool, dlltool)
Chris@41 68 AC_CHECK_PROG(DLLWRAP, dllwrap, dllwrap)
Chris@41 69 AC_CHECK_PROG(PEXPORTS, pexports, pexports)
Chris@41 70 fi
Chris@41 71
Chris@41 72 AC_HEADER_STDC
Chris@41 73
Chris@41 74 AC_CHECK_HEADERS(stdint.h sys/times.h)
Chris@41 75
Chris@41 76 #====================================================================================
Chris@41 77 # Couple of initializations here. Fill in real values later.
Chris@41 78
Chris@41 79 SHLIB_VERSION_ARG=""
Chris@41 80
Chris@41 81 #====================================================================================
Chris@41 82 # Finished checking, handle options.
Chris@41 83
Chris@41 84 AC_ARG_ENABLE(gcc-werror,
Chris@41 85 AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
Chris@41 86 ac_arg_gcc_werror=yes, ac_arg_gcc_werror=no)
Chris@41 87
Chris@41 88 AC_ARG_ENABLE(gcc-pipe,
Chris@41 89 AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option ]),
Chris@41 90 ac_arg_gcc_pipe="N", ac_arg_gcc_pipe="Y")
Chris@41 91
Chris@41 92 AC_ARG_ENABLE(gcc-opt,
Chris@41 93 AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations ]),
Chris@41 94 ac_arg_gcc_opt="N", ac_arg_gcc_opt="Y")
Chris@41 95
Chris@41 96 AC_ARG_ENABLE(fftw,
Chris@41 97 AC_HELP_STRING([--disable-fftw], [disable usage of FFTW ]),
Chris@41 98 ac_arg_fftw="N", ac_arg_fftw="Y")
Chris@41 99
Chris@41 100 AC_ARG_ENABLE(cpu-clip,
Chris@41 101 AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
Chris@41 102 ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")
Chris@41 103
Chris@41 104 #====================================================================================
Chris@41 105 # Check types and their sizes.
Chris@41 106
Chris@41 107 AC_CHECK_SIZEOF(int,0)
Chris@41 108 AC_CHECK_SIZEOF(long,0)
Chris@41 109 AC_CHECK_SIZEOF(float,4)
Chris@41 110 AC_CHECK_SIZEOF(double,8)
Chris@41 111
Chris@41 112 #====================================================================================
Chris@41 113 # Determine endian-ness of target processor.
Chris@41 114
Chris@41 115 AC_C_FIND_ENDIAN
Chris@41 116
Chris@41 117 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
Chris@41 118 [Target processor is big endian.])
Chris@41 119 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
Chris@41 120 [Target processor is little endian.])
Chris@41 121
Chris@41 122 #====================================================================================
Chris@41 123 # Check for functions.
Chris@41 124
Chris@41 125 AC_CHECK_FUNCS(malloc calloc free memcpy memmove alarm signal)
Chris@41 126
Chris@41 127 AC_CHECK_LIB([m],floor)
Chris@41 128 AC_CHECK_FUNCS(floor ceil fmod)
Chris@41 129
Chris@41 130 AC_CHECK_SIGNAL(SIGALRM)
Chris@41 131
Chris@41 132 AC_C99_FUNC_LRINT
Chris@41 133 AC_C99_FUNC_LRINTF
Chris@41 134 # AC_C99_FUNC_LLRINT Don't need this (yet?).
Chris@41 135
Chris@41 136 case "x$ac_cv_c99_lrint$ac_cv_c99_lrintf" in
Chris@41 137 xyesyes)
Chris@41 138 ;;
Chris@41 139 *)
Chris@41 140 AC_MSG_WARN([[*** Missing C99 standard functions lrint() and lrintf().]])
Chris@41 141 AC_MSG_WARN([[*** This may cause benign compiler warnings on some systems (ie Solaris).]])
Chris@41 142 ;;
Chris@41 143 esac
Chris@41 144
Chris@41 145 #====================================================================================
Chris@41 146 # Determine if the processor can do clipping on float to int conversions.
Chris@41 147
Chris@41 148 if test x$ac_arg_cpu_clip = "xY" ; then
Chris@41 149 AC_C_CLIP_MODE
Chris@41 150 else
Chris@41 151 echo "checking processor clipping capabilities... disabled"
Chris@41 152 ac_cv_c_clip_positive=0
Chris@41 153 ac_cv_c_clip_negative=0
Chris@41 154 fi
Chris@41 155
Chris@41 156 AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive},
Chris@41 157 [Target processor clips on positive float to int conversion.])
Chris@41 158 AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative},
Chris@41 159 [Target processor clips on negative float to int conversion.])
Chris@41 160
Chris@41 161 #====================================================================================
Chris@41 162 # Check for libsndfile which is required for the test and example programs.
Chris@41 163
Chris@41 164 AC_ARG_ENABLE(sndfile,
Chris@41 165 AC_HELP_STRING([--disable-sndfile], [disable support for sndfile (default=autodetect)]),
Chris@41 166 [ enable_sndfile=$enableval ], [ enable_sndfile=yes ])
Chris@41 167
Chris@41 168 # Check for pkg-config outside the if statement.
Chris@41 169 PKG_PROG_PKG_CONFIG
Chris@41 170
Chris@41 171 if test "x$enable_sndfile" = "xyes"; then
Chris@41 172 PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.6, ac_cv_sndfile=1, ac_cv_sndfile=0)
Chris@41 173 else
Chris@41 174 ac_cv_sndfile=0
Chris@41 175 fi
Chris@41 176
Chris@41 177 AC_DEFINE_UNQUOTED([HAVE_SNDFILE],$ac_cv_sndfile,[Set to 1 if you have libsndfile.])
Chris@41 178
Chris@41 179 if test x$ac_cv_sndfile = x1 ; then
Chris@41 180 ac_cv_sndfile=yes
Chris@41 181 HAVE_SNDFILE=1
Chris@41 182 else
Chris@41 183 ac_cv_sndfile=no
Chris@41 184 HAVE_SNDFILE=0
Chris@41 185 fi
Chris@41 186
Chris@41 187 #====================================================================================
Chris@41 188 # Check for ALSA.
Chris@41 189
Chris@41 190 ALSA_LIBS=""
Chris@41 191
Chris@41 192 if test x$enable_alsa != xno ; then
Chris@41 193 AC_CHECK_HEADERS(alsa/asoundlib.h)
Chris@41 194 if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
Chris@41 195 ALSA_LIBS="-lasound"
Chris@41 196 enable_alsa=yes
Chris@41 197 fi
Chris@41 198 fi
Chris@41 199
Chris@41 200 #====================================================================================
Chris@41 201 # Check for libfftw3 which is required for the test and example programs.
Chris@41 202
Chris@41 203 if test $ac_arg_fftw = "Y" ; then
Chris@41 204 PKG_CHECK_MODULES(FFTW3, fftw3 >= 0.15.0, ac_cv_fftw3=1, ac_cv_fftw3=0)
Chris@41 205 AC_DEFINE_UNQUOTED([HAVE_FFTW3],$ac_cv_fftw3,[Set to 1 if you have libfftw3.])
Chris@41 206
Chris@41 207 if test x$ac_cv_fftw3 = x1 ; then
Chris@41 208 ac_cv_fftw3=yes
Chris@41 209 HAVE_FFTW3=1
Chris@41 210 fi
Chris@41 211 fi
Chris@41 212
Chris@41 213 if test x$ac_cv_fftw3 != xyes ; then
Chris@41 214 ac_cv_fftw3=no
Chris@41 215 HAVE_FFTW3=0
Chris@41 216 fi
Chris@41 217
Chris@41 218 #====================================================================================
Chris@41 219 # GCC stuff.
Chris@41 220
Chris@41 221 if test $ac_cv_c_compiler_gnu = yes ; then
Chris@41 222 CFLAGS="$CFLAGS -std=gnu99 -W -Wstrict-prototypes -Wmissing-prototypes -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wpointer-arith"
Chris@41 223 # -Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion -Winline"
Chris@41 224 if test "$ac_arg_gcc_opt" = "N" ; then
Chris@41 225 temp_CFLAGS=`echo $CFLAGS | sed "s/O2/O0/"`
Chris@41 226 CFLAGS=$temp_CFLAGS
Chris@41 227 AC_MSG_WARN([[*** Compiler optimisations switched off. ***]])
Chris@41 228 fi
Chris@41 229
Chris@41 230 # Disable -Wall for Apple Darwin/Rhapsody.
Chris@41 231 # System headers on these systems are broken.
Chris@41 232 case "$target_os" in
Chris@41 233 darwin* | rhapsody*)
Chris@41 234 temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall//"`
Chris@41 235 CFLAGS=$temp_CFLAGS
Chris@41 236 ;;
Chris@41 237
Chris@41 238 linux*|kfreebsd*-gnu*|gnu*)
Chris@41 239 SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
Chris@41 240 ;;
Chris@41 241 *)
Chris@41 242 ;;
Chris@41 243 esac
Chris@41 244 if test x$ac_arg_gcc_pipe != "xN" ; then
Chris@41 245 CFLAGS="$CFLAGS -pipe"
Chris@41 246 fi
Chris@41 247
Chris@41 248 if test x$ac_arg_gcc_werror = "xyes" ; then
Chris@41 249 CFLAGS="-Werror $CFLAGS"
Chris@41 250 fi
Chris@41 251
Chris@41 252 AC_DEFINE([COMPILER_IS_GCC],1, [Set to 1 if the compile is GNU GCC.])
Chris@41 253 GCC_MAJOR_VERSION=`$CC -dumpversion | sed "s/\..*//"`
Chris@41 254 AC_DEFINE_UNQUOTED([GCC_MAJOR_VERSION],${GCC_MAJOR_VERSION}, [Major version of GCC or 3 otherwise.])
Chris@41 255 fi
Chris@41 256
Chris@41 257 #====================================================================================
Chris@41 258 # Find known target OS.
Chris@41 259
Chris@41 260 OS_SPECIFIC_INCLUDES=""
Chris@41 261 os_is_win32=0
Chris@41 262
Chris@41 263 case "$target_os" in
Chris@41 264 darwin* | rhapsody*)
Chris@41 265 OS_SPECIFIC_INCLUDES="-fpascal-strings -I/Developer/Headers/FlatCarbon"
Chris@41 266 OS_SPECIFIC_LINKS="-framework CoreAudio"
Chris@41 267 ;;
Chris@41 268 mingw32*)
Chris@41 269 OS_SPECIFIC_LINKS="-lwinmm"
Chris@41 270 os_is_win32=1
Chris@41 271 ;;
Chris@41 272 *)
Chris@41 273 OS_SPECIFIC_INCLUDES=""
Chris@41 274 OS_SPECIFIC_LINKS=""
Chris@41 275 ;;
Chris@41 276 esac
Chris@41 277
Chris@41 278 htmldocdir=$prefix/share/doc/libsamplerate0-dev/html
Chris@41 279
Chris@41 280 if test $prefix = "NONE" ; then
Chris@41 281 htmldocdir=/usr/local/share/doc/libsamplerate0-dev/html
Chris@41 282 else
Chris@41 283 htmldocdir=$prefix/share/doc/libsamplerate0-dev/html
Chris@41 284 fi
Chris@41 285
Chris@41 286 #====================================================================================
Chris@41 287 # Now use the information from the checking stage.
Chris@41 288
Chris@41 289 AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32])
Chris@41 290
Chris@41 291 AC_SUBST(htmldocdir)
Chris@41 292
Chris@41 293 AC_SUBST(SHLIB_VERSION_ARG)
Chris@41 294 AC_SUBST(SHARED_VERSION_INFO)
Chris@41 295 AC_SUBST(OS_SPECIFIC_INCLUDES)
Chris@41 296 AC_SUBST(OS_SPECIFIC_LINKS)
Chris@41 297
Chris@41 298 AC_SUBST(COMPILER_IS_GCC)
Chris@41 299 AC_SUBST(GCC_MAJOR_VERSION)
Chris@41 300
Chris@41 301 AC_SUBST(HAVE_FFTW3)
Chris@41 302 AC_SUBST(FFTW3_CFLAGS)
Chris@41 303 AC_SUBST(FFTW3_LIBS)
Chris@41 304
Chris@41 305 AC_SUBST(HAVE_SNDFILE)
Chris@41 306 AC_SUBST(SNDFILE_CFLAGS)
Chris@41 307 AC_SUBST(SNDFILE_LIBS)
Chris@41 308
Chris@41 309 AC_SUBST(ALSA_LIBS)
Chris@41 310
Chris@41 311 AC_CONFIG_FILES([Makefile M4/Makefile src/Version_script \
Chris@41 312 Win32/Makefile Win32/Makefile.mingw \
Chris@41 313 src/Makefile examples/Makefile tests/Makefile doc/Makefile \
Chris@41 314 libsamplerate.spec samplerate.pc])
Chris@41 315 AC_OUTPUT
Chris@41 316
Chris@41 317 #====================================================================================
Chris@41 318
Chris@41 319 AC_MSG_RESULT([
Chris@41 320 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-=-
Chris@41 321
Chris@41 322 Configuration summary :
Chris@41 323
Chris@41 324 Version : ..................... ${VERSION}
Chris@41 325
Chris@41 326 Host CPU : .................... ${host_cpu}
Chris@41 327 Host Vendor : ................. ${host_vendor}
Chris@41 328 Host OS : ..................... ${host_os}
Chris@41 329 ])
Chris@41 330
Chris@41 331 if test x$ac_cv_c_compiler_gnu = xyes ; then
Chris@41 332 echo -e " Tools :\n"
Chris@41 333 echo " Compiler is GCC : ............. ${ac_cv_c_compiler_gnu}"
Chris@41 334 echo " GCC major version : ........... ${GCC_MAJOR_VERSION}"
Chris@41 335 fi
Chris@41 336
Chris@41 337 AC_MSG_RESULT([
Chris@41 338 Extra tools required for testing and examples :
Chris@41 339
Chris@41 340 Have FFTW : ................... ${ac_cv_fftw3}])
Chris@41 341
Chris@41 342 AC_MSG_RESULT([ Have libsndfile : ............. ${ac_cv_sndfile}])
Chris@41 343 AC_MSG_RESULT([ Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h}
Chris@41 344 ])
Chris@41 345
Chris@41 346 AC_MSG_RESULT([ Installation directories :
Chris@41 347
Chris@41 348 Library directory : ........... ${prefix}/lib
Chris@41 349 Program directory : ........... ${prefix}/bin
Chris@41 350 Pkgconfig directory : ......... ${prefix}/lib/pkgconfig
Chris@41 351 ])
Chris@41 352
Chris@41 353 if test x$prefix != "x/usr" ; then
Chris@41 354 echo "Compiling some other packages against ${PACKAGE} may require "
Chris@41 355 echo -e "the addition of \"${prefix}/lib/pkgconfig\" to the "
Chris@41 356 echo -e "PKG_CONFIG_PATH environment variable.\n"
Chris@41 357 fi
Chris@41 358