fix build on amd64, make sure everything is linked correctly.

use ctor/dtor attributes, avoid multiple init/fini definitions.

problem noticed by steven.
This commit is contained in:
espie 2006-08-04 23:34:39 +00:00
parent fcd6aa7f50
commit a6f480686f
6 changed files with 126 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.1.1.1 2006/07/31 12:21:20 espie Exp $
# $OpenBSD: Makefile,v 1.2 2006/08/04 23:34:39 espie Exp $
COMMENT= 'linux audio developer simple plugin API'
HOMEPAGE= http://www.ladspa.org/
@ -7,7 +7,7 @@ CATEGORIES= audio devel
SHARED_ONLY= Yes
DISTNAME= ladspa_sdk_1.12
WRKDIST= ${WRKDIR}/ladspa_sdk
PKGNAME= ladspa-1.12
PKGNAME= ladspa-1.12p0
EXTRACT_SUFX= .tgz
MASTER_SITES= ${HOMEPAGE:=download/}

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_makefile,v 1.1.1.1 2006/07/31 12:21:20 espie Exp $
$OpenBSD: patch-src_makefile,v 1.2 2006/08/04 23:34:39 espie Exp $
--- src/makefile.orig Sat Jul 6 19:34:20 2002
+++ src/makefile Mon Jul 31 13:21:13 2006
+++ src/makefile Sat Aug 5 00:56:04 2006
@@ -16,7 +16,7 @@ INSTALL_BINARY_DIR = /usr/local/bin/
INCLUDES = -I.
@ -10,3 +10,17 @@ $OpenBSD: patch-src_makefile,v 1.1.1.1 2006/07/31 12:21:20 espie Exp $
CXXFLAGS = $(CFLAGS)
PLUGINS = ../plugins/amp.so \
../plugins/delay.so \
@@ -36,11 +36,11 @@ CPP = c++
../plugins/%.so: plugins/%.c ladspa.h
$(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
- $(LD) -o ../plugins/$*.so plugins/$*.o -shared
+ $(CC) $(CFLAGS) -shared -o ../plugins/$*.so plugins/$*.o
../plugins/%.so: plugins/%.cpp ladspa.h
$(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
- $(CPP) -o ../plugins/$*.so plugins/$*.o -shared
+ $(CPP) $(CXXFLAGS) -shared -o ../plugins/$*.so plugins/$*.o
###############################################################################
#

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_plugins_amp_c,v 1.1 2006/08/04 23:34:39 espie Exp $
--- src/plugins/amp.c.orig Sat Aug 5 01:10:01 2006
+++ src/plugins/amp.c Sat Aug 5 01:13:05 2006
@@ -150,10 +150,13 @@ LADSPA_Descriptor * g_psStereoDescriptor
/*****************************************************************************/
+void init() __attribute__((constructor));
+void fini() __attribute__((destructor));
+
/* _init() is called automatically when the plugin library is first
loaded. */
void
-_init() {
+init() {
char ** pcPortNames;
LADSPA_PortDescriptor * piPortDescriptors;
@@ -336,7 +339,7 @@ deleteDescriptor(LADSPA_Descriptor * psD
/* _fini() is called automatically when the library is unloaded. */
void
-_fini() {
+fini() {
deleteDescriptor(g_psMonoDescriptor);
deleteDescriptor(g_psStereoDescriptor);
}

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_plugins_delay_c,v 1.1 2006/08/04 23:34:39 espie Exp $
--- src/plugins/delay.c.orig Sat Aug 5 01:15:43 2006
+++ src/plugins/delay.c Sat Aug 5 01:16:12 2006
@@ -226,10 +226,13 @@ LADSPA_Descriptor * g_psDescriptor = NUL
/*****************************************************************************/
+void init() __attribute__((constructor));
+void fini() __attribute__((destructor));
+
/* _init() is called automatically when the plugin library is first
loaded. */
void
-_init() {
+init() {
char ** pcPortNames;
LADSPA_PortDescriptor * piPortDescriptors;
@@ -323,7 +326,7 @@ _init() {
/* _fini() is called automatically when the library is unloaded. */
void
-_fini() {
+fini() {
long lIndex;
if (g_psDescriptor) {
free((char *)g_psDescriptor->Label);

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_plugins_filter_c,v 1.1 2006/08/04 23:34:39 espie Exp $
--- src/plugins/filter.c.orig Sat Aug 5 01:15:43 2006
+++ src/plugins/filter.c Sat Aug 5 01:16:38 2006
@@ -250,10 +250,13 @@ LADSPA_Descriptor * g_psHPFDescriptor =
/*****************************************************************************/
+void init() __attribute__((constructor));
+void fini() __attribute__((destructor));
+
/* _init() is called automatically when the plugin library is first
loaded. */
void
-_init() {
+init() {
char ** pcPortNames;
LADSPA_PortDescriptor * piPortDescriptors;
@@ -432,7 +435,7 @@ deleteDescriptor(LADSPA_Descriptor * psD
/* _fini() is called automatically when the library is unloaded. */
void
-_fini() {
+fini() {
deleteDescriptor(g_psLPFDescriptor);
deleteDescriptor(g_psHPFDescriptor);
}

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-src_plugins_noise_c,v 1.1 2006/08/04 23:34:39 espie Exp $
--- src/plugins/noise.c.orig Sat Aug 5 01:15:43 2006
+++ src/plugins/noise.c Sat Aug 5 01:16:54 2006
@@ -140,10 +140,13 @@ LADSPA_Descriptor * g_psDescriptor;
/*****************************************************************************/
+void init() __attribute__((constructor));
+void fini() __attribute__((destructor));
+
/* _init() is called automatically when the plugin library is first
loaded. */
void
-_init() {
+init() {
char ** pcPortNames;
LADSPA_PortDescriptor * piPortDescriptors;
@@ -220,7 +223,7 @@ _init() {
/* _fini() is called automatically when the library is unloaded. */
void
-_fini() {
+fini() {
long lIndex;
if (g_psDescriptor) {
free((char *)g_psDescriptor->Label);