aboutsummaryrefslogtreecommitdiff
path: root/src/configure.in
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-21 14:33:31 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-03-21 14:33:31 +0000
commit10b474fba485e9a93157c7fa534bb66e7bcc6fde (patch)
tree73e9e02738ea62179a1722b37ef49a9e91cfcbad /src/configure.in
This commit was generated by cvs2svn to compensate for changes in r2637,svn2git-root
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/iem/iemmatrix/; revision=2638
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in193
1 files changed, 193 insertions, 0 deletions
diff --git a/src/configure.in b/src/configure.in
new file mode 100644
index 0000000..9afbf9e
--- /dev/null
+++ b/src/configure.in
@@ -0,0 +1,193 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(iemmatrix.c)
+
+dnl Checks for programs.
+AC_PROG_CC
+
+AC_SUBST(STK)
+AC_SUBST(DFLAGS)
+AC_SUBST(LFLAGS)
+AC_SUBST(EXT)
+AC_SUBST(LD)
+AC_SUBST(STRIPFLAGS)
+AC_SUBST(IEMMATRIX_VERSION)
+AC_SUBST(REFERENCEPATH)
+AC_SUBST(PDLIBDIR)
+AC_SUBST(INCLUDES)
+AC_SUBST(SOURCES)
+
+
+AC_ARG_WITH(pdversion, [ --with-pdversion=<ver> enforce a certain pd-version (e.g. 0.37)])
+
+if test $includedir
+then
+ for id in $includedir
+ do
+ if test -d $id
+ then
+ INCLUDES="-I$id $INCLUDES"
+ fi
+ done
+fi
+
+dnl Checks for libraries.
+dnl Replace `main' with a function in -lc:
+AC_CHECK_LIB(c, main)
+dnl Replace `main' with a function in -lm:
+AC_CHECK_LIB(m, main)
+dnl Replace `main' with a function in -lpthread:
+dnl AC_CHECK_LIB(pthread, main)
+dnl Replace `main' with a function in -lstk:
+dnl AC_CHECK_LIB(stk, main, STK=yes)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_TIME
+
+dnl Checks for library functions.
+AC_FUNC_MMAP
+AC_CHECK_FUNCS(select socket strerror)
+
+
+LD=ld
+DFLAGS=""
+
+dnl
+dnl OK, checks for machines are here now
+dnl
+if test `uname -s` = Linux;
+then
+ LFLAGS="-export_dynamic -shared"
+ EXT=pd_linux
+ STRIPFLAGS="--strip-unneeded"
+fi
+
+dnl This should use '-bundle_loader /path/to/pd/bin/pd' instead of'-undefined suppress'
+dnl then strip might do something
+if test `uname -s` = Darwin;
+then
+ LD=cc
+ LFLAGS="-bundle -undefined suppress -flat_namespace"
+ EXT=pd_darwin
+ STRIPFLAGS=
+ if test "$enable_lpt" = "yes"; then
+ AC_MSG_ERROR("lpt not supported on this platform");
+ fi
+ if test "$enable_lpt" = ""; then
+ AC_MSG_WARN("lpt not supported on this platform - disabling");
+ enable_lpt="no";
+ fi
+fi
+if test `uname | sed -e 's/^MINGW.*/NT/'` = NT;
+then
+ LD=gcc
+ INCLUDES="-I@prefix@/src"
+ DFLAGS="-DMSW -DNT"
+ LFLAGS="-shared @prefix@/bin/pd.dll"
+ EXT=dll
+else
+ PDLIBDIR="/lib/pd"
+ LIBS="-lc -lm"
+fi
+if test `uname -s` = IRIX64;
+then
+ LFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -shared -rdata_shared"
+ EXT=pd_irix6
+ dnl DFLAGS="-DUNIX -DIRIX6"
+ STRIPFLAGS="--strip-unneeded"
+ if test "$enable_lpt" = "yes"; then
+ AC_MSG_ERROR("lpt not supported on this platform");
+ fi
+ if test "$enable_lpt" = ""; then
+ AC_MSG_WARN("lpt not supported on this platform - disabling");
+ enable_lpt="no";
+ fi
+fi
+
+if test `uname -s` = IRIX32;
+then
+ LFLAGS="-o32 -DUNIX -DIRIX -O2
+ -shared -rdata_shared"
+ EXT=pd_irix5
+ dnl DFLAGS="-DUNIX -DIRIX5"
+ STRIPFLAGS="--strip-unneeded"
+ if test "$enable_lpt" = "yes"; then
+ AC_MSG_ERROR("lpt not supported on this platform");
+ fi
+ if test "$enable_lpt" = ""; then
+ AC_MSG_WARN("lpt not supported on this platform - disabling");
+ enable_lpt="no";
+ fi
+fi
+
+dnl Checks for pd-version, to set the correct help-path
+AC_MSG_CHECKING("pd\>=0.37")
+
+if test "$with_pdversion" != ""
+then
+echo -n "($with_pdversion)... "
+ PD_VERSION="$with_pdversion"
+else
+cat > conftest.c << EOF
+#include <stdio.h>
+#include "m_pd.h"
+int main(){
+ printf("%d.%d\n", PD_MAJOR_VERSION, PD_MINOR_VERSION);
+ return 0;
+}
+EOF
+ if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
+ then
+ PD_VERSION=`./conftest.o`
+ else
+ PD_VERSION=""
+ fi
+fi
+
+let PD_MAJORVERSION=`echo $PD_VERSION | cut -d"." -f1`+0
+let PD_MINORVERSION=`echo $PD_VERSION | cut -d"." -f2`+0
+
+if test "$PD_MAJORVERSION" -gt 0 || test "$PD_MINORVERSION" -ge 37
+then
+ REFERENCEPATH=extra/help-
+ echo "yes"
+else
+ REFERENCEPATH=doc/5.reference/
+ echo "no"
+fi
+
+dnl check for iemmatrix-version (but why...)
+AC_MSG_CHECKING("iemmatrix-version")
+cat > conftest.c << EOF
+#include <stdio.h>
+#include "iemmatrix.h"
+int main(){
+ printf("%s\n", VERSION);
+ return 0;
+}
+EOF
+
+if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
+then
+ IEMMATRIX_VERSION=`./conftest.o`
+ echo "$IEMMATRIX_VERSION"
+else
+ IEMMATRIX_VERSION=""
+ echo "(unknown)"
+fi
+
+echo "SOURCES = \\"> Make.source
+for i in `ls mtx_*.c iemmatrix.c`
+do
+ echo " $i\\">> Make.source
+done
+echo >> Make.source
+
+AC_OUTPUT(Makefile)
+
+rm -f conftest.*