summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lsqlite3/extras/installpath.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lsqlite3/extras/installpath.lua')
-rw-r--r--3rdparty/lsqlite3/extras/installpath.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/3rdparty/lsqlite3/extras/installpath.lua b/3rdparty/lsqlite3/extras/installpath.lua
new file mode 100644
index 00000000000..043184afccc
--- /dev/null
+++ b/3rdparty/lsqlite3/extras/installpath.lua
@@ -0,0 +1,14 @@
+-- Script to find the install path for a C module. Public domain.
+
+if not arg or not arg[1] then
+ io.write("Usage: lua installpath.lua modulename\n")
+ os.exit(1)
+end
+for p in string.gfind(package.cpath, "[^;]+") do
+ if string.sub(p, 1, 1) ~= "." then
+ local p2 = string.gsub(arg[1], "%.", string.sub(package.config, 1, 1))
+ io.write(string.gsub(p, "%?", p2), "\n")
+ return
+ end
+end
+error("no suitable installation path found")