aboutsummaryrefslogtreecommitdiff
path: root/externals/sprinkler/configure.in
diff options
context:
space:
mode:
authorBryan Jurish <mukau@users.sourceforge.net>2007-08-02 22:45:40 +0000
committerBryan Jurish <mukau@users.sourceforge.net>2007-08-02 22:45:40 +0000
commitfff902c6a23149afabe41acef214aaa42a5f2feb (patch)
tree9b064bfe8e522887316f23405cdad2e601ea7a39 /externals/sprinkler/configure.in
parentd94dbe2eca3ace84a23bfff30c729662a4486a5a (diff)
*** empty log message ***
svn path=/trunk/; revision=8358
Diffstat (limited to 'externals/sprinkler/configure.in')
-rw-r--r--externals/sprinkler/configure.in151
1 files changed, 101 insertions, 50 deletions
diff --git a/externals/sprinkler/configure.in b/externals/sprinkler/configure.in
index 3c853da1..ebe444cc 100644
--- a/externals/sprinkler/configure.in
+++ b/externals/sprinkler/configure.in
@@ -1,7 +1,35 @@
dnl Process this file with autoconf to produce a configure script.
dnl -- adapted from 'configure.in' in ggee distribution by Guenter Geiger
AC_PREREQ(2.5)
-AC_INIT(sprinkler, [0.06], [moocow@ling.uni-potsdam.de])
+
+dnl Some handy macros
+define([THE_PACKAGE_NAME], [sprinkler])
+define([THE_PACKAGE_VERSION], [0.06])
+define([THE_PACKAGE_AUTHOR], [moocow@ling.uni-potsdam.de])
+
+AC_INIT(THE_PACKAGE_NAME, THE_PACKAGE_VERSION, THE_PACKAGE_AUTHOR)
+
+dnl
+dnl source & aux
+dnl
+AC_CONFIG_AUX_DIR(config)
+
+
+dnl
+dnl save user's CFLAGS,CPPFLAGS
+dnl
+UCPPFLAGS="$CPPFLAGS"
+UCFLAGS="$CFLAGS"
+
+dnl
+dnl use automake
+dnl
+AM_INIT_AUTOMAKE(THE_PACKAGE_NAME, THE_PACKAGE_VERSION)
+
+dnl
+dnl use autoheader
+dnl
+dnl AM_CONFIG_HEADER(config.h)
dnl
dnl Programs, prefix
@@ -18,64 +46,63 @@ AC_SUBST(DFLAGS)
AC_SUBST(IFLAGS)
AC_SUBST(LFLAGS)
AC_SUBST(OFLAGS)
+AC_SUBST(WFLAGS)
AC_SUBST(LD)
-AC_SUBST(EXT)
-
-AC_SUBST(MYSOURCES)
-AC_SUBST(MYPODS)
-AC_SUBST(MYPDDOC)
-AC_SUBST(MYDISTNAME)
-
+AC_SUBST(PDEXT)
dnl version stuff (automatically exported?)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_NAME)
AC_SUBST(BUGREPORT)
+dnl other flags
+dnl AC_ISC_POSIX
-dnl
-dnl pd-directory/ies
-dnl
+##--------------------------------------------------------------
+## Pd external objects
+PD_OBJECT_EXTERNALS="sprinkler\$(EXEEXT)"
+AC_SUBST(PD_OBJECT_EXTERNALS)
+
+
+##--------------------------------------------------------------
+## Pd directories
AC_ARG_WITH(pd-dir,
- AC_HELP_STRING([--with-pd-dir=DIR], [PD base directory (default=/usr/local/pd)]),
- [PD_DIR="$withval"],
- [PD_DIR="/usr/local/pd"])
-AC_SUBST(PD_DIR)
+ AC_HELP_STRING([--with-pd-dir=DIR], [PD base directory (default=PREFIX/pd)]),
+ [pddir="$withval"],
+ [pddir="\${prefix}/pd"])
+pddocdir="${pddir}/doc/5.reference"
+AC_SUBST(pddir)
+AC_SUBST(pddocdir)
+
AC_ARG_WITH(pd-include,
- AC_HELP_STRING([--with-pd-include=DIR], [PD include directory (default=${PD_DIR}/src)]),
- [PD_INC="$withval"],
- [PD_INC="${PD_DIR}/src"])
-AC_SUBST(PD_INC)
-
+ AC_HELP_STRING([--with-pd-include=DIR], [PD include directory (default=NONE)]),
+ [pdincludedir="$withval"],
+ [pdincludedir=""])
+if test -n "$pdincludedir" ; then
+ IFLAGS="$IFLAGS -I$pdincludedir"
+fi
+AC_SUBST(pdincludedir)
-dnl
-dnl configuration stuff here
-dnl
-MYDISTNAME="sprinkler"
-MYSOURCES="sprinkler.c"
-MYPODS="`echo *.pod`"
-MYPDDOC="sprinkler-help.pd"
-IFLAGS="-I./include -I${PD_INC}"
+AC_ARG_WITH(pd-extdir,
+ AC_HELP_STRING([--with-pd-extdir=DIR], [Directory for PD externals (default=PDDIR/externs)]),
+ [pdexternsdir="$withval"],
+ [pdexternsdir="$pddir/externs"])
+AC_SUBST(pdexternsdir)
dnl
-dnl debug version?
+dnl Check for m_pd.h
dnl
-AC_MSG_CHECKING([whether we are building a debug version])
-AC_ARG_ENABLE([debug],
- AC_HELP_STRING([--enable-debug],[build debug version (default=no)]))
-
-if test "$enable_debug" == "yes" ; then
- AC_MSG_RESULT(yes)
- DEBUG="yes"
- AC_DEFINE(SPRINKLER_DEBUG, 1, [Define this to use pd_forwardmess() for all messages])
-else
- AC_MSG_RESULT(no)
- DEBUG="no"
-fi
-AC_SUBST(DEBUG)
+CPPFLAGS="$CPPFLAGS $IFLAGS"
+AC_CHECK_HEADER(m_pd.h,[],
+ AC_MSG_WARN([-----------------------------------------------------------------])
+ AC_MSG_WARN([could not find PD header file 'm_pd.h' -- things might get ugly.])
+ AC_MSG_WARN([-----------------------------------------------------------------]),
+ [/* nonempty includes: compile only */])
+##--------------------------------------------------------------
+## local config
dnl
dnl build backwards-compatible non-max 'forward'?
@@ -121,19 +148,38 @@ else
AC_MSG_RESULT(no)
fi
-dnl
-dnl machine-dependent variables
-dnl
+
+##--------------------------------------------------------------
+## debug?
+AC_MSG_CHECKING([whether we are building a debug version])
+AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug],[build debug version (default=no)]))
+if test "$enable_debug" == "yes" ; then
+ AC_MSG_RESULT(yes)
+ DEBUG="yes"
+ AC_DEFINE(SPRINKLER_DEBUG,1,
+ [Define this to include debugging code for the 'readdir' external.])
+else
+ AC_MSG_RESULT(no)
+ DEBUG="no"
+fi
+AC_SUBST(DEBUG)
+
+
+##--------------------------------------------------------------
+## machine-dependent variables
+##
LD=ld
if test `uname -s` = Linux;
then
LFLAGS="-export_dynamic -shared"
if test "$DEBUG" == "no"; then
+ #OFLAGS="-O6 -funroll-loops -fomit-frame-pointer -finline-limit-10000000"
OFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
else
OFLAGS="-g"
fi
- EXT=pd_linux
+ PDEXT=pd_linux
fi
if test `uname -m` = alpha;
@@ -148,14 +194,14 @@ then
-OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
-shared -rdata_shared"
OFLAGS="$CFLAGS"
-EXT=pd_irix6
+ PDEXT=pd_irix6
fi
if test `uname -s` = IRIX32;
then
LFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared"
OFLAGS="$CFLAGS"
- EXT=pd_irix5
+ PDEXT=pd_irix5
fi
dnl
@@ -165,7 +211,7 @@ if test `uname -s` = Darwin;
then
LD=cc
LFLAGS="-bundle -undefined suppress -flat_namespace"
- EXT=pd_darwin
+ PDEXT=pd_darwin
DFLAGS="$DFLAGS -DMACOSX"
if test "$DEBUG" == "no"; then
@@ -175,4 +221,9 @@ then
fi
fi
-AC_OUTPUT(makefile sprinkler-help.pd)
+
+##-- restore user's CFLAGS
+CFLAGS="$UCFLAGS"
+CPPFLAGS="$UCPPFLAGS"
+
+AC_OUTPUT(config/Makefile sprinkler-help.pd Makefile)