aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in119
1 files changed, 117 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 0b80ff5..6735098 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
AC_PREREQ(2.13)
-AC_INIT([libxtract], [0.10], [bugs@postlude.co.uk])
+AC_INIT([libxtract], [0.11], [bugs@postlude.co.uk])
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AM_CONFIG_HEADER(config.h)
@@ -24,7 +24,31 @@ AC_ARG_ENABLE(vector,
*) AC_MSG_ERROR(bad value ${enableval} for --enable-vector) ;;
esac],[vector=false])
+AC_ARG_ENABLE(pd_example,
+ [ --enable-pd_example Compile the Pure Data external example],
+ [case "${enableval}" in
+ yes) vector=true ;;
+ no) vector=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
+ esac],[vector=false])
+
+
+
+# libtool version: current:revision:age
+#
+# If the library source code has changed at all since the last update, then
+# increment revision (`c:r:a' becomes `c:r+1:a').
+#
+# If any interfaces have been added, removed, or changed since the last update,
+# increment current, and set revision to 0.
+#
+# If any interfaces have been added since the last public release, then
+# increment age.
+#
+# If any interfaces have been removed since the last public release, then set
+# age to 0.
XTRACT_SO_VERSION=0:0:0
+
CFLAGS="-pedantic -ansi"
LDFLAGS="-lm"
@@ -37,6 +61,97 @@ fi
AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
+if [[ "$pd_example" = "true" ]] ; then
+ AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
+dnl At some point we need to support other platforms, and include checks
+ pd_suffix=pd_linux
+fi
+
+dnl ------------------------------------------
+dnl ---- add PureData includes dir
+dnl ---- usually /usr/local/include
+dnl ------------------------------------------
+AC_ARG_WITH(pd_dir,
+ [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
+ [
+ CPPFLAGS="$CPPFLAGS -I$withval"
+ echo
+ echo "pd dir is $withval"
+ echo
+ ])
+
+dnl ------------------------------------------
+dnl ---- check for PureData Header
+dnl ------------------------------------------
+AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
+ have_pd_hdr=no
+ echo
+ echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
+ echo
+ exit
+ ])
+
+AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
+
+dnl ------------------------------------------
+dnl ---- do some magic to gues the host opsys
+dnl ---- taken from libvorbis configure.in
+dnl ------------------------------------------
+AC_CANONICAL_HOST
+
+PD_LDFLAGS="$PD_LDFLAGS -L/usr/local/lib -ldl"
+if test -z "$GCC"; then
+ case $host in
+ *-*-irix*)
+ dnl If we're on IRIX, we wanna use cc even if gcc
+ dnl is there (unless the user has overriden us)...
+ if test -z "$CC"; then
+ CC=cc
+ fi
+ ;;
+ sparc-sun-solaris*)
+ PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
+ ;;
+ *)
+ PD_CFLAGS="-O"
+ ;;
+ esac
+else
+
+ case $host in
+ *86-*-linux*)
+ PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
+ PD_LDFLAGS="$PD_LDFLAGS -shared"
+ dnl we could test for bad glibc here, but don't
+ pd_suffix=pd_linux
+ ;;
+ powerpc-*-linux*)
+ PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 "
+ PD_LDFLAGS="$PD_LDFLAGS -shared"
+ pd_suffix=pd_linux
+ ;;
+ *-*-linux*)
+ PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC"
+ PD_LDFLAGS="$PD_LDFLAGS -shared"
+ pd_suffix=pd_linux
+ ;;
+ sparc-sun-*)
+ echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
+ ;;
+ *-*-darwin*)
+ PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 "
+ PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace"
+ pd_suffix=pd_darwin
+;;
+ *)
+ dnl assume unix
+ PD_CPPFLAGS="$PD_CPPFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
+ PD_LDFLAGS="$PD_LDFLAGS -shared"
+ pd_suffix=pd_linux
+ ;;
+ esac
+fi
+
AC_CONFIG_FILES([doc/documentation.doxygen])
-AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile)
+AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/puredata/Makefile)