From 59780470c472c670b73b1c4a76fa6b8f36dea4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 15 Dec 2005 16:11:15 +0000 Subject: eased cross-compilation svn path=/trunk/externals/iem/iemmatrix/; revision=4225 --- INSTALL.txt | 28 +++++++++++++--------------- src/configure.ac | 38 ++++++++++++++++++++++++++++++++------ 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= 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)]) - +AC_ARG_WITH(pdpath, [ --with-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 -- cgit v1.2.1