| 49 | |
| 50 | == Using Debian / Raspbian libraries == |
| 51 | |
| 52 | Choose a directory to store Raspbian packages, for instance `$RASPI_SDK_ROOT/chroot`. You can then use `debootstrap` to install packages to it, but if you have a multiarch-enabled system you can use this poor man's shell script: |
| 53 | |
| 54 | {{{ |
| 55 | #!sh |
| 56 | raspi-install () { |
| 57 | for pkg in "$@" |
| 58 | do |
| 59 | apt-get download "$pkg":armhf \ |
| 60 | && dpkg-deb -x "$pkg"_*.deb $RASPI_SDK_ROOT/chroot \ |
| 61 | && rm -f "$pkg"_*_armhf.deb |
| 62 | done |
| 63 | } |
| 64 | }}} |
| 65 | |
| 66 | Then for ''eg.'' SDL: |
| 67 | |
| 68 | {{{ |
| 69 | #!sh |
| 70 | raspi-install libsdl1.2debian libsdl1.2-dev |
| 71 | }}} |
| 72 | |
| 73 | Then add the following to `CPPFLAGS` in the configure line: |
| 74 | |
| 75 | {{{ |
| 76 | #!sh |
| 77 | -I$RASPI_SDK_ROOT/root/usr/include |
| 78 | }}} |
| 79 | |
| 80 | And the following to `LDFLAGS`: |
| 81 | |
| 82 | {{{ |
| 83 | #!sh |
| 84 | -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf |
| 85 | -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf |
| 86 | -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf |
| 87 | -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf |
| 88 | -Wl,--unresolved-symbols=ignore-in-shared-libs |
| 89 | }}} |