From 000234a18dd37e780907043e0d7405029078b0a7 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Fri, 16 Apr 2004 08:43:20 +0000 Subject: [PATCH] - addead autoconf-iguration. Actually it only set the default runtime configuration file --- helm/http_getter/.cvsignore | 5 +++++ helm/http_getter/Makefile | 16 +++++++++++----- helm/http_getter/buildTimeOpts.ml.in | 3 +++ helm/http_getter/configure.ac | 13 +++++++++++++ helm/http_getter/main.ml | 3 +-- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 helm/http_getter/buildTimeOpts.ml.in create mode 100644 helm/http_getter/configure.ac diff --git a/helm/http_getter/.cvsignore b/helm/http_getter/.cvsignore index a144df60b..111b760aa 100644 --- a/helm/http_getter/.cvsignore +++ b/helm/http_getter/.cvsignore @@ -7,3 +7,8 @@ *.o http_getter http_getter.opt +autom4te.cache +buildTimeOpts.ml +config.log +config.status +configure diff --git a/helm/http_getter/Makefile b/helm/http_getter/Makefile index bf0c96ac8..94668953e 100644 --- a/helm/http_getter/Makefile +++ b/helm/http_getter/Makefile @@ -2,7 +2,7 @@ VERSION = 0.3.0 NAME = http_getter REQUIRES = helm-getter helm-logger helm-registry -COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o +COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o -thread OCAMLFIND = ocamlfind OCAMLC = $(OCAMLFIND) ocamlc -g $(COMMONOPTS) OCAMLOPT = $(OCAMLFIND) opt $(COMMONOPTS) @@ -12,12 +12,18 @@ byte: $(NAME) opt: $(NAME).opt world: byte opt -$(NAME): main.ml - $(OCAMLC) -linkpkg -thread -o $@ $^ -$(NAME).opt: main.ml - $(OCAMLOPT) -linkpkg -thread -o $@ $^ +$(NAME): buildTimeOpts.cmo main.ml + $(OCAMLC) -linkpkg -o $@ $^ +$(NAME).opt: buildTimeOpts.cmx main.ml + $(OCAMLOPT) -linkpkg -o $@ $^ + +%.cmo: %.ml + $(OCAMLC) -c $< +%.cmx: %.ml + $(OCAMLOPT) -c $< distclean: clean + rm -f buildTimeOpts.ml clean: rm -f *.cm[aiox] *.o $(NAME){,.opt} *.dot diff --git a/helm/http_getter/buildTimeOpts.ml.in b/helm/http_getter/buildTimeOpts.ml.in new file mode 100644 index 000000000..b4865ac3e --- /dev/null +++ b/helm/http_getter/buildTimeOpts.ml.in @@ -0,0 +1,3 @@ + +let conffile = "@GETTER_CONF_FILE@";; + diff --git a/helm/http_getter/configure.ac b/helm/http_getter/configure.ac new file mode 100644 index 000000000..36efda576 --- /dev/null +++ b/helm/http_getter/configure.ac @@ -0,0 +1,13 @@ +AC_INIT(main.ml) + +AC_ARG_WITH(conffile, + AS_HELP_STRING([--with-conffile=fname], + [set default run time configuration file (default is /etc/http_getter.conf.xml]), + [GETTER_CONF_FILE=$withval], [GETTER_CONF_FILE=/etc/http_getter.conf.xml]) + +AC_SUBST(GETTER_CONF_FILE) + +AC_OUTPUT([ + buildTimeOpts.ml +]) + diff --git a/helm/http_getter/main.ml b/helm/http_getter/main.ml index 6a3ec6a0d..6501afdaf 100644 --- a/helm/http_getter/main.ml +++ b/helm/http_getter/main.ml @@ -34,8 +34,7 @@ open Http_getter_types (* constants *) -(* let configuration_file = "/projects/helm/etc/http_getter.conf.xml" *) -let configuration_file = "http_getter.conf.xml" +let configuration_file = BuildTimeOpts.conffile let common_headers = [ "Cache-Control", "no-cache"; -- 2.39.2