diff -ur ladspa_sdk-orig/src/applyplugin.c ladspa_sdk/src/applyplugin.c
--- ladspa_sdk-orig/src/applyplugin.c	2002-05-19 00:01:36.000000000 +0700
+++ ladspa_sdk/src/applyplugin.c	2007-05-15 22:01:43.013780887 +0700
@@ -6,7 +6,16 @@
 /*****************************************************************************/
 
 #include <dlfcn.h>
+#if defined(sun)
+#include <sys/byteorder.h>
+#if defined(_BIG_ENDIAN)
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
+#else
 #include <endian.h>
+#endif
 #include <errno.h>
 #include <math.h>
 #include <stdlib.h>
diff -ur ladspa_sdk-orig/src/makefile ladspa_sdk/src/makefile
--- ladspa_sdk/src/makefile-orig	2008-03-09 15:18:36.847511000 -0500
+++ ladspa_sdk/src/makefile	2008-03-09 15:18:24.661697000 -0500
@@ -4,19 +4,17 @@
 #
 # Change these if you want to install somewhere else.
 
-INSTALL_PLUGINS_DIR	=	/usr/lib/ladspa/
-INSTALL_INCLUDE_DIR	=	/usr/include/
-INSTALL_BINARY_DIR	=	/usr/bin/
+INSTALL_PLUGINS_DIR   =       $(libexecdir)/ladspa
+INSTALL_INCLUDE_DIR   =       $(includedir)
+INSTALL_BINARY_DIR    =       $(bindir)
 
 ###############################################################################
 #
 # GENERAL
 #
 
-INCLUDES	=	-I.
-LIBRARIES	=	-ldl -lm
-CFLAGS		=	$(INCLUDES) -Wall -Werror -O3 -fPIC
-CXXFLAGS	=	$(CFLAGS)
+INCLUDES	=	-I. $(CPPFLAGS)
+LIBS		=	-ldl -lm
 PLUGINS		=	../plugins/amp.so				\
 			../plugins/delay.so				\
 			../plugins/filter.so				\
@@ -25,8 +23,6 @@ PLUGINS		=	../plugins/amp.so				\
 PROGRAMS	=	../bin/analyseplugin				\
 			../bin/applyplugin 				\
 			../bin/listplugins
-CC		=	cc
-CPP		=	c++
 
 ###############################################################################
 #
@@ -34,19 +30,21 @@ CPP		=	c++
 #
 
 ../plugins/%.so:	plugins/%.c ladspa.h
-	$(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
-	$(LD) -o ../plugins/$*.so plugins/$*.o -shared
+	$(CC) $(INCLUDES) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+	$(LD) -G -o ../plugins/$*.so plugins/$*.o $(LIBS)
 
 ../plugins/%.so:	plugins/%.cpp ladspa.h
-	$(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
-	$(CPP) -o ../plugins/$*.so plugins/$*.o -shared
+	$(CXX) $(INCLUDES) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+	$(CXX) $(CXXFLAGS) -G -o ../plugins/$*.so plugins/$*.o $(LIBS) 
 
 ###############################################################################
 #
 # TARGETS
 #
 
-test:	/tmp/test.wav ../snd/noise.wav always
+all: targets
+
+test:	../snd/noise.wav
 	@echo ---------------------------------------------
 	@echo First listen to the white noise input signal:
 	@echo ---------------------------------------------
@@ -58,13 +56,14 @@ test:	/tmp/test.wav ../snd/noise.wav alw
 	-sndfile-play /tmp/test.wav
 	@echo Test complete.
 
-install:	targets
-	-mkdirhier $(INSTALL_PLUGINS_DIR)
-	-mkdirhier $(INSTALL_INCLUDE_DIR)
-	-mkdirhier $(INSTALL_BINARY_DIR)
-	cp ../plugins/* $(INSTALL_PLUGINS_DIR)
-	cp ladspa.h $(INSTALL_INCLUDE_DIR)
-	cp ../bin/* $(INSTALL_BINARY_DIR)
+install: targets
+	-mkdir -p       $(DESTDIR)$(INSTALL_PLUGINS_DIR)	\
+                      $(DESTDIR)$(INSTALL_INCLUDE_DIR)		\
+                      $(DESTDIR)$(INSTALL_BINARY_DIR)
+	cp ../plugins/* $(DESTDIR)$(INSTALL_PLUGINS_DIR)
+	cp ladspa.h $(DESTDIR)$(INSTALL_INCLUDE_DIR)
+	cp ../bin/* $(DESTDIR)$(INSTALL_BINARY_DIR)
+
 
 /tmp/test.wav:	targets ../snd/noise.wav
 	../bin/listplugins
@@ -90,17 +89,17 @@ targets:	$(PLUGINS) $(PROGRAMS)
 #
 
 ../bin/applyplugin:	applyplugin.o load.o default.o
-	$(CC) $(CFLAGS) $(LIBRARIES)					\
+	$(CC) $(INCLUDES) $(CFLAGS) $(LIBS)				\
 		-o ../bin/applyplugin					\
 		applyplugin.o load.o default.o
 
 ../bin/analyseplugin:	analyseplugin.o load.o default.o
-	$(CC) $(CFLAGS) $(LIBRARIES)					\
+	$(CC) $(INCLUDES) $(CFLAGS) $(LIBS)					\
 		-o ../bin/analyseplugin 				\
 		analyseplugin.o load.o default.o
 
 ../bin/listplugins:	listplugins.o search.o
-	$(CC) $(CFLAGS) $(LIBRARIES)					\
+	$(CC) $(INCLUDES) $(CFLAGS) $(LIBS)				\
 		-o ../bin/listplugins	 				\
 		listplugins.o search.o
 
diff -ur ladspa_sdk-orig/src/plugins/sine.cpp ladspa_sdk/src/plugins/sine.cpp
--- ladspa_sdk-orig/src/plugins/sine.cpp	2002-07-07 00:23:17.000000000 +0700
+++ ladspa_sdk/src/plugins/sine.cpp	2007-05-15 22:00:35.433840109 +0700
@@ -53,7 +53,7 @@
 	g_pfSineTable[lIndex] = LADSPA_Data(sin(dShift * lIndex));
   }
   if (g_fPhaseStepBase == 0) {
-    g_fPhaseStepBase = (LADSPA_Data)pow(2, sizeof(unsigned long) * 8);
+    g_fPhaseStepBase = (LADSPA_Data)pow((double)2, (double)(sizeof(unsigned long) * 8));
   }
 }
 
