summaryrefslogtreecommitdiff
path: root/mk/configure/cmake-rewrite.awk
diff options
context:
space:
mode:
authormarkd <markd@pkgsrc.org>2007-12-12 01:00:38 +0000
committermarkd <markd@pkgsrc.org>2007-12-12 01:00:38 +0000
commitec09af76f04aba9128001e761e195a4fb53e7d1b (patch)
tree4905d075ccb909845351ec3ab71f9410106ea29f /mk/configure/cmake-rewrite.awk
parent27a1a5eca55b6c28de42203bde64703535aa5e1f (diff)
downloadpkgsrc-ec09af76f04aba9128001e761e195a4fb53e7d1b.tar.gz
Add support for cmake as a tool (USE_TOOLS+=cmake) and for using it in
the configure stage of a build (by setting USE_CMAKE=yes).
Diffstat (limited to 'mk/configure/cmake-rewrite.awk')
-rw-r--r--mk/configure/cmake-rewrite.awk29
1 files changed, 29 insertions, 0 deletions
diff --git a/mk/configure/cmake-rewrite.awk b/mk/configure/cmake-rewrite.awk
new file mode 100644
index 00000000000..87132479eef
--- /dev/null
+++ b/mk/configure/cmake-rewrite.awk
@@ -0,0 +1,29 @@
+# $NetBSD: cmake-rewrite.awk,v 1.1 2007/12/12 01:00:38 markd Exp $
+#
+# cleanup references to libraries in the buildlink tree in files
+# written by cmake's export_library_dependencies() function
+#
+BEGIN { buildlink_dir = ARGV[1]; delete ARGV[1] }
+{
+ match($0, "_LIB_DEPENDS \"")
+ if (RSTART == 0) {
+ print
+ } else {
+ printf "%s \"", $1
+ d=substr($0,RSTART+RLENGTH,length($0))
+ while ( d != "\")") {
+ match(d,"[^;]*")
+ dep=substr(d,RSTART,RLENGTH)
+ d=substr(d,RLENGTH+2,length(d))
+ if (dep ~ "^" buildlink_dir) {
+ "ls -l " dep | getline ls_out
+ match(ls_out,"-> ")
+ if (RSTART > 0) {
+ dep=substr(ls_out,RSTART+RLENGTH,length(ls_out))
+ }
+ }
+ printf "%s;",dep
+ }
+ print d
+ }
+}