patches/ladspa-01-solaris.diff
changeset 338 db147bddd8c3
child 962 e352355c71a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ladspa-01-solaris.diff	Fri Jul 13 09:56:17 2007 +0000
@@ -0,0 +1,138 @@
+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-orig/src/makefile	2002-07-07 00:34:20.000000000 +0700
++++ ladspa_sdk/src/makefile	2007-05-15 22:05:02.015344934 +0700
+@@ -5,19 +5,17 @@
+ # Change these if you want to install somewhere else. In particularly
+ # you may wish to remove the middle "local/" part of each entry.
+ 
+-INSTALL_PLUGINS_DIR	=	/usr/local/lib/ladspa/
+-INSTALL_INCLUDE_DIR	=	/usr/include/
+-INSTALL_BINARY_DIR	=	/usr/local/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				\
+@@ -26,8 +24,6 @@
+ PROGRAMS	=	../bin/analyseplugin				\
+ 			../bin/applyplugin 				\
+ 			../bin/listplugins
+-CC		=	cc
+-CPP		=	c++
+ 
+ ###############################################################################
+ #
+@@ -35,19 +31,21 @@
+ #
+ 
+ ../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,13 @@
+ 	@echo Should be a noise band around 6000Hz, repeated quietly after 1s.
+ 	play /tmp/test.wav
+ 
+-install:	targets
+-	-mkdirhier	$(INSTALL_PLUGINS_DIR)				\
+-			$(INSTALL_INCLUDE_DIR)				\
+-			$(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 +88,17 @@
+ #
+ 
+ ../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));
+   }
+ }
+