pass args through
[debian/gnuradio] / configure-cell-cross
1 #!/bin/bash
2
3 #
4 # Before trying to use this script, please follow the instructions at
5 # http://gnuradio.org/trac/wiki/CrossCompilingForCell
6 #
7
8 scriptdir=`dirname $0`
9
10 prefix=
11 for arg in "$@"
12 do
13   case $arg in
14     --prefix=*)
15       prefix=${arg#--prefix=}
16       ;;
17     --help)
18       $scriptdir/configure --help
19       exit
20       ;;
21   esac
22 done
23
24 if test x$prefix = x
25 then
26   echo "usage: $0 --prefix=PREFIX [configure options...]" 1>&2
27   exit 1
28 fi
29
30
31 arch=ppu
32 cell_root=/mnt/cell-root
33 python_version=2.5
34 # compiler_includes="-I${cell_root}/usr/include -I${cell_root}/usr/local/include -I${cell_root}/usr/lib/gcc/ppu/4.1.1/include -I${cell_root}/usr/lib/gcc/ppu/4.1.1/include/c++"
35 compiler_includes="-I${cell_root}/usr/include"
36
37 $scriptdir/configure                        \
38     CC=${arch}32-gcc                        \
39     CXX=${arch}32-g++                       \
40     AR=${arch}-ar                           \
41     NM=${arch}-nm                           \
42     RANLIB=${arch}-ranlib                   \
43     STRIP=${arch}-strip                     \
44     F77=false                               \
45     CPPFLAGS="$compiler_includes"                                                       \
46     LDFLAGS="-L${cell_root}/lib -L${cell_root}/usr/lib"                                 \
47     PYTHON_CPPFLAGS=-I${cell_root}/usr/include/python${python_version}                  \
48     PKG_CONFIG_PATH=${cell_root}/usr/lib/pkgconfig:${cell_root}/usr/local/lib/pkgconfig \
49     --host=powerpc64-unknown-linux-gnu                                                  \
50     --with-pythondir=$prefix/lib/python${python_version}/site-packages                  \
51     "$@"
52
53
54 # Hack the libtool script so that it doesn't code an --rpath flag into anything
55
56 #sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
57 #sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool