diff options
author | netchild <netchild@FreeBSD.org> | 2007-08-24 22:29:03 +0800 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2007-08-24 22:29:03 +0800 |
commit | 2bcb71df4c62c18eafbdf79f6c8f301dbec21e1e (patch) | |
tree | 11d8eac6eb6604a4a8448ae1842536d502b1ac26 /Tools/scripts | |
parent | 9c93dde537146f3155259ee7d592739a0497f723 (diff) | |
download | freebsd-ports-gnome-2bcb71df4c62c18eafbdf79f6c8f301dbec21e1e.tar.gz freebsd-ports-gnome-2bcb71df4c62c18eafbdf79f6c8f301dbec21e1e.tar.zst freebsd-ports-gnome-2bcb71df4c62c18eafbdf79f6c8f301dbec21e1e.zip |
Teach about USE_ICONV, USE_GETTEXT, USE_GNOME and USE_XORG.
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/resolveportsfromlibs.sh | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/Tools/scripts/resolveportsfromlibs.sh b/Tools/scripts/resolveportsfromlibs.sh index 45ecdf12267e..602e66841356 100755 --- a/Tools/scripts/resolveportsfromlibs.sh +++ b/Tools/scripts/resolveportsfromlibs.sh @@ -77,7 +77,17 @@ if [ -z "${bases}" ]; then bases=/usr/local fi +if [ -z "${PORTSDIR}" ]; then + PORTSDIR=$(make -f /etc/make.conf -V PORTSDIR) +fi + +if [ -z "${PORTSDIR}" -o ! -d "${PORTSDIR}" ]; then + PORTSDIR=/usr/ports +fi + for i in $@; do + result="" + if [ -e /lib/$i -o -e /usr/lib/$i ]; then # base system lib, skipping shift @@ -99,6 +109,33 @@ for i in $@; do fi done - echo ${lib}:${origin} + XORG="$(egrep ${origin}\$ ${PORTSDIR}/Mk/bsd.xorg.mk 2>/dev/null \ + | grep _LIB | sed -e 's:_LIB.*::')" + + GNOME="$(egrep ${origin}\$ ${PORTSDIR}/Mk/bsd.gnome.mk 2>/dev/null \ + | grep _LIB | sed -e 's:_LIB.*::')" + + if [ -n "${XORG}" ]; then + result="USE_XORG+=${XORG}" + fi + + if [ -n "${GNOME}" ]; then + result="USE_GNOME+=${GNOME}" + fi + + case ${origin} in + devel/gettext) + result="USE_GETTEXT=yes" + ;; + converters/libiconv) + result="USE_ICONV=yes" + ;; + esac + + if [ -z "${result}" ]; then + result="${lib}:${origin}" + fi + + echo ${result} shift done | sort -u |