PKGBUILDs/community/pjproject-savoirfairelinux/pjproject-sse2.patch
2018-01-01 14:40:33 +00:00

88 lines
3.7 KiB
Diff

diff -rupN pjproject-2.6/aconfigure.ac pjproject-2.6-new/aconfigure.ac
--- pjproject-2.6/aconfigure.ac 2017-01-25 12:23:08.000000000 +0100
+++ pjproject-2.6-new/aconfigure.ac 2017-09-01 18:52:24.843876152 +0200
@@ -5,12 +5,7 @@ host_orig="$host"
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
- pjlib/include/pj/compat/m_auto.h
- pjmedia/include/pjmedia/config_auto.h
- pjmedia/include/pjmedia-codec/config_auto.h
- pjsip/include/pjsip/sip_autoconf.h
- ])
+AC_CONFIG_HEADERS([pjlib/include/pj/compat/os_auto.h pjlib/include/pj/compat/m_auto.h pjmedia/include/pjmedia/config_auto.h pjmedia/include/pjmedia-codec/config_auto.h pjsip/include/pjsip/sip_autoconf.h])
AC_CONFIG_FILES([build.mak
build/os-auto.mak
build/cc-auto.mak
@@ -1785,6 +1780,24 @@ AC_SUBST(ac_no_webrtc)
AC_SUBST(ac_webrtc_instset)
AC_SUBST(ac_webrtc_cflags)
AC_SUBST(ac_webrtc_ldflags)
+
+AC_MSG_CHECKING(for available instruction set)
+AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <xmmintrin.h>
+ __m128 testfunc(float *a, float *b) {
+ return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
+ }
+ ]])],
+ [
+ instrset=sse2
+ ],
+ [
+ instrset=generic
+ ]
+)
+AC_MSG_RESULT($instrset)
+
AC_ARG_ENABLE(libwebrtc,
AS_HELP_STRING([--disable-libwebrtc],
[Exclude libwebrtc in the build]),
@@ -1840,7 +1853,7 @@ AC_ARG_ENABLE(libwebrtc,
ac_webrtc_cflags="-msse2"
;;
*win32* | *w32* | *darwin* | *linux*)
- ac_webrtc_instset=sse2
+ ac_webrtc_instset=$instrset
;;
*)
;;
diff -rupN pjproject-2.6/third_party/build/os-auto.mak.in pjproject-2.6-new/third_party/build/os-auto.mak.in
--- pjproject-2.6/third_party/build/os-auto.mak.in 2016-12-22 10:33:55.000000000 +0100
+++ pjproject-2.6-new/third_party/build/os-auto.mak.in 2017-09-01 18:52:24.846876150 +0200
@@ -104,8 +104,7 @@ else ifneq ($(findstring mips,@ac_webrtc
else # Generic fixed point
WEBRTC_SRC = \
modules/audio_processing/aecm/aecm_core_c.o \
- modules/audio_processing/ns/nsx_core_c.o \
- common_audio/signal_processing/complex_fft.o
+ modules/audio_processing/ns/nsx_core_c.o
endif
endif
endif
diff -rupN pjproject-2.6/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c pjproject-2.6-new/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c
--- pjproject-2.6/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c 2016-08-29 10:44:54.000000000 +0200
+++ pjproject-2.6-new/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_core.c 2017-09-01 18:52:24.847876149 +0200
@@ -1478,7 +1478,7 @@ AecCore* WebRtcAec_CreateAec() {
WebRtcAec_ComfortNoise = ComfortNoise;
WebRtcAec_SubbandCoherence = SubbandCoherence;
-#if defined(WEBRTC_ARCH_X86_FAMILY)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(__SSE2__)
if (WebRtc_GetCPUInfo(kSSE2)) {
WebRtcAec_InitAec_SSE2();
}
diff -rupN pjproject-2.6/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c pjproject-2.6-new/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c
--- pjproject-2.6/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c 2016-08-25 03:36:33.000000000 +0200
+++ pjproject-2.6-new/third_party/webrtc/src/webrtc/modules/audio_processing/aec/aec_rdft.c 2017-09-01 18:52:24.848876148 +0200
@@ -571,7 +571,7 @@ void aec_rdft_init(void) {
cftfsub_128 = cftfsub_128_C;
cftbsub_128 = cftbsub_128_C;
bitrv2_128 = bitrv2_128_C;
-#if defined(WEBRTC_ARCH_X86_FAMILY)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(__SSE2__)
if (WebRtc_GetCPUInfo(kSSE2)) {
aec_rdft_init_sse2();
}