view libsquish-1.10.patch @ 6:d2e49291986e default tip

Add Linux (x86_64) support to SquishWrapper Also includes rebuild instructions for future
author IBBoard <dev@ibboard.co.uk>
date Sat, 06 Oct 2018 16:45:48 +0100
parents
children
line wrap: on
line source

diff -Nau /home/ibboard/temp/squish-1.10/alpha.cpp ./alpha.cpp
--- /home/ibboard/temp/squish-1.10/alpha.cpp	2006-06-29 13:43:24.000000000 +0100
+++ ./alpha.cpp	2013-11-30 14:40:56.668747938 +0000
@@ -25,6 +25,7 @@
    
 #include "alpha.h"
 #include <algorithm>
+#include <limits.h>
 
 namespace squish {
 
diff -Nau /home/ibboard/temp/squish-1.10/config ./config
--- /home/ibboard/temp/squish-1.10/config	2006-10-01 20:40:09.000000000 +0100
+++ ./config	2018-10-06 15:43:13.521557495 +0100
@@ -4,10 +4,10 @@
 USE_ALTIVEC ?= 0
 
 # define to 1 to use SSE2 instructions
-USE_SSE ?= 0
+USE_SSE ?= 1
 
 # default flags
-CXXFLAGS ?= -O2
+CXXFLAGS ?= -O2 -fPIC
 ifeq ($(USE_ALTIVEC),1)
 CPPFLAGS += -DSQUISH_USE_ALTIVEC=1
 CXXFLAGS += -maltivec
Common subdirectories: /home/ibboard/temp/squish-1.10/extra and ./extra
diff -Nau /home/ibboard/temp/squish-1.10/Makefile ./Makefile
--- /home/ibboard/temp/squish-1.10/Makefile	2006-04-07 18:30:11.000000000 +0100
+++ ./Makefile	2018-10-06 16:39:32.710493023 +0100
@@ -5,9 +5,12 @@
 
 OBJ = $(SRC:%.cpp=%.o)
 
+SO = libsquish.so
+
 LIB = libsquish.a
 
 all : $(LIB)
+	$(CXX) $(OBJ) -shared -o $(SO)
 
 install : $(LIB)
 	install squish.h $(INSTALL_DIR)/include 
@@ -25,7 +28,7 @@
 	$(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o$@ -c $<
 
 clean :
-	$(RM) $(OBJ) $(LIB)
+	$(RM) $(OBJ) $(LIB) $(SO)
 
 
 
diff -Nau /home/ibboard/temp/squish-1.10/singlecolourfit.cpp ./singlecolourfit.cpp
--- /home/ibboard/temp/squish-1.10/singlecolourfit.cpp	2007-03-21 19:43:59.000000000 +0000
+++ ./singlecolourfit.cpp	2013-11-30 14:40:56.670747952 +0000
@@ -26,6 +26,7 @@
 #include "singlecolourfit.h"
 #include "colourset.h"
 #include "colourblock.h"
+#include <limits.h>
 
 namespace squish {
 
diff -Nau /home/ibboard/temp/squish-1.10/squish.h ./squish.h
--- /home/ibboard/temp/squish-1.10/squish.h	2007-03-21 20:13:51.000000000 +0000
+++ ./squish.h	2018-10-06 15:02:57.777805856 +0100
@@ -214,7 +214,7 @@
 	much memory is required in the compressed image, use
 	squish::GetStorageRequirements.
 */
-void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags );
+extern "C" void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags );
 
 // -----------------------------------------------------------------------------
 
@@ -237,7 +237,7 @@
 
 	Internally this function calls squish::Decompress for each block.
 */
-void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
+extern "C" void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
 
 // -----------------------------------------------------------------------------
 
Common subdirectories: /home/ibboard/temp/squish-1.10/squish.xcodeproj and ./squish.xcodeproj
Common subdirectories: /home/ibboard/temp/squish-1.10/vs7 and ./vs7