Chris@40: # Copyright (C) 1999-2016 Erik de Castro Lopo . Chris@40: Chris@40: dnl Require autoconf version Chris@40: AC_PREREQ(2.57) Chris@40: Chris@40: AC_INIT([libsndfile],[1.0.27],[sndfile@mega-nerd.com], Chris@40: [libsndfile],[http://www.mega-nerd.com/libsndfile/]) Chris@40: Chris@40: # Put config stuff in Cfg. Chris@40: AC_CONFIG_AUX_DIR(Cfg) Chris@40: AC_CONFIG_MACRO_DIR([M4]) Chris@40: Chris@40: AC_CONFIG_SRCDIR([src/sndfile.c]) Chris@40: AC_CANONICAL_TARGET([]) Chris@40: Chris@40: AC_CONFIG_HEADERS([src/config.h]) Chris@40: Chris@40: AM_INIT_AUTOMAKE Chris@40: m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Chris@40: Chris@40: AC_LANG([C]) Chris@40: Chris@40: AC_PROG_CC_STDC Chris@40: AC_USE_SYSTEM_EXTENSIONS Chris@40: AM_PROG_CC_C_O Chris@40: AC_PROG_CXX Chris@40: Chris@40: MN_C_COMPILER_IS_CLANG Chris@40: MN_GCC_REALLY_IS_GCC Chris@40: Chris@40: AC_PROG_SED Chris@40: Chris@40: # Do not check for F77. Chris@40: define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl Chris@40: Chris@40: AM_PROG_LIBTOOL Chris@40: LT_PROG_RC Chris@40: Chris@40: AC_PROG_INSTALL Chris@40: AC_PROG_LN_S Chris@40: Chris@40: AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no) Chris@40: AC_CHECK_PROG(HAVE_WINE, wine, yes, no) Chris@40: AC_CHECK_PROG(HAVE_XCODE_SELECT, xcode-select, yes, no) Chris@40: Chris@40: #------------------------------------------------------------------------------------ Chris@40: # Rules for library version information: Chris@40: # Chris@40: # 1. Start with version information of `0:0:0' for each libtool library. Chris@40: # 2. Update the version information only immediately before a public release of Chris@40: # your software. More frequent updates are unnecessary, and only guarantee Chris@40: # that the current interface number gets larger faster. Chris@40: # 3. If the library source code has changed at all since the last update, then Chris@40: # increment revision (`c:r:a' becomes `c:r+1:a'). Chris@40: # 4. If any interfaces have been added, removed, or changed since the last update, Chris@40: # increment current, and set revision to 0. Chris@40: # 5. If any interfaces have been added since the last public release, then increment Chris@40: # age. Chris@40: # 6. If any interfaces have been removed since the last public release, then set age Chris@40: # to 0. Chris@40: Chris@40: CLEAN_VERSION=`echo $PACKAGE_VERSION | $SED "s/p.*//"` Chris@40: VERSION_MINOR=`echo $CLEAN_VERSION | $SED "s/.*\.//"` Chris@40: Chris@40: SHARED_VERSION_INFO="1:$VERSION_MINOR:0" Chris@40: Chris@40: #------------------------------------------------------------------------------------ Chris@40: Chris@40: AC_HEADER_STDC Chris@40: Chris@40: AC_CHECK_HEADERS(endian.h) Chris@40: AC_CHECK_HEADERS(byteswap.h) Chris@40: AC_CHECK_HEADERS(locale.h) Chris@40: AC_CHECK_HEADERS(sys/time.h) Chris@40: Chris@40: AC_HEADER_SYS_WAIT Chris@40: Chris@40: AC_CHECK_DECLS(S_IRGRP) Chris@40: if test x$ac_cv_have_decl_S_IRGRP = xyes ; then Chris@40: AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],1,[Set to 1 if S_IRGRP is defined.]) Chris@40: else Chris@40: AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],0) Chris@40: fi Chris@40: Chris@40: AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST], Chris@40: [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Couple of initializations here. Fill in real values later. Chris@40: Chris@40: SHLIB_VERSION_ARG="" Chris@40: Chris@40: #==================================================================================== Chris@40: # Finished checking, handle options. Chris@40: Chris@40: AC_ARG_ENABLE(experimental, Chris@40: AC_HELP_STRING([--enable-experimental], [enable experimental code])) Chris@40: Chris@40: EXPERIMENTAL_CODE=0 Chris@40: if test x$enable_experimental = xyes ; then Chris@40: EXPERIMENTAL_CODE=1 Chris@40: fi Chris@40: AC_DEFINE_UNQUOTED([ENABLE_EXPERIMENTAL_CODE],${EXPERIMENTAL_CODE}, [Set to 1 to enable experimental code.]) Chris@40: Chris@40: AC_ARG_ENABLE(werror, Chris@40: AC_HELP_STRING([--enable-werror], [enable -Werror in all Makefiles])) Chris@40: Chris@40: AC_ARG_ENABLE(stack-smash-protection, Chris@40: AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection])) Chris@40: Chris@40: AC_ARG_ENABLE(gcc-pipe, Chris@40: AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option])) Chris@40: Chris@40: AC_ARG_ENABLE(gcc-opt, Chris@40: AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations])) Chris@40: Chris@40: AC_ARG_ENABLE(cpu-clip, Chris@40: AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper])) Chris@40: Chris@40: AC_ARG_ENABLE(bow-docs, Chris@40: AC_HELP_STRING([--enable-bow-docs], [enable black-on-white html docs])) Chris@40: Chris@40: AC_ARG_ENABLE(sqlite, Chris@40: AC_HELP_STRING([--disable-sqlite], [disable use of sqlite])) Chris@40: Chris@40: AC_ARG_ENABLE(alsa, Chris@40: AC_HELP_STRING([--disable-alsa], [disable use of ALSA])) Chris@40: Chris@40: AC_ARG_ENABLE(external-libs, Chris@40: AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]])) Chris@40: Chris@40: AC_ARG_ENABLE(octave, Chris@40: AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module])) Chris@40: Chris@40: AC_ARG_ENABLE(test-coverage, Chris@40: AC_HELP_STRING([--enable-test-coverage], [enable test coverage])) Chris@40: AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Check types and their sizes. Chris@40: Chris@40: AC_CHECK_SIZEOF(wchar_t,4) Chris@40: AC_CHECK_SIZEOF(short,2) Chris@40: AC_CHECK_SIZEOF(int,4) Chris@40: AC_CHECK_SIZEOF(long,4) Chris@40: AC_CHECK_SIZEOF(float,4) Chris@40: AC_CHECK_SIZEOF(double,4) Chris@40: AC_CHECK_SIZEOF(void*,8) Chris@40: AC_CHECK_SIZEOF(size_t,4) Chris@40: AC_CHECK_SIZEOF(int64_t,8) Chris@40: AC_CHECK_SIZEOF(long long,8) Chris@40: Chris@40: #==================================================================================== Chris@40: # Find an appropriate type for sf_count_t. Chris@40: # On systems supporting files larger than 2 Gig, sf_count_t must be a 64 bit value. Chris@40: # Unfortunately there is more than one way of ensuring this so need to do some Chris@40: # pretty rigourous testing here. Chris@40: Chris@40: # Check for common 64 bit file offset types. Chris@40: AC_CHECK_SIZEOF(off_t,1) Chris@40: AC_CHECK_SIZEOF(loff_t,1) Chris@40: AC_CHECK_SIZEOF(off64_t,1) Chris@40: Chris@40: if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then Chris@40: echo Chris@40: echo "Error : Cannot disable large file support because sizeof (off_t) == 8." Chris@40: echo Chris@40: exit 1 Chris@40: fi Chris@40: Chris@40: Chris@40: case "$host_os" in Chris@40: mingw32*) Chris@40: TYPEOF_SF_COUNT_T="__int64" Chris@40: SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" Chris@40: SIZEOF_SF_COUNT_T=8 Chris@40: AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.]) Chris@40: ;; Chris@40: *) Chris@40: SIZEOF_SF_COUNT_T=0 Chris@40: if test "x$ac_cv_sizeof_off_t" = "x8" ; then Chris@40: # If sizeof (off_t) is 8, no further checking is needed. Chris@40: TYPEOF_SF_COUNT_T="int64_t" Chris@40: SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" Chris@40: SIZEOF_SF_COUNT_T=8 Chris@40: elif test "x$ac_cv_sizeof_loff_t" = "x8" ; then Chris@40: TYPEOF_SF_COUNT_T="int64_t" Chris@40: SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" Chris@40: SIZEOF_SF_COUNT_T=8 Chris@40: elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then Chris@40: TYPEOF_SF_COUNT_T="int64_t" Chris@40: SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" Chris@40: SIZEOF_SF_COUNT_T=8 Chris@40: else Chris@40: # Save the old sizeof (off_t) value and then unset it to see if it Chris@40: # changes when Large File Support is enabled. Chris@40: pre_largefile_sizeof_off_t=$ac_cv_sizeof_off_t Chris@40: unset ac_cv_sizeof_off_t Chris@40: Chris@40: AC_SYS_LARGEFILE Chris@40: Chris@40: if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then Chris@40: ac_cv_sys_largefile_CFLAGS="" Chris@40: fi Chris@40: if test "x$ac_cv_sys_largefile_LDFLAGS" = "xno" ; then Chris@40: ac_cv_sys_largefile_LDFLAGS="" Chris@40: fi Chris@40: if test "x$ac_cv_sys_largefile_LIBS" = "xno" ; then Chris@40: ac_cv_sys_largefile_LIBS="" Chris@40: fi Chris@40: Chris@40: AC_CHECK_SIZEOF(off_t,1) Chris@40: Chris@40: if test "x$ac_cv_sizeof_off_t" = "x8" ; then Chris@40: TYPEOF_SF_COUNT_T="int64_t" Chris@40: SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" Chris@40: elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then Chris@40: echo Chris@40: echo "*** The configure process has determined that this system is capable" Chris@40: echo "*** of Large File Support but has not been able to find a type which" Chris@40: echo "*** is an unambiguous 64 bit file offset." Chris@40: echo "*** Please contact the author to help resolve this problem." Chris@40: echo Chris@40: AC_MSG_ERROR([[Bad file offset type.]]) Chris@40: fi Chris@40: fi Chris@40: ;; Chris@40: esac Chris@40: Chris@40: if test $SIZEOF_SF_COUNT_T = 4 ; then Chris@40: SF_COUNT_MAX="0x7FFFFFFF" Chris@40: fi Chris@40: Chris@40: AC_DEFINE_UNQUOTED([TYPEOF_SF_COUNT_T],${TYPEOF_SF_COUNT_T}, [Set to long if unknown.]) Chris@40: AC_SUBST(TYPEOF_SF_COUNT_T) Chris@40: Chris@40: AC_DEFINE_UNQUOTED([SIZEOF_SF_COUNT_T],${SIZEOF_SF_COUNT_T}, [Set to sizeof (long) if unknown.]) Chris@40: AC_SUBST(SIZEOF_SF_COUNT_T) Chris@40: Chris@40: AC_DEFINE_UNQUOTED([SF_COUNT_MAX],${SF_COUNT_MAX}, [Set to maximum allowed value of sf_count_t type.]) Chris@40: AC_SUBST(SF_COUNT_MAX) Chris@40: Chris@40: AC_CHECK_TYPES(ssize_t) Chris@40: AC_CHECK_SIZEOF(ssize_t,4) Chris@40: Chris@40: #==================================================================================== Chris@40: # Determine endian-ness of target processor. Chris@40: Chris@40: MN_C_FIND_ENDIAN Chris@40: Chris@40: AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian}, Chris@40: [Target processor is big endian.]) Chris@40: AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian}, Chris@40: [Target processor is little endian.]) Chris@40: AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian}, Chris@40: [Target processor is big endian.]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Check for functions. Chris@40: Chris@40: AC_CHECK_FUNCS(malloc calloc realloc free) Chris@40: AC_CHECK_FUNCS(open read write lseek lseek64) Chris@40: AC_CHECK_FUNCS(fstat fstat64 ftruncate fsync) Chris@40: AC_CHECK_FUNCS(snprintf vsnprintf) Chris@40: AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday) Chris@40: AC_CHECK_FUNCS(mmap getpagesize) Chris@40: AC_CHECK_FUNCS(setlocale) Chris@40: AC_CHECK_FUNCS(pipe waitpid) Chris@40: Chris@40: AC_CHECK_LIB([m],floor) Chris@40: AC_CHECK_FUNCS(floor ceil fmod lround) Chris@40: Chris@40: MN_C99_FUNC_LRINT Chris@40: MN_C99_FUNC_LRINTF Chris@40: Chris@40: #==================================================================================== Chris@40: # Check for requirements for building plugins for other languages/enviroments. Chris@40: Chris@40: dnl Octave maths environment http://www.octave.org/ Chris@40: if test x$cross_compiling = xno ; then Chris@40: if test x$enable_octave = xno ; then Chris@40: AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) Chris@40: else Chris@40: AC_OCTAVE_BUILD Chris@40: fi Chris@40: else Chris@40: AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) Chris@40: fi Chris@40: Chris@40: #==================================================================================== Chris@40: # Check for Ogg, Vorbis and FLAC. Chris@40: Chris@40: HAVE_EXTERNAL_XIPH_LIBS=0 Chris@40: EXTERNAL_XIPH_CFLAGS="" Chris@40: EXTERNAL_XIPH_LIBS="" Chris@40: Chris@40: # Check for pkg-config outside the if statement. Chris@40: PKG_PROG_PKG_CONFIG Chris@40: m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig)) Chris@40: Chris@40: if test -n "$PKG_CONFIG" ; then Chris@40: if test x$enable_external_libs = xno ; then Chris@40: AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]]) Chris@40: else Chris@40: PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.3.1, ac_cv_flac=yes, ac_cv_flac=no) Chris@40: Chris@40: # Make sure the FLAC_CFLAGS value is sane. Chris@40: FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s|include/FLAC|include|"` Chris@40: Chris@40: PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no) Chris@40: Chris@40: if test x$enable_experimental = xyes ; then Chris@40: PKG_CHECK_MOD_VERSION(SPEEX, speex >= 1.2, ac_cv_speex=yes, ac_cv_speex=no) Chris@40: else Chris@40: SPEEX_CFLAGS="" Chris@40: SPEEX_LIBS="" Chris@40: fi Chris@40: Chris@40: # Vorbis versions earlier than 1.2.3 have bugs that cause the libsndfile Chris@40: # test suite to fail on MIPS, PowerPC and others. Chris@40: # See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899 Chris@40: PKG_CHECK_MOD_VERSION(VORBIS, vorbis >= 1.2.3, ac_cv_vorbis=yes, ac_cv_vorbis=no) Chris@40: PKG_CHECK_MOD_VERSION(VORBISENC, vorbisenc >= 1.2.3, ac_cv_vorbisenc=yes, ac_cv_vorbisenc=no) Chris@40: enable_external_libs=yes Chris@40: fi Chris@40: Chris@40: if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then Chris@40: HAVE_EXTERNAL_XIPH_LIBS=1 Chris@40: enable_external_libs=yes Chris@40: Chris@40: EXTERNAL_XIPH_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS" Chris@40: EXTERNAL_XIPH_LIBS="$FLAC_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS " Chris@40: else Chris@40: echo Chris@40: AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]]) Chris@40: AC_MSG_WARN([[*** libvorbis) is either missing (possibly only the development]]) Chris@40: AC_MSG_WARN([[*** headers) or is of an unsupported version.]]) Chris@40: AC_MSG_WARN([[***]]) Chris@40: AC_MSG_WARN([[*** Unfortunately, for ease of maintenance, the external libs]]) Chris@40: AC_MSG_WARN([[*** are an all or nothing affair.]]) Chris@40: echo Chris@40: enable_external_libs=no Chris@40: fi Chris@40: fi Chris@40: Chris@40: 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: Chris@40: #==================================================================================== Chris@40: # Check for libsqlite3 (only used in regtest). Chris@40: Chris@40: ac_cv_sqlite3=no Chris@40: if test x$enable_sqlite != xno ; then Chris@40: PKG_CHECK_MOD_VERSION(SQLITE3, sqlite3 >= 3.2, ac_cv_sqlite3=yes, ac_cv_sqlite3=no) Chris@40: fi Chris@40: Chris@40: if test x$ac_cv_sqlite3 = "xyes" ; then Chris@40: HAVE_SQLITE3=1 Chris@40: else Chris@40: HAVE_SQLITE3=0 Chris@40: fi Chris@40: Chris@40: AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Determine if the processor can do clipping on float to int conversions. Chris@40: Chris@40: if test x$enable_cpu_clip != "xno" ; then Chris@40: MN_C_CLIP_MODE Chris@40: else Chris@40: echo "checking processor clipping capabilities... disabled" Chris@40: ac_cv_c_clip_positive=0 Chris@40: ac_cv_c_clip_negative=0 Chris@40: fi Chris@40: Chris@40: AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive}, Chris@40: [Target processor clips on positive float to int conversion.]) Chris@40: AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative}, Chris@40: [Target processor clips on negative float to int conversion.]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Target OS specific stuff. Chris@40: Chris@40: OS_SPECIFIC_CFLAGS="" Chris@40: OS_SPECIFIC_LINKS="" Chris@40: os_is_win32=0 Chris@40: os_is_openbsd=0 Chris@40: use_windows_api=0 Chris@40: osx_darwin_version=0 Chris@40: Chris@40: case "$host_os" in Chris@40: darwin* | rhapsody*) Chris@40: osx_darwin_version=$(echo "$host_os" | sed 's/\..*//;s/darwin//g') Chris@40: if test x$HAVE_XCODE_SELECT = xyes ; then Chris@40: developer_path=`xcode-select --print-path` Chris@40: else Chris@40: developer_path="/Developer" Chris@40: fi Chris@40: OS_SPECIFIC_LINKS="-framework CoreAudio -framework AudioToolbox -framework CoreFoundation" Chris@40: ;; Chris@40: mingw*) Chris@40: os_is_win32=1 Chris@40: use_windows_api=1 Chris@40: OS_SPECIFIC_LINKS="-lwinmm" Chris@40: ;; Chris@40: openbsd*) Chris@40: os_is_openbsd=1 Chris@40: ;; Chris@40: esac Chris@40: Chris@40: AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32]) Chris@40: AC_DEFINE_UNQUOTED(OS_IS_OPENBSD, ${os_is_openbsd}, [Set to 1 if compiling for OpenBSD]) Chris@40: AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API]) Chris@40: AC_DEFINE_UNQUOTED(OSX_DARWIN_VERSION, ${osx_darwin_version}, [The darwin version, no-zero is valid]) Chris@40: AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1) Chris@40: Chris@40: #==================================================================================== Chris@40: # Check for ALSA. Chris@40: Chris@40: ALSA_LIBS="" Chris@40: Chris@40: if test x$enable_alsa != xno ; then Chris@40: AC_CHECK_HEADERS(alsa/asoundlib.h) Chris@40: if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then Chris@40: ALSA_LIBS="-lasound" Chris@40: enable_alsa=yes Chris@40: fi Chris@40: fi Chris@40: Chris@40: #==================================================================================== Chris@40: # Check for OpenBSD's sndio. Chris@40: Chris@40: SNDIO_LIBS="" Chris@40: HAVE_SNDIO_H=0 Chris@40: case "$host_os" in Chris@40: openbsd*) Chris@40: AC_CHECK_HEADERS(sndio.h) Chris@40: if test x$ac_cv_header_sndio_h = xyes ; then Chris@40: SNDIO_LIBS="-lsndio" Chris@40: HAVE_SNDIO_H=1 Chris@40: fi Chris@40: ;; Chris@40: *) Chris@40: ;; Chris@40: esac Chris@40: Chris@40: AC_DEFINE_UNQUOTED([HAVE_SNDIO_H],${HAVE_SNDIO_H},[Set to 1 if is available.]) Chris@40: Chris@40: #==================================================================================== Chris@40: # Test for sanity when cross-compiling. Chris@40: Chris@40: if test $ac_cv_sizeof_short != 2 ; then Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: AC_MSG_WARN([[*** sizeof (short) != 2. ]]) Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: fi Chris@40: Chris@40: if test $ac_cv_sizeof_int != 4 ; then Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: AC_MSG_WARN([[*** sizeof (int) != 4 ]]) Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: fi Chris@40: Chris@40: if test $ac_cv_sizeof_float != 4 ; then Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: AC_MSG_WARN([[*** sizeof (float) != 4. ]]) Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: fi Chris@40: Chris@40: if test $ac_cv_sizeof_double != 8 ; then Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: AC_MSG_WARN([[*** sizeof (double) != 8. ]]) Chris@40: AC_MSG_WARN([[******************************************************************]]) Chris@40: fi Chris@40: Chris@40: if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then Chris@40: AC_MSG_WARN([[Touching files in directory tests/.]]) Chris@40: touch tests/*.c tests/*.h Chris@40: fi Chris@40: Chris@40: #==================================================================================== Chris@40: # Settings for the HTML documentation. Chris@40: Chris@40: if test x$enable_bow_docs = "xyes" ; then Chris@40: HTML_BGCOLOUR="white" Chris@40: HTML_FGCOLOUR="black" Chris@40: else Chris@40: HTML_BGCOLOUR="black" Chris@40: HTML_FGCOLOUR="white" Chris@40: fi Chris@40: Chris@40: #==================================================================================== Chris@40: # Now use the information from the checking stage. Chris@40: Chris@40: win32_target_dll=0 Chris@40: COMPILER_IS_GCC=0 Chris@40: Chris@40: if test x$ac_cv_c_compiler_gnu = xyes ; then Chris@40: MN_ADD_CFLAGS(-std=gnu99) Chris@40: Chris@40: MN_GCC_VERSION Chris@40: Chris@40: if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then Chris@40: AC_MSG_WARN([****************************************************************]) Chris@40: AC_MSG_WARN([** GCC version 4.2 warns about the inline keyword for no good **]) Chris@40: AC_MSG_WARN([** reason but the maintainers do not see it as a bug. **]) Chris@40: AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **]) Chris@40: AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **]) Chris@40: AC_MSG_WARN([****************************************************************]) Chris@40: MN_ADD_CFLAGS([-fgnu89-inline]) Chris@40: fi Chris@40: Chris@40: CFLAGS="$CFLAGS -Wall" Chris@40: CXXFLAGS="$CXXFLAGS -Wall" Chris@40: Chris@40: MN_ADD_CFLAGS([-Wextra]) Chris@40: MN_ADD_CFLAGS([-Wdeclaration-after-statement]) Chris@40: MN_ADD_CFLAGS([-Wpointer-arith]) Chris@40: MN_ADD_CFLAGS([-funsigned-char]) Chris@40: Chris@40: AC_LANG_PUSH([C++]) Chris@40: MN_ADD_CXXFLAGS([-Wextra]) Chris@40: MN_ADD_CXXFLAGS([-Wpointer-arith]) Chris@40: MN_ADD_CXXFLAGS([-funsigned-char]) Chris@40: AC_LANG_POP([C++]) Chris@40: Chris@40: Chris@40: MN_ADD_CFLAGS([-D_FORTIFY_SOURCE=2]) Chris@40: Chris@40: if test x$enable_stack_smash_protection = "xyes" ; then Chris@40: XIPH_GCC_STACK_PROTECTOR Chris@40: XIPH_GXX_STACK_PROTECTOR Chris@40: fi Chris@40: Chris@40: if test x$enable_test_coverage = "xyes" ; then Chris@40: # MN_ADD_CFLAGS([-ftest-coverage]) Chris@40: MN_ADD_CFLAGS([-coverage]) Chris@40: fi Chris@40: Chris@40: common_flags="-Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wundef -Wuninitialized -Winit-self" Chris@40: Chris@40: # -Winline -Wconversion " Chris@40: CFLAGS="$CFLAGS $common_flags -Wbad-function-cast -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return" Chris@40: CXXFLAGS="$CXXFLAGS $common_flags -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo" Chris@40: Chris@40: if test "x$enable_gcc_opt" = "xno" ; then Chris@40: temp_CFLAGS=`echo $CFLAGS | $SED "s/O2/O0/"` Chris@40: CFLAGS=$temp_CFLAGS Chris@40: AC_MSG_WARN([[*** Compiler optimisations switched off. ***]]) Chris@40: fi Chris@40: Chris@40: # OS specific tweaks. Chris@40: case "$host_os" in Chris@40: darwin* | rhapsody*) Chris@40: # Disable -Wall, -pedantic and -Wshadow for Apple Darwin/Rhapsody. Chris@40: # System headers on these systems are broken. Chris@40: temp_CFLAGS=`echo $CFLAGS | $SED "s/-Wall -pedantic//" | $SED "s/-Wshadow//" | $SED "s/-Waggregate-return//"` Chris@40: CFLAGS=$temp_CFLAGS Chris@40: SHLIB_VERSION_ARG="-Wl,-exported_symbols_list -Wl,\$(srcdir)/Symbols.darwin" Chris@40: ;; Chris@40: linux*|kfreebsd*-gnu*|gnu*) Chris@40: SHLIB_VERSION_ARG="-Wl,--version-script=\$(srcdir)/Symbols.gnu-binutils" Chris@40: ;; Chris@40: mingw*) Chris@40: SHLIB_VERSION_ARG="-Wc,-static-libgcc -Wl,\$(srcdir)/libsndfile-1.def" Chris@40: win32_target_dll=1 Chris@40: if test x"$enable_shared" = xno ; then Chris@40: win32_target_dll=0 Chris@40: fi Chris@40: ;; Chris@40: os2*) Chris@40: SHLIB_VERSION_ARG="-Wl,-export-symbols \$(srcdir)/Symbols.os2" Chris@40: ;; Chris@40: *) Chris@40: ;; Chris@40: esac Chris@40: if test x$enable_gcc_pipe != "xno" ; then Chris@40: CFLAGS="$CFLAGS -pipe" Chris@40: fi Chris@40: Chris@40: COMPILER_IS_GCC=1 Chris@40: fi Chris@40: Chris@40: if test x$enable_werror = "xyes" ; then Chris@40: MN_ADD_CFLAGS([-Werror]) Chris@40: Chris@40: AC_LANG_PUSH([C++]) Chris@40: MN_ADD_CXXFLAGS([-Werror]) Chris@40: AC_LANG_POP([C++]) Chris@40: fi Chris@40: Chris@40: Chris@40: AC_DEFINE_UNQUOTED([WIN32_TARGET_DLL], ${win32_target_dll}, [Set to 1 if windows DLL is being built.]) Chris@40: AC_DEFINE_UNQUOTED([COMPILER_IS_GCC], ${COMPILER_IS_GCC}, [Set to 1 if the compile is GNU GCC.]) Chris@40: Chris@40: CFLAGS="$CFLAGS $OS_SPECIFIC_CFLAGS" Chris@40: Chris@40: if test x"$CFLAGS" = x ; then Chris@40: echo "Error in configure script. CFLAGS has been screwed up." Chris@40: exit Chris@40: fi Chris@40: Chris@40: HOST_TRIPLET="${host_cpu}-${host_vendor}-${host_os}" Chris@40: Chris@40: AC_DEFINE_UNQUOTED([HOST_TRIPLET], "${HOST_TRIPLET}", [The host triplet of the compiled binary.]) Chris@40: Chris@40: if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then Chris@40: OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS" Chris@40: fi Chris@40: Chris@40: WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -e "s/p.*//" -e "s/\./,/g"` Chris@40: Chris@40: Chris@40: if test "$enable_static" = no ; then Chris@40: SRC_BINDIR=src/.libs/ Chris@40: TEST_BINDIR=tests/.libs/ Chris@40: else Chris@40: SRC_BINDIR=src/ Chris@40: TEST_BINDIR=tests/ Chris@40: fi Chris@40: Chris@40: #------------------------------------------------------------------------------- Chris@40: Chris@40: AC_SUBST(HOST_TRIPLET) Chris@40: Chris@40: AC_SUBST(HTML_BGCOLOUR) Chris@40: AC_SUBST(HTML_FGCOLOUR) Chris@40: Chris@40: AC_SUBST(SHLIB_VERSION_ARG) Chris@40: AC_SUBST(SHARED_VERSION_INFO) Chris@40: AC_SUBST(CLEAN_VERSION) Chris@40: AC_SUBST(WIN_RC_VERSION) Chris@40: Chris@40: AC_SUBST(HAVE_EXTERNAL_XIPH_LIBS) Chris@40: AC_SUBST(OS_SPECIFIC_CFLAGS) Chris@40: AC_SUBST(OS_SPECIFIC_LINKS) Chris@40: AC_SUBST(ALSA_LIBS) Chris@40: AC_SUBST(SNDIO_LIBS) Chris@40: Chris@40: AC_SUBST(EXTERNAL_XIPH_CFLAGS) Chris@40: AC_SUBST(EXTERNAL_XIPH_LIBS) Chris@40: AC_SUBST(SRC_BINDIR) Chris@40: AC_SUBST(TEST_BINDIR) Chris@40: Chris@40: dnl The following line causes the libtool distributed with the source Chris@40: dnl to be replaced if the build system has a more recent version. Chris@40: AC_SUBST(LIBTOOL_DEPS) Chris@40: Chris@40: AC_CONFIG_FILES([ \ Chris@40: src/Makefile man/Makefile examples/Makefile tests/Makefile regtest/Makefile \ Chris@40: M4/Makefile doc/Makefile Win32/Makefile Octave/Makefile programs/Makefile \ Chris@40: Makefile \ Chris@40: src/version-metadata.rc tests/test_wrapper.sh tests/pedantic-header-test.sh \ Chris@40: doc/libsndfile.css Scripts/build-test-tarball.mk libsndfile.spec sndfile.pc \ Chris@40: src/sndfile.h \ Chris@40: echo-install-dirs Chris@40: ]) Chris@40: AC_OUTPUT Chris@40: Chris@40: # Make sure these are executable. Chris@40: chmod u+x tests/test_wrapper.sh Scripts/build-test-tarball.mk echo-install-dirs Chris@40: Chris@40: #==================================================================================== Chris@40: Chris@40: AC_MSG_RESULT([ Chris@40: -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- Chris@40: Chris@40: Configuration summary : Chris@40: Chris@40: libsndfile version : .................. ${VERSION} Chris@40: Chris@40: Host CPU : ............................ ${host_cpu} Chris@40: Host Vendor : ......................... ${host_vendor} Chris@40: Host OS : ............................. ${host_os} Chris@40: Chris@40: Experimental code : ................... ${enable_experimental:-no} Chris@40: Using ALSA in example programs : ...... ${enable_alsa:-no} Chris@40: External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no} Chris@40: ]) Chris@40: Chris@40: if test -z "$PKG_CONFIG" ; then Chris@40: echo " *****************************************************************" Chris@40: echo " *** The pkg-config program is missing. ***" Chris@40: echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***" Chris@40: echo " *** http://pkg-config.freedesktop.org/wiki/ ***" Chris@40: echo " *****************************************************************" Chris@40: echo Chris@40: fi Chris@40: Chris@40: echo " Tools :" Chris@40: echo Chris@40: echo " Compiler is Clang : ................... ${mn_cv_c_compiler_clang}" Chris@40: echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}" Chris@40: Chris@40: if test x$ac_cv_c_compiler_gnu = xyes ; then Chris@40: echo " GCC version : ......................... ${GCC_VERSION}" Chris@40: if test $GCC_MAJOR_VERSION -lt 3 ; then Chris@40: echo "\n" Chris@40: echo " ** This compiler version allows applications to write" Chris@40: echo " ** to static strings within the library." Chris@40: echo " ** Compile with GCC version 3.X or above to avoid this problem." Chris@40: fi Chris@40: fi Chris@40: echo " Sanitizer enabled : ................... ${enable_sanitizer:-no}" Chris@40: echo " Stack smash protection : .............. ${enable_stack_smash_protection:-no}" Chris@40: Chris@40: ./echo-install-dirs Chris@40: Chris@40: # Remove symlink created by Scripts/android-configure.sh. Chris@40: test -h gdbclient && rm -f gdbclient Chris@40: Chris@40: (cd src && make genfiles) Chris@40: (cd tests && make genfiles)