Make dynamic linking smarter, so this stuff works before running 'make install'
[hcoop/domtool2.git] / pcre / smlnj / libpcre-h.sml
CommitLineData
931aae14
AC
1structure LibpcreH = struct
2 local
64734132
AC
3 val global = "/usr/local/lib/pcre_sml.so"
4 val locl = "openssl/pcre_sml.so"
5
931aae14 6 val lh = DynLinkage.open_lib
64734132 7 { name = if Posix.FileSys.access (global, []) then global else locl, global = true, lazy = true }
931aae14
AC
8 handle DynLinkage.DynLinkError s => raise Fail s
9 in
10 fun libh s = let
11 val sh = DynLinkage.lib_symbol (lh, s)
12 in
13 fn () => DynLinkage.addr sh
14 end
15 end
16end