annotate src/libsndfile-1.0.27/configure.ac @ 79:91c729825bca pa_catalina

Update build for AUDIO_COMPONENT_FIX
author Chris Cannam
date Wed, 30 Oct 2019 12:40:34 +0000
parents 1df64224f5ac
children
rev   line source
Chris@40 1 # Copyright (C) 1999-2016 Erik de Castro Lopo <erikd@mega-nerd.com>.
Chris@40 2
Chris@40 3 dnl Require autoconf version
Chris@40 4 AC_PREREQ(2.57)
Chris@40 5
Chris@40 6 AC_INIT([libsndfile],[1.0.27],[sndfile@mega-nerd.com],
Chris@40 7 [libsndfile],[http://www.mega-nerd.com/libsndfile/])
Chris@40 8
Chris@40 9 # Put config stuff in Cfg.
Chris@40 10 AC_CONFIG_AUX_DIR(Cfg)
Chris@40 11 AC_CONFIG_MACRO_DIR([M4])
Chris@40 12
Chris@40 13 AC_CONFIG_SRCDIR([src/sndfile.c])
Chris@40 14 AC_CANONICAL_TARGET([])
Chris@40 15
Chris@40 16 AC_CONFIG_HEADERS([src/config.h])
Chris@40 17
Chris@40 18 AM_INIT_AUTOMAKE
Chris@40 19 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Chris@40 20
Chris@40 21 AC_LANG([C])
Chris@40 22
Chris@40 23 AC_PROG_CC_STDC
Chris@40 24 AC_USE_SYSTEM_EXTENSIONS
Chris@40 25 AM_PROG_CC_C_O
Chris@40 26 AC_PROG_CXX
Chris@40 27
Chris@40 28 MN_C_COMPILER_IS_CLANG
Chris@40 29 MN_GCC_REALLY_IS_GCC
Chris@40 30
Chris@40 31 AC_PROG_SED
Chris@40 32
Chris@40 33 # Do not check for F77.
Chris@40 34 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
Chris@40 35
Chris@40 36 AM_PROG_LIBTOOL
Chris@40 37 LT_PROG_RC
Chris@40 38
Chris@40 39 AC_PROG_INSTALL
Chris@40 40 AC_PROG_LN_S
Chris@40 41
Chris@40 42 AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no)
Chris@40 43 AC_CHECK_PROG(HAVE_WINE, wine, yes, no)
Chris@40 44 AC_CHECK_PROG(HAVE_XCODE_SELECT, xcode-select, yes, no)
Chris@40 45
Chris@40 46 #------------------------------------------------------------------------------------
Chris@40 47 # Rules for library version information:
Chris@40 48 #
Chris@40 49 # 1. Start with version information of `0:0:0' for each libtool library.
Chris@40 50 # 2. Update the version information only immediately before a public release of
Chris@40 51 # your software. More frequent updates are unnecessary, and only guarantee
Chris@40 52 # that the current interface number gets larger faster.
Chris@40 53 # 3. If the library source code has changed at all since the last update, then
Chris@40 54 # increment revision (`c:r:a' becomes `c:r+1:a').
Chris@40 55 # 4. If any interfaces have been added, removed, or changed since the last update,
Chris@40 56 # increment current, and set revision to 0.
Chris@40 57 # 5. If any interfaces have been added since the last public release, then increment
Chris@40 58 # age.
Chris@40 59 # 6. If any interfaces have been removed since the last public release, then set age
Chris@40 60 # to 0.
Chris@40 61
Chris@40 62 CLEAN_VERSION=`echo $PACKAGE_VERSION | $SED "s/p.*//"`
Chris@40 63 VERSION_MINOR=`echo $CLEAN_VERSION | $SED "s/.*\.//"`
Chris@40 64
Chris@40 65 SHARED_VERSION_INFO="1:$VERSION_MINOR:0"
Chris@40 66
Chris@40 67 #------------------------------------------------------------------------------------
Chris@40 68
Chris@40 69 AC_HEADER_STDC
Chris@40 70
Chris@40 71 AC_CHECK_HEADERS(endian.h)
Chris@40 72 AC_CHECK_HEADERS(byteswap.h)
Chris@40 73 AC_CHECK_HEADERS(locale.h)
Chris@40 74 AC_CHECK_HEADERS(sys/time.h)
Chris@40 75
Chris@40 76 AC_HEADER_SYS_WAIT
Chris@40 77
Chris@40 78 AC_CHECK_DECLS(S_IRGRP)
Chris@40 79 if test x$ac_cv_have_decl_S_IRGRP = xyes ; then
Chris@40 80 AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],1,[Set to 1 if S_IRGRP is defined.])
Chris@40 81 else
Chris@40 82 AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],0)
Chris@40 83 fi
Chris@40 84
Chris@40 85 AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST],
Chris@40 86 [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"])
Chris@40 87
Chris@40 88 #====================================================================================
Chris@40 89 # Couple of initializations here. Fill in real values later.
Chris@40 90
Chris@40 91 SHLIB_VERSION_ARG=""
Chris@40 92
Chris@40 93 #====================================================================================
Chris@40 94 # Finished checking, handle options.
Chris@40 95
Chris@40 96 AC_ARG_ENABLE(experimental,
Chris@40 97 AC_HELP_STRING([--enable-experimental], [enable experimental code]))
Chris@40 98
Chris@40 99 EXPERIMENTAL_CODE=0
Chris@40 100 if test x$enable_experimental = xyes ; then
Chris@40 101 EXPERIMENTAL_CODE=1
Chris@40 102 fi
Chris@40 103 AC_DEFINE_UNQUOTED([ENABLE_EXPERIMENTAL_CODE],${EXPERIMENTAL_CODE}, [Set to 1 to enable experimental code.])
Chris@40 104
Chris@40 105 AC_ARG_ENABLE(werror,
Chris@40 106 AC_HELP_STRING([--enable-werror], [enable -Werror in all Makefiles]))
Chris@40 107
Chris@40 108 AC_ARG_ENABLE(stack-smash-protection,
Chris@40 109 AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
Chris@40 110
Chris@40 111 AC_ARG_ENABLE(gcc-pipe,
Chris@40 112 AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option]))
Chris@40 113
Chris@40 114 AC_ARG_ENABLE(gcc-opt,
Chris@40 115 AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations]))
Chris@40 116
Chris@40 117 AC_ARG_ENABLE(cpu-clip,
Chris@40 118 AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]))
Chris@40 119
Chris@40 120 AC_ARG_ENABLE(bow-docs,
Chris@40 121 AC_HELP_STRING([--enable-bow-docs], [enable black-on-white html docs]))
Chris@40 122
Chris@40 123 AC_ARG_ENABLE(sqlite,
Chris@40 124 AC_HELP_STRING([--disable-sqlite], [disable use of sqlite]))
Chris@40 125
Chris@40 126 AC_ARG_ENABLE(alsa,
Chris@40 127 AC_HELP_STRING([--disable-alsa], [disable use of ALSA]))
Chris@40 128
Chris@40 129 AC_ARG_ENABLE(external-libs,
Chris@40 130 AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]]))
Chris@40 131
Chris@40 132 AC_ARG_ENABLE(octave,
Chris@40 133 AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module]))
Chris@40 134
Chris@40 135 AC_ARG_ENABLE(test-coverage,
Chris@40 136 AC_HELP_STRING([--enable-test-coverage], [enable test coverage]))
Chris@40 137 AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes])
Chris@40 138
Chris@40 139 #====================================================================================
Chris@40 140 # Check types and their sizes.
Chris@40 141
Chris@40 142 AC_CHECK_SIZEOF(wchar_t,4)
Chris@40 143 AC_CHECK_SIZEOF(short,2)
Chris@40 144 AC_CHECK_SIZEOF(int,4)
Chris@40 145 AC_CHECK_SIZEOF(long,4)
Chris@40 146 AC_CHECK_SIZEOF(float,4)
Chris@40 147 AC_CHECK_SIZEOF(double,4)
Chris@40 148 AC_CHECK_SIZEOF(void*,8)
Chris@40 149 AC_CHECK_SIZEOF(size_t,4)
Chris@40 150 AC_CHECK_SIZEOF(int64_t,8)
Chris@40 151 AC_CHECK_SIZEOF(long long,8)
Chris@40 152
Chris@40 153 #====================================================================================
Chris@40 154 # Find an appropriate type for sf_count_t.
Chris@40 155 # On systems supporting files larger than 2 Gig, sf_count_t must be a 64 bit value.
Chris@40 156 # Unfortunately there is more than one way of ensuring this so need to do some
Chris@40 157 # pretty rigourous testing here.
Chris@40 158
Chris@40 159 # Check for common 64 bit file offset types.
Chris@40 160 AC_CHECK_SIZEOF(off_t,1)
Chris@40 161 AC_CHECK_SIZEOF(loff_t,1)
Chris@40 162 AC_CHECK_SIZEOF(off64_t,1)
Chris@40 163
Chris@40 164 if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then
Chris@40 165 echo
Chris@40 166 echo "Error : Cannot disable large file support because sizeof (off_t) == 8."
Chris@40 167 echo
Chris@40 168 exit 1
Chris@40 169 fi
Chris@40 170
Chris@40 171
Chris@40 172 case "$host_os" in
Chris@40 173 mingw32*)
Chris@40 174 TYPEOF_SF_COUNT_T="__int64"
Chris@40 175 SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
Chris@40 176 SIZEOF_SF_COUNT_T=8
Chris@40 177 AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.])
Chris@40 178 ;;
Chris@40 179 *)
Chris@40 180 SIZEOF_SF_COUNT_T=0
Chris@40 181 if test "x$ac_cv_sizeof_off_t" = "x8" ; then
Chris@40 182 # If sizeof (off_t) is 8, no further checking is needed.
Chris@40 183 TYPEOF_SF_COUNT_T="int64_t"
Chris@40 184 SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
Chris@40 185 SIZEOF_SF_COUNT_T=8
Chris@40 186 elif test "x$ac_cv_sizeof_loff_t" = "x8" ; then
Chris@40 187 TYPEOF_SF_COUNT_T="int64_t"
Chris@40 188 SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
Chris@40 189 SIZEOF_SF_COUNT_T=8
Chris@40 190 elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then
Chris@40 191 TYPEOF_SF_COUNT_T="int64_t"
Chris@40 192 SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
Chris@40 193 SIZEOF_SF_COUNT_T=8
Chris@40 194 else
Chris@40 195 # Save the old sizeof (off_t) value and then unset it to see if it
Chris@40 196 # changes when Large File Support is enabled.
Chris@40 197 pre_largefile_sizeof_off_t=$ac_cv_sizeof_off_t
Chris@40 198 unset ac_cv_sizeof_off_t
Chris@40 199
Chris@40 200 AC_SYS_LARGEFILE
Chris@40 201
Chris@40 202 if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then
Chris@40 203 ac_cv_sys_largefile_CFLAGS=""
Chris@40 204 fi
Chris@40 205 if test "x$ac_cv_sys_largefile_LDFLAGS" = "xno" ; then
Chris@40 206 ac_cv_sys_largefile_LDFLAGS=""
Chris@40 207 fi
Chris@40 208 if test "x$ac_cv_sys_largefile_LIBS" = "xno" ; then
Chris@40 209 ac_cv_sys_largefile_LIBS=""
Chris@40 210 fi
Chris@40 211
Chris@40 212 AC_CHECK_SIZEOF(off_t,1)
Chris@40 213
Chris@40 214 if test "x$ac_cv_sizeof_off_t" = "x8" ; then
Chris@40 215 TYPEOF_SF_COUNT_T="int64_t"
Chris@40 216 SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
Chris@40 217 elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then
Chris@40 218 echo
Chris@40 219 echo "*** The configure process has determined that this system is capable"
Chris@40 220 echo "*** of Large File Support but has not been able to find a type which"
Chris@40 221 echo "*** is an unambiguous 64 bit file offset."
Chris@40 222 echo "*** Please contact the author to help resolve this problem."
Chris@40 223 echo
Chris@40 224 AC_MSG_ERROR([[Bad file offset type.]])
Chris@40 225 fi
Chris@40 226 fi
Chris@40 227 ;;
Chris@40 228 esac
Chris@40 229
Chris@40 230 if test $SIZEOF_SF_COUNT_T = 4 ; then
Chris@40 231 SF_COUNT_MAX="0x7FFFFFFF"
Chris@40 232 fi
Chris@40 233
Chris@40 234 AC_DEFINE_UNQUOTED([TYPEOF_SF_COUNT_T],${TYPEOF_SF_COUNT_T}, [Set to long if unknown.])
Chris@40 235 AC_SUBST(TYPEOF_SF_COUNT_T)
Chris@40 236
Chris@40 237 AC_DEFINE_UNQUOTED([SIZEOF_SF_COUNT_T],${SIZEOF_SF_COUNT_T}, [Set to sizeof (long) if unknown.])
Chris@40 238 AC_SUBST(SIZEOF_SF_COUNT_T)
Chris@40 239
Chris@40 240 AC_DEFINE_UNQUOTED([SF_COUNT_MAX],${SF_COUNT_MAX}, [Set to maximum allowed value of sf_count_t type.])
Chris@40 241 AC_SUBST(SF_COUNT_MAX)
Chris@40 242
Chris@40 243 AC_CHECK_TYPES(ssize_t)
Chris@40 244 AC_CHECK_SIZEOF(ssize_t,4)
Chris@40 245
Chris@40 246 #====================================================================================
Chris@40 247 # Determine endian-ness of target processor.
Chris@40 248
Chris@40 249 MN_C_FIND_ENDIAN
Chris@40 250
Chris@40 251 AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
Chris@40 252 [Target processor is big endian.])
Chris@40 253 AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
Chris@40 254 [Target processor is little endian.])
Chris@40 255 AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian},
Chris@40 256 [Target processor is big endian.])
Chris@40 257
Chris@40 258 #====================================================================================
Chris@40 259 # Check for functions.
Chris@40 260
Chris@40 261 AC_CHECK_FUNCS(malloc calloc realloc free)
Chris@40 262 AC_CHECK_FUNCS(open read write lseek lseek64)
Chris@40 263 AC_CHECK_FUNCS(fstat fstat64 ftruncate fsync)
Chris@40 264 AC_CHECK_FUNCS(snprintf vsnprintf)
Chris@40 265 AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday)
Chris@40 266 AC_CHECK_FUNCS(mmap getpagesize)
Chris@40 267 AC_CHECK_FUNCS(setlocale)
Chris@40 268 AC_CHECK_FUNCS(pipe waitpid)
Chris@40 269
Chris@40 270 AC_CHECK_LIB([m],floor)
Chris@40 271 AC_CHECK_FUNCS(floor ceil fmod lround)
Chris@40 272
Chris@40 273 MN_C99_FUNC_LRINT
Chris@40 274 MN_C99_FUNC_LRINTF
Chris@40 275
Chris@40 276 #====================================================================================
Chris@40 277 # Check for requirements for building plugins for other languages/enviroments.
Chris@40 278
Chris@40 279 dnl Octave maths environment http://www.octave.org/
Chris@40 280 if test x$cross_compiling = xno ; then
Chris@40 281 if test x$enable_octave = xno ; then
Chris@40 282 AM_CONDITIONAL(BUILD_OCTAVE_MOD, false)
Chris@40 283 else
Chris@40 284 AC_OCTAVE_BUILD
Chris@40 285 fi
Chris@40 286 else
Chris@40 287 AM_CONDITIONAL(BUILD_OCTAVE_MOD, false)
Chris@40 288 fi
Chris@40 289
Chris@40 290 #====================================================================================
Chris@40 291 # Check for Ogg, Vorbis and FLAC.
Chris@40 292
Chris@40 293 HAVE_EXTERNAL_XIPH_LIBS=0
Chris@40 294 EXTERNAL_XIPH_CFLAGS=""
Chris@40 295 EXTERNAL_XIPH_LIBS=""
Chris@40 296
Chris@40 297 # Check for pkg-config outside the if statement.
Chris@40 298 PKG_PROG_PKG_CONFIG
Chris@40 299 m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
Chris@40 300
Chris@40 301 if test -n "$PKG_CONFIG" ; then
Chris@40 302 if test x$enable_external_libs = xno ; then
Chris@40 303 AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]])
Chris@40 304 else
Chris@40 305 PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.3.1, ac_cv_flac=yes, ac_cv_flac=no)
Chris@40 306
Chris@40 307 # Make sure the FLAC_CFLAGS value is sane.
Chris@40 308 FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s|include/FLAC|include|"`
Chris@40 309
Chris@40 310 PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no)
Chris@40 311
Chris@40 312 if test x$enable_experimental = xyes ; then
Chris@40 313 PKG_CHECK_MOD_VERSION(SPEEX, speex >= 1.2, ac_cv_speex=yes, ac_cv_speex=no)
Chris@40 314 else
Chris@40 315 SPEEX_CFLAGS=""
Chris@40 316 SPEEX_LIBS=""
Chris@40 317 fi
Chris@40 318
Chris@40 319 # Vorbis versions earlier than 1.2.3 have bugs that cause the libsndfile
Chris@40 320 # test suite to fail on MIPS, PowerPC and others.
Chris@40 321 # See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899
Chris@40 322 PKG_CHECK_MOD_VERSION(VORBIS, vorbis >= 1.2.3, ac_cv_vorbis=yes, ac_cv_vorbis=no)
Chris@40 323 PKG_CHECK_MOD_VERSION(VORBISENC, vorbisenc >= 1.2.3, ac_cv_vorbisenc=yes, ac_cv_vorbisenc=no)
Chris@40 324 enable_external_libs=yes
Chris@40 325 fi
Chris@40 326
Chris@40 327 if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then
Chris@40 328 HAVE_EXTERNAL_XIPH_LIBS=1
Chris@40 329 enable_external_libs=yes
Chris@40 330
Chris@40 331 EXTERNAL_XIPH_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS"
Chris@40 332 EXTERNAL_XIPH_LIBS="$FLAC_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS "
Chris@40 333 else
Chris@40 334 echo
Chris@40 335 AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]])
Chris@40 336 AC_MSG_WARN([[*** libvorbis) is either missing (possibly only the development]])
Chris@40 337 AC_MSG_WARN([[*** headers) or is of an unsupported version.]])
Chris@40 338 AC_MSG_WARN([[***]])
Chris@40 339 AC_MSG_WARN([[*** Unfortunately, for ease of maintenance, the external libs]])
Chris@40 340 AC_MSG_WARN([[*** are an all or nothing affair.]])
Chris@40 341 echo
Chris@40 342 enable_external_libs=no
Chris@40 343 fi
Chris@40 344 fi
Chris@40 345
Chris@40 346 AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_XIPH_LIBS], $HAVE_EXTERNAL_XIPH_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.])
Chris@40 347
Chris@40 348 #====================================================================================
Chris@40 349 # Check for libsqlite3 (only used in regtest).
Chris@40 350
Chris@40 351 ac_cv_sqlite3=no
Chris@40 352 if test x$enable_sqlite != xno ; then
Chris@40 353 PKG_CHECK_MOD_VERSION(SQLITE3, sqlite3 >= 3.2, ac_cv_sqlite3=yes, ac_cv_sqlite3=no)
Chris@40 354 fi
Chris@40 355
Chris@40 356 if test x$ac_cv_sqlite3 = "xyes" ; then
Chris@40 357 HAVE_SQLITE3=1
Chris@40 358 else
Chris@40 359 HAVE_SQLITE3=0
Chris@40 360 fi
Chris@40 361
Chris@40 362 AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.])
Chris@40 363
Chris@40 364 #====================================================================================
Chris@40 365 # Determine if the processor can do clipping on float to int conversions.
Chris@40 366
Chris@40 367 if test x$enable_cpu_clip != "xno" ; then
Chris@40 368 MN_C_CLIP_MODE
Chris@40 369 else
Chris@40 370 echo "checking processor clipping capabilities... disabled"
Chris@40 371 ac_cv_c_clip_positive=0
Chris@40 372 ac_cv_c_clip_negative=0
Chris@40 373 fi
Chris@40 374
Chris@40 375 AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive},
Chris@40 376 [Target processor clips on positive float to int conversion.])
Chris@40 377 AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative},
Chris@40 378 [Target processor clips on negative float to int conversion.])
Chris@40 379
Chris@40 380 #====================================================================================
Chris@40 381 # Target OS specific stuff.
Chris@40 382
Chris@40 383 OS_SPECIFIC_CFLAGS=""
Chris@40 384 OS_SPECIFIC_LINKS=""
Chris@40 385 os_is_win32=0
Chris@40 386 os_is_openbsd=0
Chris@40 387 use_windows_api=0
Chris@40 388 osx_darwin_version=0
Chris@40 389
Chris@40 390 case "$host_os" in
Chris@40 391 darwin* | rhapsody*)
Chris@40 392 osx_darwin_version=$(echo "$host_os" | sed 's/\..*//;s/darwin//g')
Chris@40 393 if test x$HAVE_XCODE_SELECT = xyes ; then
Chris@40 394 developer_path=`xcode-select --print-path`
Chris@40 395 else
Chris@40 396 developer_path="/Developer"
Chris@40 397 fi
Chris@40 398 OS_SPECIFIC_LINKS="-framework CoreAudio -framework AudioToolbox -framework CoreFoundation"
Chris@40 399 ;;
Chris@40 400 mingw*)
Chris@40 401 os_is_win32=1
Chris@40 402 use_windows_api=1
Chris@40 403 OS_SPECIFIC_LINKS="-lwinmm"
Chris@40 404 ;;
Chris@40 405 openbsd*)
Chris@40 406 os_is_openbsd=1
Chris@40 407 ;;
Chris@40 408 esac
Chris@40 409
Chris@40 410 AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32])
Chris@40 411 AC_DEFINE_UNQUOTED(OS_IS_OPENBSD, ${os_is_openbsd}, [Set to 1 if compiling for OpenBSD])
Chris@40 412 AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API])
Chris@40 413 AC_DEFINE_UNQUOTED(OSX_DARWIN_VERSION, ${osx_darwin_version}, [The darwin version, no-zero is valid])
Chris@40 414 AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1)
Chris@40 415
Chris@40 416 #====================================================================================
Chris@40 417 # Check for ALSA.
Chris@40 418
Chris@40 419 ALSA_LIBS=""
Chris@40 420
Chris@40 421 if test x$enable_alsa != xno ; then
Chris@40 422 AC_CHECK_HEADERS(alsa/asoundlib.h)
Chris@40 423 if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
Chris@40 424 ALSA_LIBS="-lasound"
Chris@40 425 enable_alsa=yes
Chris@40 426 fi
Chris@40 427 fi
Chris@40 428
Chris@40 429 #====================================================================================
Chris@40 430 # Check for OpenBSD's sndio.
Chris@40 431
Chris@40 432 SNDIO_LIBS=""
Chris@40 433 HAVE_SNDIO_H=0
Chris@40 434 case "$host_os" in
Chris@40 435 openbsd*)
Chris@40 436 AC_CHECK_HEADERS(sndio.h)
Chris@40 437 if test x$ac_cv_header_sndio_h = xyes ; then
Chris@40 438 SNDIO_LIBS="-lsndio"
Chris@40 439 HAVE_SNDIO_H=1
Chris@40 440 fi
Chris@40 441 ;;
Chris@40 442 *)
Chris@40 443 ;;
Chris@40 444 esac
Chris@40 445
Chris@40 446 AC_DEFINE_UNQUOTED([HAVE_SNDIO_H],${HAVE_SNDIO_H},[Set to 1 if <sndio.h> is available.])
Chris@40 447
Chris@40 448 #====================================================================================
Chris@40 449 # Test for sanity when cross-compiling.
Chris@40 450
Chris@40 451 if test $ac_cv_sizeof_short != 2 ; then
Chris@40 452 AC_MSG_WARN([[******************************************************************]])
Chris@40 453 AC_MSG_WARN([[*** sizeof (short) != 2. ]])
Chris@40 454 AC_MSG_WARN([[******************************************************************]])
Chris@40 455 fi
Chris@40 456
Chris@40 457 if test $ac_cv_sizeof_int != 4 ; then
Chris@40 458 AC_MSG_WARN([[******************************************************************]])
Chris@40 459 AC_MSG_WARN([[*** sizeof (int) != 4 ]])
Chris@40 460 AC_MSG_WARN([[******************************************************************]])
Chris@40 461 fi
Chris@40 462
Chris@40 463 if test $ac_cv_sizeof_float != 4 ; then
Chris@40 464 AC_MSG_WARN([[******************************************************************]])
Chris@40 465 AC_MSG_WARN([[*** sizeof (float) != 4. ]])
Chris@40 466 AC_MSG_WARN([[******************************************************************]])
Chris@40 467 fi
Chris@40 468
Chris@40 469 if test $ac_cv_sizeof_double != 8 ; then
Chris@40 470 AC_MSG_WARN([[******************************************************************]])
Chris@40 471 AC_MSG_WARN([[*** sizeof (double) != 8. ]])
Chris@40 472 AC_MSG_WARN([[******************************************************************]])
Chris@40 473 fi
Chris@40 474
Chris@40 475 if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then
Chris@40 476 AC_MSG_WARN([[Touching files in directory tests/.]])
Chris@40 477 touch tests/*.c tests/*.h
Chris@40 478 fi
Chris@40 479
Chris@40 480 #====================================================================================
Chris@40 481 # Settings for the HTML documentation.
Chris@40 482
Chris@40 483 if test x$enable_bow_docs = "xyes" ; then
Chris@40 484 HTML_BGCOLOUR="white"
Chris@40 485 HTML_FGCOLOUR="black"
Chris@40 486 else
Chris@40 487 HTML_BGCOLOUR="black"
Chris@40 488 HTML_FGCOLOUR="white"
Chris@40 489 fi
Chris@40 490
Chris@40 491 #====================================================================================
Chris@40 492 # Now use the information from the checking stage.
Chris@40 493
Chris@40 494 win32_target_dll=0
Chris@40 495 COMPILER_IS_GCC=0
Chris@40 496
Chris@40 497 if test x$ac_cv_c_compiler_gnu = xyes ; then
Chris@40 498 MN_ADD_CFLAGS(-std=gnu99)
Chris@40 499
Chris@40 500 MN_GCC_VERSION
Chris@40 501
Chris@40 502 if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
Chris@40 503 AC_MSG_WARN([****************************************************************])
Chris@40 504 AC_MSG_WARN([** GCC version 4.2 warns about the inline keyword for no good **])
Chris@40 505 AC_MSG_WARN([** reason but the maintainers do not see it as a bug. **])
Chris@40 506 AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **])
Chris@40 507 AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **])
Chris@40 508 AC_MSG_WARN([****************************************************************])
Chris@40 509 MN_ADD_CFLAGS([-fgnu89-inline])
Chris@40 510 fi
Chris@40 511
Chris@40 512 CFLAGS="$CFLAGS -Wall"
Chris@40 513 CXXFLAGS="$CXXFLAGS -Wall"
Chris@40 514
Chris@40 515 MN_ADD_CFLAGS([-Wextra])
Chris@40 516 MN_ADD_CFLAGS([-Wdeclaration-after-statement])
Chris@40 517 MN_ADD_CFLAGS([-Wpointer-arith])
Chris@40 518 MN_ADD_CFLAGS([-funsigned-char])
Chris@40 519
Chris@40 520 AC_LANG_PUSH([C++])
Chris@40 521 MN_ADD_CXXFLAGS([-Wextra])
Chris@40 522 MN_ADD_CXXFLAGS([-Wpointer-arith])
Chris@40 523 MN_ADD_CXXFLAGS([-funsigned-char])
Chris@40 524 AC_LANG_POP([C++])
Chris@40 525
Chris@40 526
Chris@40 527 MN_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
Chris@40 528
Chris@40 529 if test x$enable_stack_smash_protection = "xyes" ; then
Chris@40 530 XIPH_GCC_STACK_PROTECTOR
Chris@40 531 XIPH_GXX_STACK_PROTECTOR
Chris@40 532 fi
Chris@40 533
Chris@40 534 if test x$enable_test_coverage = "xyes" ; then
Chris@40 535 # MN_ADD_CFLAGS([-ftest-coverage])
Chris@40 536 MN_ADD_CFLAGS([-coverage])
Chris@40 537 fi
Chris@40 538
Chris@40 539 common_flags="-Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wundef -Wuninitialized -Winit-self"
Chris@40 540
Chris@40 541 # -Winline -Wconversion "
Chris@40 542 CFLAGS="$CFLAGS $common_flags -Wbad-function-cast -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return"
Chris@40 543 CXXFLAGS="$CXXFLAGS $common_flags -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo"
Chris@40 544
Chris@40 545 if test "x$enable_gcc_opt" = "xno" ; then
Chris@40 546 temp_CFLAGS=`echo $CFLAGS | $SED "s/O2/O0/"`
Chris@40 547 CFLAGS=$temp_CFLAGS
Chris@40 548 AC_MSG_WARN([[*** Compiler optimisations switched off. ***]])
Chris@40 549 fi
Chris@40 550
Chris@40 551 # OS specific tweaks.
Chris@40 552 case "$host_os" in
Chris@40 553 darwin* | rhapsody*)
Chris@40 554 # Disable -Wall, -pedantic and -Wshadow for Apple Darwin/Rhapsody.
Chris@40 555 # System headers on these systems are broken.
Chris@40 556 temp_CFLAGS=`echo $CFLAGS | $SED "s/-Wall -pedantic//" | $SED "s/-Wshadow//" | $SED "s/-Waggregate-return//"`
Chris@40 557 CFLAGS=$temp_CFLAGS
Chris@40 558 SHLIB_VERSION_ARG="-Wl,-exported_symbols_list -Wl,\$(srcdir)/Symbols.darwin"
Chris@40 559 ;;
Chris@40 560 linux*|kfreebsd*-gnu*|gnu*)
Chris@40 561 SHLIB_VERSION_ARG="-Wl,--version-script=\$(srcdir)/Symbols.gnu-binutils"
Chris@40 562 ;;
Chris@40 563 mingw*)
Chris@40 564 SHLIB_VERSION_ARG="-Wc,-static-libgcc -Wl,\$(srcdir)/libsndfile-1.def"
Chris@40 565 win32_target_dll=1
Chris@40 566 if test x"$enable_shared" = xno ; then
Chris@40 567 win32_target_dll=0
Chris@40 568 fi
Chris@40 569 ;;
Chris@40 570 os2*)
Chris@40 571 SHLIB_VERSION_ARG="-Wl,-export-symbols \$(srcdir)/Symbols.os2"
Chris@40 572 ;;
Chris@40 573 *)
Chris@40 574 ;;
Chris@40 575 esac
Chris@40 576 if test x$enable_gcc_pipe != "xno" ; then
Chris@40 577 CFLAGS="$CFLAGS -pipe"
Chris@40 578 fi
Chris@40 579
Chris@40 580 COMPILER_IS_GCC=1
Chris@40 581 fi
Chris@40 582
Chris@40 583 if test x$enable_werror = "xyes" ; then
Chris@40 584 MN_ADD_CFLAGS([-Werror])
Chris@40 585
Chris@40 586 AC_LANG_PUSH([C++])
Chris@40 587 MN_ADD_CXXFLAGS([-Werror])
Chris@40 588 AC_LANG_POP([C++])
Chris@40 589 fi
Chris@40 590
Chris@40 591
Chris@40 592 AC_DEFINE_UNQUOTED([WIN32_TARGET_DLL], ${win32_target_dll}, [Set to 1 if windows DLL is being built.])
Chris@40 593 AC_DEFINE_UNQUOTED([COMPILER_IS_GCC], ${COMPILER_IS_GCC}, [Set to 1 if the compile is GNU GCC.])
Chris@40 594
Chris@40 595 CFLAGS="$CFLAGS $OS_SPECIFIC_CFLAGS"
Chris@40 596
Chris@40 597 if test x"$CFLAGS" = x ; then
Chris@40 598 echo "Error in configure script. CFLAGS has been screwed up."
Chris@40 599 exit
Chris@40 600 fi
Chris@40 601
Chris@40 602 HOST_TRIPLET="${host_cpu}-${host_vendor}-${host_os}"
Chris@40 603
Chris@40 604 AC_DEFINE_UNQUOTED([HOST_TRIPLET], "${HOST_TRIPLET}", [The host triplet of the compiled binary.])
Chris@40 605
Chris@40 606 if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then
Chris@40 607 OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS"
Chris@40 608 fi
Chris@40 609
Chris@40 610 WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -e "s/p.*//" -e "s/\./,/g"`
Chris@40 611
Chris@40 612
Chris@40 613 if test "$enable_static" = no ; then
Chris@40 614 SRC_BINDIR=src/.libs/
Chris@40 615 TEST_BINDIR=tests/.libs/
Chris@40 616 else
Chris@40 617 SRC_BINDIR=src/
Chris@40 618 TEST_BINDIR=tests/
Chris@40 619 fi
Chris@40 620
Chris@40 621 #-------------------------------------------------------------------------------
Chris@40 622
Chris@40 623 AC_SUBST(HOST_TRIPLET)
Chris@40 624
Chris@40 625 AC_SUBST(HTML_BGCOLOUR)
Chris@40 626 AC_SUBST(HTML_FGCOLOUR)
Chris@40 627
Chris@40 628 AC_SUBST(SHLIB_VERSION_ARG)
Chris@40 629 AC_SUBST(SHARED_VERSION_INFO)
Chris@40 630 AC_SUBST(CLEAN_VERSION)
Chris@40 631 AC_SUBST(WIN_RC_VERSION)
Chris@40 632
Chris@40 633 AC_SUBST(HAVE_EXTERNAL_XIPH_LIBS)
Chris@40 634 AC_SUBST(OS_SPECIFIC_CFLAGS)
Chris@40 635 AC_SUBST(OS_SPECIFIC_LINKS)
Chris@40 636 AC_SUBST(ALSA_LIBS)
Chris@40 637 AC_SUBST(SNDIO_LIBS)
Chris@40 638
Chris@40 639 AC_SUBST(EXTERNAL_XIPH_CFLAGS)
Chris@40 640 AC_SUBST(EXTERNAL_XIPH_LIBS)
Chris@40 641 AC_SUBST(SRC_BINDIR)
Chris@40 642 AC_SUBST(TEST_BINDIR)
Chris@40 643
Chris@40 644 dnl The following line causes the libtool distributed with the source
Chris@40 645 dnl to be replaced if the build system has a more recent version.
Chris@40 646 AC_SUBST(LIBTOOL_DEPS)
Chris@40 647
Chris@40 648 AC_CONFIG_FILES([ \
Chris@40 649 src/Makefile man/Makefile examples/Makefile tests/Makefile regtest/Makefile \
Chris@40 650 M4/Makefile doc/Makefile Win32/Makefile Octave/Makefile programs/Makefile \
Chris@40 651 Makefile \
Chris@40 652 src/version-metadata.rc tests/test_wrapper.sh tests/pedantic-header-test.sh \
Chris@40 653 doc/libsndfile.css Scripts/build-test-tarball.mk libsndfile.spec sndfile.pc \
Chris@40 654 src/sndfile.h \
Chris@40 655 echo-install-dirs
Chris@40 656 ])
Chris@40 657 AC_OUTPUT
Chris@40 658
Chris@40 659 # Make sure these are executable.
Chris@40 660 chmod u+x tests/test_wrapper.sh Scripts/build-test-tarball.mk echo-install-dirs
Chris@40 661
Chris@40 662 #====================================================================================
Chris@40 663
Chris@40 664 AC_MSG_RESULT([
Chris@40 665 -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
Chris@40 666
Chris@40 667 Configuration summary :
Chris@40 668
Chris@40 669 libsndfile version : .................. ${VERSION}
Chris@40 670
Chris@40 671 Host CPU : ............................ ${host_cpu}
Chris@40 672 Host Vendor : ......................... ${host_vendor}
Chris@40 673 Host OS : ............................. ${host_os}
Chris@40 674
Chris@40 675 Experimental code : ................... ${enable_experimental:-no}
Chris@40 676 Using ALSA in example programs : ...... ${enable_alsa:-no}
Chris@40 677 External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no}
Chris@40 678 ])
Chris@40 679
Chris@40 680 if test -z "$PKG_CONFIG" ; then
Chris@40 681 echo " *****************************************************************"
Chris@40 682 echo " *** The pkg-config program is missing. ***"
Chris@40 683 echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***"
Chris@40 684 echo " *** http://pkg-config.freedesktop.org/wiki/ ***"
Chris@40 685 echo " *****************************************************************"
Chris@40 686 echo
Chris@40 687 fi
Chris@40 688
Chris@40 689 echo " Tools :"
Chris@40 690 echo
Chris@40 691 echo " Compiler is Clang : ................... ${mn_cv_c_compiler_clang}"
Chris@40 692 echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}"
Chris@40 693
Chris@40 694 if test x$ac_cv_c_compiler_gnu = xyes ; then
Chris@40 695 echo " GCC version : ......................... ${GCC_VERSION}"
Chris@40 696 if test $GCC_MAJOR_VERSION -lt 3 ; then
Chris@40 697 echo "\n"
Chris@40 698 echo " ** This compiler version allows applications to write"
Chris@40 699 echo " ** to static strings within the library."
Chris@40 700 echo " ** Compile with GCC version 3.X or above to avoid this problem."
Chris@40 701 fi
Chris@40 702 fi
Chris@40 703 echo " Sanitizer enabled : ................... ${enable_sanitizer:-no}"
Chris@40 704 echo " Stack smash protection : .............. ${enable_stack_smash_protection:-no}"
Chris@40 705
Chris@40 706 ./echo-install-dirs
Chris@40 707
Chris@40 708 # Remove symlink created by Scripts/android-configure.sh.
Chris@40 709 test -h gdbclient && rm -f gdbclient
Chris@40 710
Chris@40 711 (cd src && make genfiles)
Chris@40 712 (cd tests && make genfiles)