diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 39 |
1 files changed, 38 insertions, 1 deletions
@@ -40,6 +40,9 @@ dep_cmds=' sh opkg ' +dep_libs=' +opkhelper-3.0 +' long_opts_with_args=' srcdir @@ -53,6 +56,7 @@ sysconfdir ' features="${dep_cmds} +${dep_libs} metadata" subst_vars="package_name @@ -67,11 +71,19 @@ main() parse_options "${@}" for dep in ${dep_cmds}; do - dep_val="$(eval echo \$\{"${dep}"\})" + dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" + dep_val="$(eval echo \$\{"${dep_name}"\})" if [ -z "${dep_val}" ]; then find_dep_cmd "${dep}" fi done + for dep in ${dep_libs}; do + dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')" + dep_val="$(eval echo \$\{"${dep_name}"\})" + if [ -z "${dep_val}" ]; then + find_dep_lib "${dep}" + fi + done if ${missing_deps}; then cat <<EOF @@ -240,6 +252,31 @@ find_dep_cmd() return 1 } +find_dep_lib() +{ + _dep="${1}" + + ${quiet} || printf 'checking for %s... ' "${dep}" + + _old_ifs="${IFS}" + IFS=: + + for _element in ${libdir}:${PATH}; do + : ${_element=-.} + if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then + ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}" + eval "${_dep}"=\"${_element}/${_dep}\" + IFS="${_old_ifs}" + return 0 + fi + done + + IFS="${_old_ifs}" + ${quiet} || printf 'not found\n' + missing_deps='true' + return 1 +} + write_makefiles() { # Make a script to edit input makefiles. |