Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alexmarsev/soundtouch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroparviai <oparviai@f3a24b6a-cf45-0410-b55a-8c22e2698227>2015-05-01 10:55:47 +0300
committeroparviai <oparviai@f3a24b6a-cf45-0410-b55a-8c22e2698227>2015-05-01 10:55:47 +0300
commitc2a15f3c7e71e271483a02516579ef81fd7f90c3 (patch)
treea0775eeae2e78b54855711d54ddcd82d2f850d4d
parentcebdbcb4d303a9f05e526b871d9f527470f1e4f0 (diff)
Revised autoconf/automake scripts for easier adding of custom CXXFLAGS
-rw-r--r--configure.ac22
-rw-r--r--source/SoundStretch/Makefile.am2
-rw-r--r--source/SoundTouch/Makefile.am2
3 files changed, 16 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 5fd7868..e399dc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,7 @@ fi
if test "x$enable_openmp" = "xyes"; then
echo "****** openmp optimizations enabled ******"
- CXXFLAGS="-fopenmp $CXXFLAGS"
+ AM_CXXFLAGS="-fopenmp $AM_CXXFLAGS"
else
echo "****** openmp optimizations disabled ******"
fi
@@ -123,10 +123,9 @@ fi
if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xyes"; then
echo "****** x86 optimizations enabled ******"
- original_saved_CXXFLAGS=$CXXFLAGS
+ original_saved_CXXFLAGS=$AM_CXXFLAGS
have_mmx_intrinsics=no
- OPT_CXXFLAGS="-mmmx -Winline"
- CXXFLAGS="$OPT_CXXFLAGS $CXXFLAGS"
+ AM_CXXFLAGS="-mmmx -Winline $AM_CXXFLAGS"
# Check if the user can compile MMX code using intrinsics.
# 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);
return _mm_cvtsi64_si32 (loop);
}]])],[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.
#
@@ -157,9 +156,9 @@ if test "x$enable_x86_optimizations" = "xyes" -a "x$ac_cv_header_cpuid_h" = "xye
fi
+ # SSE support
have_sse_intrinsics=no
- OPT_CXXFLAGS="-msse -Winline"
- CXXFLAGS="$OPT_CXXFLAGS $CXXFLAGS"
+ AM_CXXFLAGS="-msse -Winline $AM_CXXFLAGS"
# Check if the user can compile SSE code using intrinsics.
# 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();
return 0;
}]])],[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.
#
@@ -195,6 +194,13 @@ else
AC_DEFINE([SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS],[1],[Do not use x86 optimizations])
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
# the user requested for it or if the system does not support them.
#
diff --git a/source/SoundStretch/Makefile.am b/source/SoundStretch/Makefile.am
index 0b4668f..6ed5146 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
+soundstretch_CXXFLAGS=-O3 $(AM_CXXFLAGS)
#clean-local:
# -rm -f additional-files-to-remove-on-make-clean
diff --git a/source/SoundTouch/Makefile.am b/source/SoundTouch/Makefile.am
index 6dda197..7aff51c 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 -I../../include
+AM_CXXFLAGS+=-O3
# Compile the files that need MMX and SSE individually.
libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la