2006-09-29 22:48:07 -04:00
dnl
dnl libresample configure.in script
dnl
dnl Dominic Mazzoni
dnl
AC_PREREQ(2.59)
AC_INIT(libresample, 0.13, BUG-REPORT-ADDRESS)
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE(libresample,0.13)
AC_CONFIG_SRCDIR([src/resample.c])
AC_PREFIX_DEFAULT(/usr/local/freeswitch)
#Set default language
AC_LANG_C
# Checks for programs.
AC_PROG_CC
AC_PROG_AWK
AC_PROG_MAKE_SET
2007-10-24 11:11:46 -04:00
AM_PROG_CC_C_O
2006-09-29 22:48:07 -04:00
AC_PROG_INSTALL
AC_PROG_LIBTOOL
#Check for compiler vendor
AX_COMPILER_VENDOR
# Optimize
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
if test "${enable_optimizer}" = "yes" ; then
AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
AX_CC_MAXOPT
fi
# Enable debugging
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],[build with debug information])],[enable_debug="$enable_debug"],[enable_debug="yes"])
if test "${enable_debug}" = "yes"; then
AC_DEFINE([DEBUG],[],[Enable extra debugging.])
AX_CFLAGS_WARN_ALL_ANSI
fi
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
2008-03-19 13:56:27 -04:00
echo host $host
echo ax_cv_c_compiler_vendor ${ax_cv_c_compiler_vendor}
2006-09-29 22:48:07 -04:00
case "$host" in
*-solaris2*)
2007-12-03 11:29:07 -05:00
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
2006-09-29 22:48:07 -04:00
new_AM_CFLAGS="-KPIC -DPIC"
2007-12-03 11:29:07 -05:00
new_AM_LDFLAGS="-R${prefix}/lib"
2006-09-29 22:48:07 -04:00
FUNC_DEF=__func__
IN_LINE=""
2007-12-03 11:29:07 -05:00
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
SOLINK="-Bdynamic -dy -G"
2006-09-29 22:48:07 -04:00
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
IN_LINE=inline
fi
DYNAMIC_LIB_EXTEN="so"
;;
*-darwin*)
if test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
2006-12-14 17:30:10 -05:00
SOLINK="-dynamic -bundle -force-flat-namespace"
2006-09-29 22:48:07 -04:00
new_AM_CFLAGS="-DMACOSX"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="dylib"
;;
x86_64-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
2007-12-03 11:29:07 -05:00
new_AM_LDFLAGS="-R${prefix}/lib"
2006-09-29 22:48:07 -04:00
FUNC_DEF=__func__
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
;;
i*6-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
2007-12-03 11:29:07 -05:00
new_AM_LDFLAGS="-R${prefix}/lib"
2006-09-29 22:48:07 -04:00
FUNC_DEF=__func__
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
;;
2007-12-03 11:29:07 -05:00
x86_64-*-freebsd*|amd64-*-freebsd*)
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
DYNAMIC_LIB_EXTEN="so"
;;
i*6-*-freebsd*)
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
DYNAMIC_LIB_EXTEN="so"
;;
2006-09-29 22:48:07 -04:00
esac
2007-11-15 16:02:53 -05:00
# Enable 64 bit build
AC_ARG_ENABLE(64,
[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
if test "${enable_64}" = "yes"; then
new_AM_CFLAGS="$new_AM_CFLAGS -m64"
fi
fi
2006-09-29 22:48:07 -04:00
AC_SUBST(new_AM_CFLAGS)
AC_SUBST(new_AM_LDFLAGS)
AC_SUBST(SOLINK)
AC_SUBST(DYNAMIC_LIB_EXTEN)
AC_DEFINE_UNQUOTED([__FUNCTION__],[$FUNC_DEF],[define it the right way ;)])
AC_DEFINE_UNQUOTED([inline],[$IN_LINE],[sunpro is bad at inline])
AC_CHECK_LIB(sndfile, sf_open, have_libsndfile=yes, have_libsndfile=no)
AC_CHECK_LIB(samplerate, src_simple, have_libsamplerate=yes, have_libsamplerate=no)
AM_CONDITIONAL([SAMPLE], [test $have_libsamplerate = "yes"])
AM_CONDITIONAL([SNDFILE],[test $have_libsndfile = "yes"])
AC_CHECK_HEADERS(inttypes.h)
2007-03-20 18:50:57 -04:00
AC_CONFIG_HEADERS(src/config.h:src/configtemplate.h)
2006-09-29 22:48:07 -04:00
AC_OUTPUT([Makefile])
echo ""
if [[ $have_libsamplerate = "yes" ]] ; then
echo "Configured to build tests/resample-sndfile using libsndfile"
echo ""
else
echo "Could not find libsndfile - needed if you want to"
echo "compile tests/resample-sndfile"
echo ""
fi
if [[ $have_libsamplerate = "yes" ]] ; then
echo "Configured to build tests/compareresample to compare against"
echo "Erik de Castro Lopo's libsamplerate library."
echo ""
else
echo "Could not find libsamplerate - only needed if you want to"
echo "compile tests/compareresample to compare their performance."
echo ""
fi
echo "Type 'configure --help' to see options."
echo ""
echo "Type 'make' to build libresample and tests."