audio/csound: fix build on powerpc*

PR:		236315
Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl>
This commit is contained in:
Yuri Victorovich 2019-03-07 03:40:34 +00:00
parent 6d333438d9
commit 05dfa0a728
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=494873
3 changed files with 36 additions and 7 deletions

View file

@ -23,6 +23,9 @@ USES= alias bison cmake compiler:c++11-lib eigen:3 localbase ncurses python:2.7
USE_GITHUB= yes
USE_LDCONFIG= yes
CFLAGS_powerpc= -maltivec
CFLAGS_powerpcspe= -DPFFFT_SIMD_DISABLE
CFLAGS_powerpc64= -maltivec
CMAKE_ARGS= -DBUILD_CSOUNDVST:BOOL=OFF \
-DBUILD_PD_CLASS:BOOL=OFF \
-DPYTHON_MODULE_INSTALL_DIR:PATH="${PYTHONPREFIX_SITELIBDIR}" \

View file

@ -20,13 +20,7 @@
set(JAVA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR} CACHE PATH "Java module install dir")
set(LUA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR} CACHE PATH "Lua module install dir")
@@ -373,12 +373,12 @@ endif()
endif(WIN32)
-if(APPLE)
+if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "${OPSYS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
@@ -378,7 +378,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc+
set_target_properties(${CSOUNDLIB} PROPERTIES CXX_COMPILE_FLAGS "-std=c++11")
endif()

View file

@ -0,0 +1,32 @@
--- OOps/pffft.c.orig 2019-03-05 17:24:02 UTC
+++ OOps/pffft.c
@@ -63,6 +63,9 @@
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
+#if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__))
+#include <altivec.h>
+#endif
/* detect compiler flavour */
#if defined(_MSC_VER)
@@ -114,8 +117,8 @@ inline v4sf ld_ps1(const float *p) { v4sf v=vec_lde(0,
# define LD_PS1(p) ld_ps1(&p)
# define INTERLEAVE2(in1, in2, out1, out2) { v4sf tmp__ = vec_mergeh(in1, in2); out2 = vec_mergel(in1, in2); out1 = tmp__; }
# define UNINTERLEAVE2(in1, in2, out1, out2) { \
- vector unsigned char vperm1 = (vector unsigned char)(0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); \
- vector unsigned char vperm2 = (vector unsigned char)(4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); \
+ vector unsigned char vperm1 = (vector unsigned char){0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27}; \
+ vector unsigned char vperm2 = (vector unsigned char){4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31}; \
v4sf tmp__ = vec_perm(in1, in2, vperm1); out2 = vec_perm(in1, in2, vperm2); out1 = tmp__; \
}
# define VTRANSPOSE4(x0,x1,x2,x3) { \
@@ -128,7 +131,7 @@ inline v4sf ld_ps1(const float *p) { v4sf v=vec_lde(0,
x2 = vec_mergeh(y1, y3); \
x3 = vec_mergel(y1, y3); \
}
-# define VSWAPHL(a,b) vec_perm(a,b, (vector unsigned char)(16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15))
+# define VSWAPHL(a,b) vec_perm(a,b, (vector unsigned char){16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15})
# define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0xF) == 0)
/*