This function is invoked just before we run the project's configure script. Its main job is to set the configure_opts variable properly.
Here's a fairly complicated example (this is from GCC):
# The "target" variable is the compilation target: "ntoarmv7", "ntox86", etc. function hook_preconfigure { case ${SYSNAME} in nto) case "${target}" in nto*) basedir=/usr ;; *) basedir=/opt/QNXsdk/host/qnx6/x86/usr ;; esac ;; linux) host_cpu=$(uname -p) case ${host_cpu} in i[34567]86) host_cpu=x86 ;; esac basedir=/opt/QNXsdk/host/linux/${host_cpu}/usr ;; *) echo "Don't have config for ${SYSNAME}" exit 1 ;; esac configure_opts="${configure_opts} --target=${target}" configure_opts="${configure_opts} --prefix=${basedir}" configure_opts="${configure_opts} --exec-prefix=${basedir}" configure_opts="${configure_opts} --with-local-prefix=${basedir}" configure_opts="${configure_opts} --enable-haifa" configure_opts="${configure_opts} --enable-languages=c++" configure_opts="${configure_opts} --enable-threads=posix" configure_opts="${configure_opts} --with-gnu-as" configure_opts="${configure_opts} --with-gnu-ld" configure_opts="${configure_opts} --with-as=${basedir}/bin/${target}-as" configure_opts="${configure_opts} --with-ld=${basedir}/bin/${target}-ld" if [ ${SYSNAME} == nto ]; then configure_opts="${configure_opts} --enable-multilib" configure_opts="${configure_opts} --enable-shared" else configure_opts="${configure_opts} --disable-multilib" fi }