diff --git a/configure.ac b/configure.ac index e79d384..b9850f8 100644 --- a/configure.ac +++ b/configure.ac @@ -78,10 +78,15 @@ AC_C_INLINE AC_ARG_ENABLE(integer-samples, [AC_HELP_STRING([--enable-integer-samples], [use integer samples instead of floats -[default=yes]])],, +[default=no]])],, [enable_integer_samples=no]) +AC_ARG_ENABLE(openmp, + [AC_HELP_STRING([--enable-openmp], + [use parallel multicore calculation through OpenMP [default=yes]])],, + [enable_openmp=yes]) + # Let the user enable/disable the x86 optimizations. # Useful when compiling on non-x86 architectures. AC_ARG_ENABLE([x86-optimizations], @@ -105,6 +110,14 @@ else fi +if test "x$enable_openmp" = "xyes"; then + echo "****** openmp optimizations enabled ******" + CXXFLAGS="-fopenmp $CXXFLAGS" +else + echo "****** openmp optimizations disabled ******" +fi + + # Check if optimizations are supported in the system at build time. if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xyes"; then echo "****** x86 optimizations enabled ******" diff --git a/source/SoundStretch/Makefile.am b/source/SoundStretch/Makefile.am index 9033722..0b4668f 100644 --- a/source/SoundStretch/Makefile.am +++ b/source/SoundStretch/Makefile.am @@ -48,7 +48,7 @@ soundstretch_LDADD=../SoundTouch/libSoundTouch.la -lm #soundstretch_LDFLAGS=-s ## additional compiler flags -soundstretch_CXXFLAGS=-O3 -fopenmp +soundstretch_CXXFLAGS=-O3 #clean-local: # -rm -f additional-files-to-remove-on-make-clean diff --git a/source/SoundTouch/Makefile.am b/source/SoundTouch/Makefile.am index e458fb5..6dda197 100644 --- a/source/SoundTouch/Makefile.am +++ b/source/SoundTouch/Makefile.am @@ -34,7 +34,7 @@ libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp \ InterpolateShannon.cpp # Compiler flags -AM_CXXFLAGS=-O3 -fopenmp -I../../include +AM_CXXFLAGS=-O3 -I../../include # Compile the files that need MMX and SSE individually. libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la