Skip to content
Browse files

[rbp] fixed 8b6af54. propper compile fix for libsquish. thx Cory

  • Loading branch information...
1 parent 0de0af6 commit 3dd86bdc738905d62e9212d84887de81cc0423c9 @huceke huceke committed Aug 15, 2012
Showing with 12 additions and 9 deletions.
  1. +2 −9 lib/libsquish/Makefile.in
  2. +10 −0 lib/libsquish/config.h
View
11 lib/libsquish/Makefile.in
@@ -12,11 +12,6 @@ SRCS= \
squish.cpp
CXXFLAGS+=-I.
-ifeq ($(findstring powerpc,$(ARCH)),powerpc)
- CXXFLAGS+=-DSQUISH_USE_ALTIVEC=1 -maltivec
-else ifeq ($(findstring x86,$(ARCH)), x86)
- CXXFLAGS+=-DSQUISH_USE_SSE=2 -msse2
-endif
LIB=libsquish.a
@@ -32,11 +27,9 @@ all: $(LIB) $(NATIVE_LIB)
# TexturePacker links to libsquish and needs to run on build system, so make a native flavor.
$(NATIVE_LIB): $(SRCS)
ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
- g++ $(NATIVE_ARCH) -DSQUISH_USE_SSE=2 -msse2 -I. $(SRCS) -dynamiclib -install_name `pwd`/libsquish-native.so -o $@
-else ifeq ($(findstring arm,$(ARCH)),arm)
- g++ -I. $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@
+ g++ $(NATIVE_ARCH) -I. $(SRCS) -dynamiclib -install_name `pwd`/libsquish-native.so -o $@
else
- g++ -DSQUISH_USE_SSE=2 -msse2 -I. $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@
+ g++ -I. $(SRCS) -shared -fPIC -Wl,-soname,`pwd`/libsquish-native.so -o $@
endif
endif
View
10 lib/libsquish/config.h
@@ -28,13 +28,23 @@
// Set to 1 when building squish to use Altivec instructions.
#ifndef SQUISH_USE_ALTIVEC
+#if defined(__ALTIVEC__)
+#define SQUISH_USE_ALTIVEC 1
+#else
#define SQUISH_USE_ALTIVEC 0
#endif
+#endif
// Set to 1 or 2 when building squish to use SSE or SSE2 instructions.
#ifndef SQUISH_USE_SSE
+#if defined(__SSE2__)
+#define SQUISH_USE_SSE 2
+#elif defined(__SSE__)
+#define SQUISH_USE_SSE 1
+#else
#define SQUISH_USE_SSE 0
#endif
+#endif
// Internally set SQUISH_USE_SIMD when either Altivec or SSE is available.
#if SQUISH_USE_ALTIVEC && SQUISH_USE_SSE

0 comments on commit 3dd86bd

Please sign in to comment.
Something went wrong with that request. Please try again.