aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2007-08-24 14:29:03 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2007-08-24 14:29:03 +0000
commit011560cf378894dc3bfe97e3501a564e1704cd1c (patch)
treeecf73fe8ad814e8dcc4d29d424bdeed39949ae0c /Tools
parent0ba4a01410fb74e9da2f5bcbb5ef01137017616c (diff)
downloadports-011560cf378894dc3bfe97e3501a564e1704cd1c.tar.gz
ports-011560cf378894dc3bfe97e3501a564e1704cd1c.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/resolveportsfromlibs.sh39
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