Richard W.M. Jones wrote:
On Tue, Aug 28, 2012 at 11:59:11AM +0200, Jim Meyering wrote:
> Hi Rich,
>
> I ran these commands as non-root:
>
> ./autogen.sh && make && make distcheck
>
> It got most of the way through, but failed in the VPATH part
> while rebuilding from a ./_build subdir, like this:
>
> make[4]: Entering directory `/h/j/w/co/hivex/hivex-1.3.6/_build/ocaml'
> mkdir -p /usr/lib64/ocaml
> mkdir -p /usr/lib64/ocaml/stublibs
> ocamlfind install \
> -ldconf ignore -destdir /usr/lib64/ocaml \
> hivex \
> META *.so *.a *.cma *.cmi ../../ocaml/*.mli *.cmx *.cmxa
> ocamlfind: Cannot mkdir /usr/lib64/ocaml/hivex: Permission denied
> make[4]: *** [install-data-hook] Error 2
> make[4]: Leaving directory `/h/j/w/co/hivex/hivex-1.3.6/_build/ocaml'
> make[3]: *** [install-data-am] Error 2
> make[3]: Leaving directory `/h/j/w/co/hivex/hivex-1.3.6/_build/ocaml'
> make[2]: *** [install-am] Error 2
> make[2]: Leaving directory `/h/j/w/co/hivex/hivex-1.3.6/_build/ocaml'
> make[1]: *** [install-recursive] Error 1
> make[1]: Leaving directory `/h/j/w/co/hivex/hivex-1.3.6/_build'
> make: *** [distcheck] Error 1
>
> Obviously, it should not be trying to create directories under /usr.
The rule in the Makefile.am is:
install-data-hook:
mkdir -p $(DESTDIR)$(OCAMLLIB)
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
$(PACKAGE_NAME) \
$(install_files)
So that must mean that DESTDIR is not being set.
There are also environment variables that ocamlfind itself will use
(see findlib.conf(5)). Although they don't appear to be relevant here
it may be worth looking at that man page.
Hi Rich,
In Makefile.am files, installation-related rules
must honor the $(prefix) Makefile variable. For example,
in many Makefiles you'll find files being installed to
$(DESTDIR)$(bindir), with these definitions:
bindir = ${exec_prefix}/bin
exec_prefix = ${prefix}
Currently, $(OCAMLLIB) (set from m4/ocaml.m4 by running $OCAMLC) is set
to /usr/lib64/ocaml for me. If we could make it include $(exec_prefix),
that would solve this problem.