Building GDB with a cross-compiler, including Guile support

N.B. Corrections and improvements to these instructions are welcome!

Guile uses pkg-config which supports cross-compilation. This page needs to provide an example of how to use that. In the mean time, here's a simple hack that also works.

pkg-config is invoked three times, with three different arguments:

  1. pkg-config --exists ${guile_version}
  2. pkg-config --cflags ${guile_version}
  3. pkg-config --libs ${guile_version}

where ${guile_version} is for example "guile-2.0".

One can write a shell script that returns the same results that pkg-config would, and you pass that as the argument to --with-guile.


bash$ cat $HOME/my-guile-for-config
#! /bin/sh                                                                                                                                                       


case "$1" in
--exists) exit 0 ;;
--cflags) echo "-pthread -I$GUILE/include/guile/2.0" ; exit 0 ;;
--libs) echo "-Wl,-rpath,$GUILE/lib -L$GUILE/lib -lguile-2.0 -lgc" ; exit 0 ;;
*) echo "bad arg" >&2 ; exit 1 ;;

You need to provide your own values for --cflags, --libs. The values shown above are obviously for a native build (but useful to exercise the script, and to try custom guile builds).

None: CrossCompilingWithGuileSupport (last edited 2014-03-28 15:52:49 by DougEvans)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.