Skip to content

Commit

Permalink
[rbp] fixed 8b6af54. propper compile fix for libsquish. thx Cory
Browse files Browse the repository at this point in the history
  • Loading branch information
huceke committed Aug 15, 2012
1 parent 0de0af6 commit 3dd86bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/libsquish/Makefile.in
Expand Up @@ -12,11 +12,6 @@ SRCS= \
squish.cpp squish.cpp


CXXFLAGS+=-I. 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 LIB=libsquish.a


Expand All @@ -32,11 +27,9 @@ all: $(LIB) $(NATIVE_LIB)
# TexturePacker links to libsquish and needs to run on build system, so make a native flavor. # TexturePacker links to libsquish and needs to run on build system, so make a native flavor.
$(NATIVE_LIB): $(SRCS) $(NATIVE_LIB): $(SRCS)
ifeq ($(findstring Darwin,$(shell uname -s)),Darwin) 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 $@ g++ $(NATIVE_ARCH) -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 $@
else 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
endif endif


Expand Down
10 changes: 10 additions & 0 deletions lib/libsquish/config.h
Expand Up @@ -28,13 +28,23 @@


// Set to 1 when building squish to use Altivec instructions. // Set to 1 when building squish to use Altivec instructions.
#ifndef SQUISH_USE_ALTIVEC #ifndef SQUISH_USE_ALTIVEC
#if defined(__ALTIVEC__)
#define SQUISH_USE_ALTIVEC 1
#else
#define SQUISH_USE_ALTIVEC 0 #define SQUISH_USE_ALTIVEC 0
#endif #endif
#endif


// Set to 1 or 2 when building squish to use SSE or SSE2 instructions. // Set to 1 or 2 when building squish to use SSE or SSE2 instructions.
#ifndef SQUISH_USE_SSE #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 #define SQUISH_USE_SSE 0
#endif #endif
#endif


// Internally set SQUISH_USE_SIMD when either Altivec or SSE is available. // Internally set SQUISH_USE_SIMD when either Altivec or SSE is available.
#if SQUISH_USE_ALTIVEC && SQUISH_USE_SSE #if SQUISH_USE_ALTIVEC && SQUISH_USE_SSE
Expand Down

0 comments on commit 3dd86bd

Please sign in to comment.