diff options
author | P. J. McDermott <pjm@nac.net> | 2012-10-08 20:37:41 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-10-08 20:37:41 (EDT) |
commit | 9f2c5f83a19ca8f9fbb18faa7e7974595c6e4b54 (patch) | |
tree | ad7b02f6012c21961e492e30b9a398de5b650403 /configure | |
parent | d4cff61d770899dc4f41434619816cbddc74fb5f (diff) |
Support lib deps like opkhelper-3.0 in configure.
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. |