aboutsummaryrefslogtreecommitdiff
path: root/src/configure.ac
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 /src/configure.ac
parent219ce0859f42e4a7b6a8767dfcc6811bfb5d8b04 (diff)
eased cross-compilation
svn path=/trunk/externals/iem/iemmatrix/; revision=4225
Diffstat (limited to 'src/configure.ac')
-rw-r--r--src/configure.ac38
1 files changed, 32 insertions, 6 deletions
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