aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac28
1 files changed, 25 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 1212804..0c821e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,9 +4,6 @@ AC_CONFIG_SRCDIR(hidio.c)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(1.9)
-PD_PATH=../../../pd
-CFLAGS="-DPD $CFLAGS -I$PD_PATH/src"
-
case $host in
*darwin*)
MACOSX=yes
@@ -46,6 +43,27 @@ AC_SUBST(EXTENSION)
AC_HEADER_STDC
+AC_ARG_WITH([pd],
+ [AS_HELP_STRING([--with-pd],
+ [location of pd sourcecode])], ,)
+
+if test "z$with_pd" != "z"; then
+ if test "z${with_pd%%/*}" = "z" ; then
+ # it's an absolute path
+ if test -f $with_pd ; then
+ PD_PATH=$with_pd
+ else
+ AC_MSG_ERROR([The file \"$with_pd\" does not exist.])
+ fi
+ else
+ AC_MSG_ERROR([--with-pd requires an absolute path])
+ fi
+elif test -d ../../../pd; then
+ PD_PATH="../../../pd"
+fi
+AC_MSG_RESULT([checking for pd sourcecode... $PD_PATH])
+CFLAGS="-DPD $CFLAGS -I$PD_PATH/src"
+
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [use debugging support])],
[debug=$enableval])
@@ -95,3 +113,7 @@ AS_IF([test x$universal = xyes], [
AC_MSG_RESULT(
To build a Universal Binary on Mac OS X run it like this:
./configure --enable-universal --disable-dependency-tracking)])
+
+echo "
+Building using Pd headers in $PD_PATH/src
+"