aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-12-15 16:11:15 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-12-15 16:11:15 +0000
commit59780470c472c670b73b1c4a76fa6b8f36dea4d6 (patch)
treed5d1d54c07a5cbd2e377769693df85d38990a586
parent219ce0859f42e4a7b6a8767dfcc6811bfb5d8b04 (diff)
eased cross-compilation
svn path=/trunk/externals/iem/iemmatrix/; revision=4225
-rw-r--r--INSTALL.txt28
-rw-r--r--src/configure.ac38
2 files changed, 45 insertions, 21 deletions
diff --git a/INSTALL.txt b/INSTALL.txt
index 568389e..6690987 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -16,14 +16,6 @@ Installation/Compilation instructions for "iemmatrix"
help-patches are installed into extra/iemmatrix; if you are running an old version
of pd, the help-files will be installed into doc/5.reference/iemmatrix
-CrossCompilation for w32 with MinGW (http://www.mingw.org) on linux-systems
- you need a cross-compilation tool-chain for windows (there is a debian-package mingw32)
- run "./configure" and specify the path to your "m_pd.h" (with --includedir) and to your "pd.lib" (with --libdir)
- don't forget to override the default extension ("pd_linux" on linux-systems) with the more appropriate "dll".
- on bash this looks like:
- % ./configure --with-extension=dll --host=i586-mingw32msvc --includedir=/path/to/w32-pd/src/ -libdir=/path/to/w32-pd/bin/
- now run "make" and enjoy.
-
2) mac OS-X:
============
@@ -45,6 +37,19 @@ CrossCompilation for w32 with MinGW (http://www.mingw.org) on linux-systems
http://lists.puredata.info/pipermail/pd-list/2005-05/028266.html
i will support a makefile for msvc as soon as i boot into windows again
+CrossCompilation for w32 with MinGW (http://www.mingw.org) on linux-systems
+ you need a cross-compilation tool-chain for windows (there is a debian-package mingw32)
+ run "./configure" and specify the path to your windows installation of pd
+ the simplest way is to give the PDPATH via the "--with-pd=PDPATH" flag; you have to make
+ sure that the pd-sources are in PDPATH/src and the compiled pd-binaries in PDPATH/bin
+ if those are scattered across you filesystem you can alternatively give explicitely the paths
+ to your "m_pd.h" (with --includedir) and to your "pd.lib" (with --libdir)
+ don't forget to override the default extension ("pd_linux" on linux-systems) with the more appropriate "dll".
+ on bash this looks like:
+ % ./configure --with-extension=dll --host=i586-mingw32msvc --with-pd=/path/to/w32-pd/ --disable-PIC
+ now run "make" and enjoy.
+
+
5) FreeBSD et al:
=================
@@ -52,10 +57,3 @@ CrossCompilation for w32 with MinGW (http://www.mingw.org) on linux-systems
try the configure in iemmatrix/src
and report any success or failure
-
-
-
-
-
-
-
diff --git a/src/configure.ac b/src/configure.ac
index 498f0bb..c3119b9 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -20,7 +20,8 @@ AC_SUBST(INCLUDES)
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)])
-
+AC_ARG_WITH(pdpath, [ --with-pd=</path/to/pd> where to look for pd-headers and and -libs])
+AC_ARG_ENABLE(PIC, [ --disable-PIC disable compilation with PIC-flag])
dnl Checks for libraries.
dnl Replace `main' with a function in -lc:
@@ -35,15 +36,22 @@ dnl Replace `main' with a function in -lstk:
dnl AC_CHECK_LIB(stk, main, STK=yes)
-if test $includedir
-then
+if test "x$with_pd" != "x"; then
+ if test -d "${with_pd}/src"; then
+ INCLUDES="-I${with_pd}/src ${INCLUDES}"
+ fi
+ if test -d "${with_pd}/bin"; then
+ LIBS="-L${with_pd}/bin ${LIBS}"
+ fi
+fi
+
+if test "x$includedir" != "x"; then
for id in $includedir
do
if test -d $id; then INCLUDES="-I$id $INCLUDES"; fi
done
fi
-if test $libdir
-then
+if test "x$libdir" != "x"; then
for id in $libdir
do
if test -d $id; then LIBS="-L$id $LIBS"; fi
@@ -124,13 +132,31 @@ fi
DFLAGS=""
+
+if test "x$enable_PIC" != "xno"; then
+AC_MSG_CHECKING("PIC")
+cat > conftest.c << EOF
+int main(){
+ return 0;
+}
+EOF
+if ${CC} ${INCLUDES} ${DFLAGS} -o conftest.o conftest.c ${CFLAGS} -fPIC > /dev/null 2>&1
+then
+ echo "yes"
+ CFLAGS="${CFLAGS} -fPIC"
+else
+ echo "no"
+fi
+fi
+
+
dnl
dnl OK, checks for machines are here now
dnl
if test `uname -s` = Linux;
then
LFLAGS="-export_dynamic -shared"
- CFLAGS="-fPIC $CFLAGS"
+ CFLAGS="$CFLAGS"
EXT=pd_linux
fi