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:
- pkg-config --exists ${guile_version}
- pkg-config --cflags ${guile_version}
- 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.
Example:
bash$ cat $HOME/my-guile-for-config #! /bin/sh GUILE=$HOME/my-guile-release 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 ;; esac
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).