Commit 97f55b3a authored by Kim Nguyễn's avatar Kim Nguyễn

Compatibility layer around netclient 4.0.2

parent 88b305ec
...@@ -204,6 +204,9 @@ endif ...@@ -204,6 +204,9 @@ endif
ifneq ($(NETCLIENT), false) ifneq ($(NETCLIENT), false)
OBJECTS += parser/cduce_netclient.cmo OBJECTS += parser/cduce_netclient.cmo
PACKAGES += netclient PACKAGES += netclient
ifneq (($NETCLIENT4), false)
SYNTAX += -symbol HAS_NETCLIENT4=true
endif
endif endif
PXP_PACK=pxp-engine pxp-lex-iso88591 PXP_PACK=pxp-engine pxp-lex-iso88591
......
...@@ -237,6 +237,17 @@ let cgidir = dir ~def:(wprefix^"/cgi-bin") "cgidir" ...@@ -237,6 +237,17 @@ let cgidir = dir ~def:(wprefix^"/cgi-bin") "cgidir"
let htmldir = dir ~def:(wprefix^"/html") "htmldir" let htmldir = dir ~def:(wprefix^"/html") "htmldir"
let sessiondir = dir "sessiondir" let sessiondir = dir "sessiondir"
let netclient4 =
let res =
netclient &&
0 =
(Sys.command "echo 'open Nethttp_client' > test_netclient4.ml &&
ocamlfind ocamlc -o test_netclient4 -linkpkg -package \
netclient test_netclient4.ml")
in
ignore (Sys.command "rm -r test_netclient4.ml test_netclient4");
res
let curl,netclient = let curl,netclient =
match curl,netclient with match curl,netclient with
| true,true -> | true,true ->
...@@ -303,6 +314,7 @@ let () = ...@@ -303,6 +314,7 @@ let () =
fprintf out "EXPAT=%b\n" expat; fprintf out "EXPAT=%b\n" expat;
fprintf out "CURL=%b\n" curl; fprintf out "CURL=%b\n" curl;
fprintf out "NETCLIENT=%b\n" netclient; fprintf out "NETCLIENT=%b\n" netclient;
fprintf out "NETCLIENT4=%b\n" netclient4;
fprintf out "CGI=%b\n" cgi; fprintf out "CGI=%b\n" cgi;
fprintf out "PXP_WLEX=%b\n" pxp_wlex; fprintf out "PXP_WLEX=%b\n" pxp_wlex;
fprintf out "BINDIR=%s\n" bindir; fprintf out "BINDIR=%s\n" bindir;
......
ifdef HAS_NETCLIENT4 then module Http_client = Nethttp_client
let error msg = let error msg =
Value.failwith' (Printf.sprintf "Netclient error. %s" msg) Value.failwith' (Printf.sprintf "Netclient error. %s" msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment