From be929a5b578f8c4ac7fcf780c4ba197126560aea Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 29 Sep 2006 14:18:53 +0000 Subject: [PATCH] use os conditionals, update python swig and puredata external Makefiles use os conditionals, update python swig and puredata external Makefiles --- configure.ac | 18 ++++------------ plugins/puredata/Makefile.am | 41 ++++++++++++++++++++++++------------ python/aubio/Makefile.am | 30 ++++++++++++++++++-------- 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/configure.ac b/configure.ac index daa39e98..e0cfdcce 100644 --- a/configure.ac +++ b/configure.ac @@ -78,10 +78,13 @@ AC_PROG_LIBTOOL 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 @@ case "${host_os}" in 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 @@ AC_PATH_PROG(SWIG,swig,no) 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) diff --git a/plugins/puredata/Makefile.am b/plugins/puredata/Makefile.am index c6016f41..d81bce26 100644 --- a/plugins/puredata/Makefile.am +++ b/plugins/puredata/Makefile.am @@ -5,17 +5,25 @@ SUFFIXES = .pd_linux PDDIR = $(prefix)/lib/pd pddir = $(PDDIR) -#SUBDIRS = ladspa vst win ## Make and install the shared library. pdinstalldir = $(pddir)/extra 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,14 +31,23 @@ aubio_pd_linux_SOURCES = \ aubioquiet~.c \ aubiopitch~.c -pdincludedir = $(pddir)/src - -LIBTOOL=$(SHELL) $(srcdir)/libtoolkludge +aubio_pd_linux_SOURCES = $(ALLSOURCES) +aubio_pd_darwin_SOURCES = $(ALLSOURCES) +aubio_dll_SOURCES = $(ALLSOURCES) -INCLUDES = -I$(top_srcdir)/src -I$(pdincludedir) +pdincludedir = $(pddir)/src -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. @@ -44,8 +61,4 @@ pdinstallref_DATA = \ 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) diff --git a/python/aubio/Makefile.am b/python/aubio/Makefile.am index 97da3bda..73265777 100644 --- a/python/aubio/Makefile.am +++ b/python/aubio/Makefile.am @@ -40,27 +40,39 @@ pkgpythonweb_PYTHON = \ nodist_pkgpython_PYTHON = aubiowrapper.py _aubiowrapper.so -CLEANFILES = *.pyc *.so *.o aubio_wrap.c aubiowrapper.py +_aubiowrapper.so: _aubiowrapper.la + +if MINGW +SWLDFLAGS = "" +else +if DARWIN +SWLDFLAGS = "-bundle -framework Python" +else +SWLDFLAGS = "-shared" +endif +endif -all: _aubiowrapper.so +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} \ -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_la_LDFLAGS = -no-undefined -module -avoid-version $(AUBIO_LDFLAGS) +_aubiowrapper_la_SOURCES = aubio_wrap.c -_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 +aubio_wrap.c aubiowrapper.py: + $(SWIG) -outdir . -o aubio_wrap.c -python $(top_srcdir)/swig/aubio.i -- 2.26.2