From 72b364e58b271242cb8b7840c460b28b8bf54ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 11 May 2005 16:50:56 +0000 Subject: modified configure in get MinGW-crosscompilation (for w32) work added a beautiful INSTALL.txt svn path=/trunk/externals/iem/iemmatrix/; revision=2956 --- src/configure.in | 99 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 35 deletions(-) (limited to 'src/configure.in') 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= enforce a certain pd-version (e.g. 0.37)]) +AC_ARG_WITH(version, [ --with-version= enforce a certain iemmatrix-version (e.g. 0.1)]) +AC_ARG_WITH(extension, [ --with-extension= 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 #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 #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` -- cgit v1.2.1