shithub: aubio

Download patch

ref: be929a5b578f8c4ac7fcf780c4ba197126560aea
parent: 5a405dd101fdbac398f73af43415b9f82eac3e67
author: Paul Brossier <piem@altern.org>
date: Fri Sep 29 10:18:53 EDT 2006

use os conditionals, update python swig and puredata external Makefiles
use os conditionals, update python swig and puredata external Makefiles


--- a/configure.ac
+++ b/configure.ac
@@ -78,10 +78,13 @@
 AC_CONFIG_HEADERS(src/config.h)
 AC_CONFIG_FILES(aubio.pc)
 
+AM_CONDITIONAL(MINGW, false)
+AM_CONDITIONAL(DARWIN, false)
 case "${host_os}" in
 *mingw*)
   mingw32_support="yes"
   AC_CHECK_HEADER(windows.h)
+  AM_CONDITIONAL(MINGW, true)
   ;;
 *darwin*)
   dnl on macosx, cosf went to -lmx
@@ -89,6 +92,7 @@
   dnl as long double doesn't sit well with -Wall -Werror
   AUBIO_CFLAGS="$AUBIO_CFLAGS -Wno-long-double"
   AC_ISC_POSIX
+  AM_CONDITIONAL(DARWIN, true)
   ;;
 *)
   AC_ISC_POSIX
@@ -211,20 +215,6 @@
 AM_CONDITIONAL(SWIGFOUND, test "${SWIG}" != "no")
 AM_PATH_PYTHON
 AM_CONDITIONAL(PYTHONFOUND, test "${PYTHON}" != "no")
-#
-#if PYTHONFOUND
-case "${host_os}" in
-*darwin*)
-  SWCFLAGS="-Wno-long-double"
-  SWLDFLAGS="-bundle -framework python -L${prefix}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
-  ;;
-*)
-  SWLDFLAGS="-shared"
-  ;;
-esac
-#
-AC_SUBST(SWCFLAGS)
-AC_SUBST(SWLDFLAGS)
 
 dnl Check for docbook-to-man
 AC_PATH_PROG(DOCBOOK_TO_MAN,docbook-to-man,no)
--- a/plugins/puredata/Makefile.am
+++ b/plugins/puredata/Makefile.am
@@ -5,7 +5,6 @@
 SUFFIXES = .pd_linux
 PDDIR = $(prefix)/lib/pd
 pddir = $(PDDIR)
-#SUBDIRS = ladspa vst win
 
 ## Make and install the shared library.
 pdinstalldir = $(pddir)/extra
@@ -12,10 +11,19 @@
 pdinstallrefdir = $(pddir)/doc/5.reference
 pdinstallexpdir = $(pddir)/doc/aubio
 
-# Automake won't accept something ending in ".pd_linux" as a library
-pdinstall_PROGRAMS = aubio.pd_linux
+if MINGW
+PDEXT = aubio.dll
+else
+if DARWIN
+PDEXT = aubio.pd_darwin
+else
+PDEXT = aubio.pd_linux
+endif
+endif
 
-aubio_pd_linux_SOURCES = \
+pdinstall_PROGRAMS = $(PDEXT)
+
+ALLSOURCES = \
 	aubio_setup.c \
 	aubioonset~.c \
 	aubiotempo~.c \
@@ -23,15 +31,24 @@
 	aubioquiet~.c \
 	aubiopitch~.c
 
+aubio_pd_linux_SOURCES = $(ALLSOURCES)
+aubio_pd_darwin_SOURCES = $(ALLSOURCES)
+aubio_dll_SOURCES = $(ALLSOURCES)
+
 pdincludedir = $(pddir)/src
 
-LIBTOOL=$(SHELL) $(srcdir)/libtoolkludge
-
-INCLUDES = -I$(top_srcdir)/src -I$(pdincludedir)
-
-AM_CFLAGS  = -DPD -fPIC -DPIC
+AM_CFLAGS  = -I$(top_srcdir)/src -I$(pdincludedir) -DPD -fPIC -DPIC @AUBIO_CFLAGS@
+if MINGW
 AM_LDFLAGS = -L$(top_builddir)/src/.libs -laubio -export_dynamic -shared 
+else
+if DARWIN
+AM_LDFLAGS = -L$(top_builddir)/src/.libs -laubio -export_dynamic -shared 
+else
+AM_LDFLAGS = -L$(top_builddir)/src/.libs -laubio -export_dynamic -shared 
+endif
+endif
 
+
 ## Install the documentation.
 
 pdinstallref_DATA = \
@@ -44,8 +61,4 @@
 pdinstallexp_DATA = \
 	examples/onset-cam.pd
 
-## My kludge
-noinst_SCRIPTS = libtoolkludge
-
-EXTRA_DIST = $(pdinstallref_DATA) $(pdinstallexp_DATA) $(noinst_SCRIPTS)
-
+EXTRA_DIST = $(pdinstallref_DATA) $(pdinstallexp_DATA)
--- a/python/aubio/Makefile.am
+++ b/python/aubio/Makefile.am
@@ -40,14 +40,24 @@
 
 nodist_pkgpython_PYTHON = aubiowrapper.py _aubiowrapper.so
 
-CLEANFILES = *.pyc *.so *.o aubio_wrap.c aubiowrapper.py 
+_aubiowrapper.so: _aubiowrapper.la
 
-all: _aubiowrapper.so
+if MINGW
+SWLDFLAGS = ""
+else
+if DARWIN
+SWLDFLAGS = "-bundle -framework Python"
+else
+SWLDFLAGS = "-shared"
+endif
+endif
 
+CLEANFILES = *.pyc *.so *.o aubio_wrap.c aubiowrapper.py 
+
 NOWARN_CFLAGS = -Wno-missing-prototypes -Wno-missing-declarations \
 	-Wno-strict-aliasing
 
-AM_CFLAGS = $(SWCFLAGS) -fPIC -DPIC \
+AM_CFLAGS = @AUBIO_CFLAGS@ $(NOWARN_CFLAGS) $(SWCFLAGS) \
 	-I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/ext \
 	-I/usr/include/python${PYTHON_VERSION} \
 	-I${prefix}/include/python${PYTHON_VERSION} \
@@ -54,13 +64,15 @@
 	-I/usr/include \
 	-I${prefix}/include
 
-AM_LDFLAGS = $(SWLDFLAGS) \
+AUBIO_LDFLAGS = $(SWLDFLAGS) \
 	-L$(top_builddir)/ext/.libs -laubioext \
 	-L$(top_builddir)/src/.libs -laubio
 
-aubio_wrap.c:
-	$(SWIG) -outdir . -o aubio_wrap.c -python $(top_srcdir)/swig/aubio.i
+python_DATA = aubiowrapper.py
+python_LTLIBRARIES = _aubiowrapper.la
 
-_aubiowrapper.so: aubio_wrap.c
-	$(CC) $(AM_CFLAGS) $(CFLAGS) $(NOWARN_CFLAGS) -c aubio_wrap.c
-	$(CC) $(AM_LDFLAGS) $(LDFLAGS) aubio_wrap.o -o _aubiowrapper.so
+_aubiowrapper_la_LDFLAGS = -no-undefined -module -avoid-version $(AUBIO_LDFLAGS) 
+_aubiowrapper_la_SOURCES = aubio_wrap.c
+
+aubio_wrap.c aubiowrapper.py:
+	$(SWIG) -outdir . -o aubio_wrap.c -python $(top_srcdir)/swig/aubio.i