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