macstl stable port information

Package: macstl
Version: 0.3.1
Revision: 3
Maintainer: David Fang
Source: http://www.pixelglow.com/downloads/%n-%v.tgz
Source-MD5: 28288965464ed69718d616f7596939bb
License: OSI-Approved
Homepage: http://www.pixelglow.com/macstl/
Description: SIMD-accelerated C++ generic library
DescDetail: <<
The C++ header library designed to bring the world of generic programming to
the Macintosh, and deliver the surprising speed of SIMD in an intuitive
cross-platform package.

Generic programming is the art -- some say, the black art -- of making
software components super-reusable and yet ultra-efficient.
Our tool is the C++ template, and our result is code nearly as fast as
hand-coded machine language.

macstl was inspired by the premier generic library, the Standard Template
Library (now part of the C++ Standard Library), but with a distinct
Macintosh flavor. Many components let you use low-level Mac OS X
functionality like SIMD acceleration and memory copy-on-write easily and
intuitively.

macstl is dual-licensed under the open-source Reciprocal Public License (RPL)
and the proprietary Pixelglow Source License (PSL).
<<
DescPackaging: <<
This is built/installed unix-style, not using Xcode's build.
Thus, the macstl.framework is not installed.
<<
DescUsage: <<
macstl only consists of headers, no static or shared libraries.
To use it, simply include pass -I%p/include to CPPFLAGS/CXXCPPFLAGS
during compilation.
<<
# DescPort:
BuildDepends: fink (>= 0.24.12)
BuildDependsOnly: true
SourceDirectory: macstl
PatchFile: %n.patch
PatchFile-MD5: bddfdbc4868fa4ec2ceeab481c3322e2
# ConfigureParams:
CompileScript: <<
#!/bin/sh -ev
# no configure
# really only needed for testing
cd unix
make
<<
InfoTest: <<
TestScript: <<
#!/bin/sh -ev
cd unix
./vectest
./mmaptest
./benchmark
# TODO: there are more tests in the test/ subdir
<<
TestSuiteSize: medium
<<
InstallScript: <<
#/bin/sh -ev
mkdir -p %i/include
cp -R %n %i/include
# license files will go to DocFiles
rm -f %i/include/%n/*.rtf
cp -R macstlizer %i/include
mkdir -p %i/bin
mv %i/include/macstlizer/altivec2macstl.pl %i/bin/
<<
DocFiles: <<
readme.rtf
macstl/rpl-license.rtf
macstl/psl-license.rtf
<<
# InfoDocs:

macstl stable port .patch

diff -ur macstl-orig/unix/Makefile macstl/unix/Makefile
--- macstl-orig/unix/Makefile 2010-04-18 13:11:50.000000000 -0700
+++ macstl/unix/Makefile 2010-04-18 13:20:46.000000000 -0700
@@ -2,7 +2,7 @@

CC = g++

-ifeq ($(shell uname -m | grep -o ppc), ppc)
+ifeq ($(shell uname -p | grep -o powerpc), powerpc)
PLATFORM = PPC
else
ifeq ($(shell uname -m | grep -o 86), 86)
@@ -11,17 +12,22 @@
endif

ifeq ($(PLATFORM), PPC)
-COMMON_OPT = -maltivec -O3 -static -lstdc++ -lm
+COMMON_OPT = -faltivec -O3
else
ifeq ($(PLATFORM), x86)
-COMMON_OPT = -march=pentium4 -mfpmath=sse -O3 -static -lstdc++ -lm
+COMMON_OPT = -mfpmath=sse -O3
+# patch: let compiler_wrapper set -arch to i386 or x86_64
endif
endif
+# COMMON_OPT += -static -lstdc++ -lm
+# patch: paranoid check standard conformance and cleanliness
+COMMON_OPT += -Wall -W -Werror -ansi -pedantic-errors -Wno-long-long

all : benchmark mmaptest vectest

benchmark : ../test/benchmark.cpp common.h
- $(CC) $(COMMON_OPT) -fno-unit-at-time -I$(MACSTL_DIR) $< -o $@
+ $(CC) $(COMMON_OPT) -I$(MACSTL_DIR) $< -o $@
+# patch: unknown flag -fno-unit-at-a-time

mmaptest : ../test/mmaptest.cpp
$(CC) $(COMMON_OPT) -I$(MACSTL_DIR) $< -o $@
diff -ur macstl-orig/macstl/impl/vec_altivec.h macstl/macstl/impl/vec_altivec.h
--- macstl-orig/macstl/impl/vec_altivec.h 2005-09-04 18:07:46.000000000 -0700
+++ macstl/macstl/impl/vec_altivec.h 2010-04-18 15:43:35.000000000 -0700
@@ -4261,7 +4261,7 @@
result = altivec::max (result, altivec::slo (result, vec ::fill <16> ()));
result = altivec::max (result, altivec::slo (result, vec ::fill <32> ()));
return altivec::max (result, altivec::slo (result, vec ::fill <64> ())) [0];
- };
+ }

INLINE unsigned short accumulator , macstl::vec > >::operator() (const macstl::vec & lhs) const
{
diff -ur macstl-orig/macstl/impl/vec_mmx.h macstl/macstl/impl/vec_mmx.h
--- macstl-orig/macstl/impl/vec_mmx.h 2005-09-04 08:15:33.000000000 -0700
+++ macstl/macstl/impl/vec_mmx.h 2010-04-18 14:47:30.000000000 -0700
@@ -290,7 +290,7 @@
__m64 vec;
};

- static const union_type un = {v0, v1};
+ static const union_type un = {{v0, v1}};
return un.vec;
}
};
@@ -319,7 +319,7 @@
__m128 vec;
};

- static const union_type un = {v0, v1, v2, v3};
+ static const union_type un = {{v0, v1, v2, v3}};
return un.vec;
}
};
@@ -349,7 +349,7 @@
__m128d vec;
};

- static const union_type un = {v0, v1, v2, v3};
+ static const union_type un = {{v0, v1, v2, v3}};
return un.vec;
}
};
@@ -372,7 +372,7 @@
__m128i vec;
};

- static const union_type un = {v0, v1, v2, v3};
+ static const union_type un = {{v0, v1, v2, v3}};
return un.vec;
}
};
@@ -1607,7 +1607,7 @@
static INLINE const vec set (
value_type v0, value_type v1)
{
- union_type un = {v0, v1};
+ union_type un = {{v0, v1}};
return un.vec;
}

@@ -1663,7 +1663,7 @@
static INLINE const vec set (
value_type v0, value_type v1)
{
- union_type un = {v0, v1};
+ union_type un = {{v0, v1}};
return un.vec;
}

@@ -1719,7 +1719,7 @@
static INLINE const vec set (
value_type v0, value_type v1)
{
- union_type un = {v0.data (), v1.data ()};
+ union_type un = {{v0.data (), v1.data ()}};
return un.vec;
}

@@ -2775,7 +2775,9 @@

DEFINE_MMX_UNARY_FUNCTION_WITH_LITERAL (srai, _mm_srai_epi16, M128I_I16, M128I_I16)
DEFINE_MMX_UNARY_FUNCTION_WITH_LITERAL (srai, _mm_srai_epi32, M128I_I32, M128I_I32)
+#if 0 && defined(__x86_64__)
DEFINE_MMX_UNARY_FUNCTION_WITH_LITERAL (srai, _mm_srai_epi64, M128I_I64, M128I_I64)
+#endif

DEFINE_MMX_BINARY_FUNCTION (srl, _mm_srl_epi16, M128I_I16, M128I_U16, M128I_I16)
DEFINE_MMX_BINARY_FUNCTION (srl, _mm_srl_epi16, M128I_U16, M128I_U16, M128I_U16)
diff -ur macstl-orig/macstl/vec.h macstl/macstl/vec.h
--- macstl-orig/macstl/vec.h 2005-08-17 08:15:28.000000000 -0700
+++ macstl/macstl/vec.h 2010-04-18 14:53:09.000000000 -0700
@@ -429,7 +429,7 @@

//@{
DEFINE_VEC_COMMON_UNARY_FUNCTION(operator+,identity)
-DEFINE_VEC_COMMON_UNARY_FUNCTION(operator+,negate)
+DEFINE_VEC_COMMON_UNARY_FUNCTION(operator-,negate)
DEFINE_VEC_COMMON_UNARY_FUNCTION(operator~,bitwise_not)
//@}

@@ -452,8 +452,8 @@
DEFINE_VEC_COMMON_BINARY_FUNCTION(operator+,plus)
DEFINE_VEC_COMMON_BINARY_FUNCTION(operator-,minus)
DEFINE_VEC_COMMON_BINARY_FUNCTION(operator^,bitwise_xor)
-DEFINE_VEC_COMMON_BINARY_FUNCTION(operator-,bitwise_and)
-DEFINE_VEC_COMMON_BINARY_FUNCTION(operator-,bitwise_or)
+DEFINE_VEC_COMMON_BINARY_FUNCTION(operator&,bitwise_and)
+DEFINE_VEC_COMMON_BINARY_FUNCTION(operator|,bitwise_or)
DEFINE_VEC_COMMON_BINARY_FUNCTION(operator<<,shift_left)
DEFINE_VEC_COMMON_BINARY_FUNCTION(operator>>,shift_right)
//@}

macstl _unstable_ port .patch