[Dev] patch for pd include in configure, fix definition.c
Stephen Sinclair
sinclair at music.mcgill.ca
Tue Apr 8 02:31:55 BST 2008
Hi,
Any objection to me dropping a couple of patches on libintegra?
I was compiling it and found I wanted to configure a non-standard
location for the Pd headers. Also, I got a compile error on definition.c.
The patches are included here, I'll put them into svn if there's no problem.
Steve
ps., disclaimer, i'm far from being an autotools expert.
commit 42a090a7b1dc34c7cd022d26bf9bd016b8810bfc
Author: Stephen Sinclair <sinclairs at utilitypod.(none)>
Date: Mon Apr 7 21:22:20 2008 -0400
Add --with-pd-include-dir option to configure.
diff --git a/library/trunk/bridges/PD/Makefile.am
b/library/trunk/bridges/PD/Makefile.am
index 51a0534..d7eab00 100644
--- a/library/trunk/bridges/PD/Makefile.am
+++ b/library/trunk/bridges/PD/Makefile.am
@@ -7,7 +7,7 @@ bridgedir = $(libdir)/integra
bridge_LTLIBRARIES = \
integra_pd_bridge.la
-integra_pd_bridge_la_CFLAGS = $(CFLAGS) -DPD -I./deps
+integra_pd_bridge_la_CFLAGS = $(CFLAGS) $(PD_CFLAGS) -DPD -I./deps
integra_pd_bridge_la_LIBADD =
integra_pd_bridge_la_SOURCES = integra_pd_bridge.c #integra_pd_bridge.h
integra_pd_bridge_la_LDFLAGS = -module -avoid-version
diff --git a/library/trunk/configure.in b/library/trunk/configure.in
index 04e8fdb..dd0f1d5 100644
--- a/library/trunk/configure.in
+++ b/library/trunk/configure.in
@@ -171,6 +171,15 @@ AC_ARG_WITH(liblo_include_dir,
echo
], [liblo_include_dir=false])
+AC_ARG_WITH(pd_include_dir,
+ [ --with-pd-include-dir=path pd header path
(default=/usr/include/) ],
+ [
+ pd_include_dir="$withval"
+ echo
+ echo "pd include dir is $withval"
+ echo
+ ], [pd_include_dir=false])
+
dnl are we building the serialization component
if [[ "$serialization" = "true" ]] ; then
dnl check for libxml2 using pkg-config
@@ -268,7 +277,18 @@ dnl AM_CONDITIONAL(BUILD_PD, test "x${pd_example}"
= 'xtrue')
dnl are we building the pd_bridge
if [[ "$pd_bridge" = "true" ]] ; then
AC_DEFINE([BUILD_PD_BRIDGE], [1], [Build the pd bridge])
+ if [[ "$pd_include_dir" != "false" ]] ; then
+ dnl check that the path supplied to the script actually contains
+ dnl the required headers
+ AC_CHECK_FILE(["$pd_include_dir/m_pd.h"],
+ [],
+ [AC_MSG_ERROR(Configuration failed: please make sure that the
pd header is in the search path you supplied: $pd_include_dir)])
+ PD_CFLAGS="-I$pd_include_dir"
+ fi
+ CFLAGS="$CFLAGS $PD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PD_LIBS"
AC_CHECK_HEADERS(m_pd.h, [], [AC_MSG_ERROR(Configuration failed:
please make sure that the pd header m_pd.h is in the standard search
path e.g. /usr/local/include. This file can be found in the src/
directory in the official Pd sources, which can be downloaded from:
http://crca.ucsd.edu/~msp/software.html )], [#include "m_pd.h"])
+ AC_ARG_VAR([PD_CFLAGS], [$PD_CFLAGS], [C compiler flags for PureData])
fi
AM_CONDITIONAL(BUILD_PD_BRIDGE, test "x${pd_bridge}" = 'xtrue')
commit 1625120861b5dc5763d3593526c8fa8c529f41e1
Author: Stephen Sinclair <sinclairs at utilitypod.(none)>
Date: Mon Apr 7 21:20:31 2008 -0400
Fix missing return value in definition.c:ntg_attribute_free().
This file would not compile using gcc-4.1.3, due to a missing return
value for the function ntg_attribute_free(). Fixed by returning 0.
diff --git a/library/trunk/src/definition.c b/library/trunk/src/definition.c
index bd9cdc2..d702b7b 100644
--- a/library/trunk/src/definition.c
+++ b/library/trunk/src/definition.c
@@ -351,4 +351,5 @@ int ntg_attribute_free(ntg_module_attribute *attr)
ntg_free(attr->def);
ntg_free(attr);
}
+ return 0;
}
More information about the Dev
mailing list