mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-06 23:20:03 +01:00
Revised autoconf/automake scripts for easier adding of custom CXXFLAGS
This commit is contained in:
parent
cbfec4188e
commit
708f1d7e0b
22
configure.ac
22
configure.ac
@ -113,7 +113,7 @@ fi
|
|||||||
|
|
||||||
if test "x$enable_openmp" = "xyes"; then
|
if test "x$enable_openmp" = "xyes"; then
|
||||||
echo "****** openmp optimizations enabled ******"
|
echo "****** openmp optimizations enabled ******"
|
||||||
CXXFLAGS="-fopenmp $CXXFLAGS"
|
AM_CXXFLAGS="-fopenmp $AM_CXXFLAGS"
|
||||||
else
|
else
|
||||||
echo "****** openmp optimizations disabled ******"
|
echo "****** openmp optimizations disabled ******"
|
||||||
fi
|
fi
|
||||||
@ -123,10 +123,9 @@ fi
|
|||||||
if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xyes"; then
|
if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xyes"; then
|
||||||
echo "****** x86 optimizations enabled ******"
|
echo "****** x86 optimizations enabled ******"
|
||||||
|
|
||||||
original_saved_CXXFLAGS=$CXXFLAGS
|
original_saved_CXXFLAGS=$AM_CXXFLAGS
|
||||||
have_mmx_intrinsics=no
|
have_mmx_intrinsics=no
|
||||||
OPT_CXXFLAGS="-mmmx -Winline"
|
AM_CXXFLAGS="-mmmx -Winline $AM_CXXFLAGS"
|
||||||
CXXFLAGS="$OPT_CXXFLAGS $CXXFLAGS"
|
|
||||||
|
|
||||||
# Check if the user can compile MMX code using intrinsics.
|
# Check if the user can compile MMX code using intrinsics.
|
||||||
# GCC supports MMX intrinsics since version 3.3
|
# GCC supports MMX intrinsics since version 3.3
|
||||||
@ -140,7 +139,7 @@ if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xye
|
|||||||
__m64 loop = _mm_cvtsi32_si64 (1);
|
__m64 loop = _mm_cvtsi32_si64 (1);
|
||||||
return _mm_cvtsi64_si32 (loop);
|
return _mm_cvtsi64_si32 (loop);
|
||||||
}]])],[have_mmx_intrinsics=yes])
|
}]])],[have_mmx_intrinsics=yes])
|
||||||
CXXFLAGS=$original_saved_CXXFLAGS
|
AM_CXXFLAGS=$original_saved_CXXFLAGS
|
||||||
|
|
||||||
# Inform the user if we did or did not find MMX support.
|
# Inform the user if we did or did not find MMX support.
|
||||||
#
|
#
|
||||||
@ -157,9 +156,9 @@ if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xye
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# SSE support
|
||||||
have_sse_intrinsics=no
|
have_sse_intrinsics=no
|
||||||
OPT_CXXFLAGS="-msse -Winline"
|
AM_CXXFLAGS="-msse -Winline $AM_CXXFLAGS"
|
||||||
CXXFLAGS="$OPT_CXXFLAGS $CXXFLAGS"
|
|
||||||
|
|
||||||
# Check if the user can compile SSE code using intrinsics.
|
# Check if the user can compile SSE code using intrinsics.
|
||||||
# GCC supports SSE intrinsics since version 3.3
|
# GCC supports SSE intrinsics since version 3.3
|
||||||
@ -173,7 +172,7 @@ if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xye
|
|||||||
_mm_setzero_ps();
|
_mm_setzero_ps();
|
||||||
return 0;
|
return 0;
|
||||||
}]])],[have_sse_intrinsics=yes])
|
}]])],[have_sse_intrinsics=yes])
|
||||||
CXXFLAGS=$original_saved_CXXFLAGS
|
AM_CXXFLAGS=$original_saved_CXXFLAGS
|
||||||
|
|
||||||
# Inform the user if we did or did not find SSE support.
|
# Inform the user if we did or did not find SSE support.
|
||||||
#
|
#
|
||||||
@ -195,6 +194,13 @@ else
|
|||||||
AC_DEFINE([SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS],[1],[Do not use x86 optimizations])
|
AC_DEFINE([SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS],[1],[Do not use x86 optimizations])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set AM_CXXFLAGS
|
||||||
|
AC_SUBST([AM_CXXFLAGS], [$AM_CXXFLAGS])
|
||||||
|
|
||||||
|
# Empty default CXXFLAGS so user can set them if desirable
|
||||||
|
AC_SUBST([CXXFLAGS], [ ])
|
||||||
|
|
||||||
|
|
||||||
# SSTypes.h by default enables optimizations. Those already got disabled if
|
# SSTypes.h by default enables optimizations. Those already got disabled if
|
||||||
# the user requested for it or if the system does not support them.
|
# the user requested for it or if the system does not support them.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -48,7 +48,7 @@ soundstretch_LDADD=../SoundTouch/libSoundTouch.la -lm
|
|||||||
#soundstretch_LDFLAGS=-s
|
#soundstretch_LDFLAGS=-s
|
||||||
|
|
||||||
## additional compiler flags
|
## additional compiler flags
|
||||||
soundstretch_CXXFLAGS=-O3
|
soundstretch_CXXFLAGS=-O3 $(AM_CXXFLAGS)
|
||||||
|
|
||||||
#clean-local:
|
#clean-local:
|
||||||
# -rm -f additional-files-to-remove-on-make-clean
|
# -rm -f additional-files-to-remove-on-make-clean
|
||||||
|
|||||||
@ -34,7 +34,7 @@ libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp \
|
|||||||
InterpolateShannon.cpp
|
InterpolateShannon.cpp
|
||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
AM_CXXFLAGS=-O3 -I../../include
|
AM_CXXFLAGS+=-O3
|
||||||
|
|
||||||
# Compile the files that need MMX and SSE individually.
|
# Compile the files that need MMX and SSE individually.
|
||||||
libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la
|
libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user