summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lsqlite3/extras/installpath.lua
blob: 043184afcccb43b6da2c6052864cc5effd5e03e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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")