aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-11 16:50:56 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-11 16:50:56 +0000
commit72b364e58b271242cb8b7840c460b28b8bf54ed3 (patch)
treefa41d5eee7127131932eb9bede9b3cd302bb8de0 /src
parentb0f1e61341b464e6ad1f4f6f7fcff5afd8250979 (diff)
modified configure in get MinGW-crosscompilation (for w32) work
added a beautiful INSTALL.txt svn path=/trunk/externals/iem/iemmatrix/; revision=2956
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in19
-rw-r--r--src/configure.in99
2 files changed, 69 insertions, 49 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index bbb76c5..d34d582 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -7,10 +7,12 @@ INSTALL_DOC=$(PREFIX)/@REFERENCEPATH@$(LIBNAME)
EXT = @EXT@
DEFS = @DFLAGS@
-IFLAGS = -I. @INCLUDES@
+IFLAGS = -I. @INCLUDES@ $(INCLUDES)
CC = @CC@
LD = @LD@
+STRIP = @STRIP@
+
AFLAGS =
LFLAGS = @LFLAGS@
WFLAGS =
@@ -19,11 +21,9 @@ TARNAME = $(LIBNAME)-@IEMMATRIX_VERSION@.tgz
.SUFFIXES: .$(EXT)
-PDCFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS) $(LFLAGS) $(AFLAGS)
-CFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS)
+CFLAGS = -g -O2 $(DEFS) $(IFLAGS) $(WFLAGS) @CFLAGS@
LIBS = @LIBS@
-#LIBS = -lpthread -lm -lc
include Make.source
TARGETS = $(SOURCES:.c=.o)
@@ -33,16 +33,7 @@ all: $(LIBNAME)
$(LIBNAME): $(TARGETS)
$(LD) $(LFLAGS) -o $(LIBNAME).$(EXT) *.o $(LIBS)
- strip @STRIPFLAGS@ $(LIBNAME).$(EXT)
-
-.c.o:
- $(CC) -c -o $@ $(CFLAGS) -DPD $*.c
-
-# cp $@ $*_stat.o
-
-.o.$(EXT):
- $(CC) -o $@ $(PDCFLAGS) -DPD $*.o
-
+ $(STRIP) @STRIPFLAGS@ $(LIBNAME).$(EXT)
clean:
-rm -f *.$(EXT) *.o
diff --git a/src/configure.in b/src/configure.in
index f1da16b..645df29 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -9,6 +9,7 @@ AC_SUBST(DFLAGS)
AC_SUBST(LFLAGS)
AC_SUBST(EXT)
AC_SUBST(LD)
+AC_SUBST(STRIP)
AC_SUBST(STRIPFLAGS)
AC_SUBST(IEMMATRIX_VERSION)
AC_SUBST(REFERENCEPATH)
@@ -18,21 +19,15 @@ AC_SUBST(SOURCES)
AC_ARG_WITH(pdversion, [ --with-pdversion=<ver> enforce a certain pd-version (e.g. 0.37)])
+AC_ARG_WITH(version, [ --with-version=<ver> enforce a certain iemmatrix-version (e.g. 0.1)])
+AC_ARG_WITH(extension, [ --with-extension=<ext> enforce a certain extension for the dynamic library (e.g. dll)])
-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)
+AC_CHECK_LIB(crtdll, fclose)
+
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)
dnl Replace `main' with a function in -lpthread:
@@ -40,6 +35,24 @@ dnl AC_CHECK_LIB(pthread, main)
dnl Replace `main' with a function in -lstk:
dnl AC_CHECK_LIB(stk, main, STK=yes)
+
+if test $includedir
+then
+ for id in $includedir
+ do
+ if test -d $id; then INCLUDES="-I$id $INCLUDES"; fi
+ done
+fi
+if test $libdir
+then
+ for id in $libdir
+ do
+ if test -d $id; then LIBS="-L$id $LIBS"; fi
+ done
+fi
+
+AC_CHECK_LIB(pd, nullfn)
+
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h)
@@ -52,7 +65,9 @@ AC_FUNC_MMAP
AC_CHECK_FUNCS(select socket strerror)
-LD=ld
+LD=${LD:=$CC}
+STRIP=${STRIP:=strip}
+
DFLAGS=""
dnl
@@ -73,14 +88,8 @@ then
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
@@ -90,8 +99,8 @@ then
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 \
@@ -100,13 +109,6 @@ then
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;
@@ -116,15 +118,15 @@ then
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
+
+if test "x$with_extension" != "x"
+then
+ EXT=$with_extension
+fi
+
+
dnl Checks for pd-version, to set the correct help-path
AC_MSG_CHECKING("pd\>=0.37")
@@ -133,6 +135,9 @@ then
echo -n "($with_pdversion)... "
PD_VERSION="$with_pdversion"
else
+if test "x$cross_compiling" = "xno"
+then
+
cat > conftest.c << EOF
#include <stdio.h>
#include "m_pd.h"
@@ -141,28 +146,47 @@ int main(){
return 0;
}
EOF
+
if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1
then
PD_VERSION=`./conftest.o`
else
PD_VERSION=""
fi
+ echo -n $PD_VERSION
+else
+dnl we are cross-compiling...
+ echo -n "(X)..."
+ PD_VERSION="0.38"
+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"
+ echo " yes"
else
REFERENCEPATH=doc/5.reference/
- echo "no"
+ echo " no"
fi
+
dnl check for iemmatrix-version (but why...)
AC_MSG_CHECKING("iemmatrix-version")
+
+if test "$with_version" != ""
+then
+ echo -n "($with_version)... "
+ IEMMATRIX_VERSION="$with_version"
+else
+
+if test "x$cross_compiling" = "xno"
+then
cat > conftest.c << EOF
#include <stdio.h>
#include "iemmatrix.h"
@@ -180,6 +204,11 @@ else
IEMMATRIX_VERSION=""
echo "(unknown)"
fi
+else
+ IEMMATRIX_VERSION="X"
+ echo "(X)"
+fi
+fi
echo "SOURCES = \\"> Make.source
for i in `ls mtx_*.c iemmatrix.c`