summaryrefslogtreecommitdiff
path: root/mk/buildlink3/libtool-post-logic
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-09-02 06:59:37 +0000
committerjlam <jlam@pkgsrc.org>2003-09-02 06:59:37 +0000
commit841b57441b803acb6edd290521d4343593e7e175 (patch)
tree84e91cd88c93c01f847527b25d244510cb5b95db /mk/buildlink3/libtool-post-logic
parent97e17132ab11f03e7cfe511b3e6188812a6c47e4 (diff)
downloadpkgsrc-841b57441b803acb6edd290521d4343593e7e175.tar.gz
Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk cvs update -Pd -A cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
Diffstat (limited to 'mk/buildlink3/libtool-post-logic')
-rw-r--r--mk/buildlink3/libtool-post-logic57
1 files changed, 57 insertions, 0 deletions
diff --git a/mk/buildlink3/libtool-post-logic b/mk/buildlink3/libtool-post-logic
new file mode 100644
index 00000000000..8941f05af3e
--- /dev/null
+++ b/mk/buildlink3/libtool-post-logic
@@ -0,0 +1,57 @@
+# $NetBSD: libtool-post-logic,v 1.2 2003/09/02 06:59:58 jlam Exp $
+#
+# Workaround software authors that don't follow the libtool
+# documentation and link against uninstalled libtool archives with:
+#
+# -L../package/source/dir -lfoo
+#
+# instead of the correct (according to the libtool documentation)
+#
+# ../package/source/dir/libfoo.la
+#
+# We convert the former into the latter by remembering all "local"
+# directories that are mentioned in -L* arguments to to libtool
+# wrapper, and checking to see if <dir>/libfoo.la exists when we see
+# "-lfoo" on the libtool command line.
+
+case $arg in
+-L.|-L./*|-L..*|-L[!/]*|-L${WRKSRC}*)
+ case $fixlibpath in
+ yes)
+ case $arg in
+ */.libs)
+ # ignore -L.../.libs
+ ;;
+ *)
+ $echo "*** [buildlink3] Warning: libtool detected $arg" >> $wrapperlog
+ $echo "*** [buildlink3] Warning: libtool detected $arg" 1>&2
+ lpath=`$echo "X$arg" | $Xsed -e "s/^-L//"`
+ case "$rellpath" in
+ *"$lpath "*) ;;
+ *"$lpath"*) ;;
+ *) rellpath="$rellpath $lpath" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+-l*)
+ case $fixlibpath in
+ yes)
+ lib=`$echo "X$arg" | $Xsed -e "s/^-l//"`
+ for dir in $rellpath; do
+ la="$dir/lib$lib.la"
+ if $test -f "$la"; then
+ $echo "*** [buildlink3] Warning: libtool replaced $arg with $la" >> $wrapperlog
+ $echo "*** [buildlink3] Warning: libtool replaced $arg with $la" 1>&2
+ arg="$la"
+ cachesettings='skipcache=yes'
+ break
+ fi
+ done
+ ;;
+ esac
+ addtoprivatecache=yes
+ ;;
+esac