From b22f2651674b4628978bd5971984a01d68510c45 Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Thu, 11 Aug 2011 17:24:05 +0200 Subject: [PATCH] hivex: A few tweaks to enable building in a separate directory A couple of fixes by RWMJ so it still works in the same directory case. --- .gitignore | 1 + configure.ac | 1 + images/Makefile.am | 6 ++++-- lib/Makefile.am | 14 +++++++------- ocaml/Makefile.am | 3 ++- ocaml/t/hivex_300_fold.ml | 3 +-- python/{run-python-tests => run-python-tests.in} | 4 ++-- 7 files changed, 18 insertions(+), 14 deletions(-) rename python/{run-python-tests => run-python-tests.in} (94%) diff --git a/.gitignore b/.gitignore index 0704794..8b06c6a 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ po/remove-potcdate.sin python/*.pyc python/hivex-py.c python/hivex.py +python/run-python-tests regedit/hivexregedit.1 sh/*.1 sh/hivexsh diff --git a/configure.ac b/configure.ac index 22b806f..a02f86b 100644 --- a/configure.ac +++ b/configure.ac @@ -439,6 +439,7 @@ AC_CONFIG_FILES([Makefile regedit/Makefile sh/Makefile xml/Makefile]) +AC_CONFIG_FILES([python/run-python-tests], [chmod +x python/run-python-tests]) AC_OUTPUT dnl Produce summary. diff --git a/images/Makefile.am b/images/Makefile.am index 2adaed3..7f8bd96 100644 --- a/images/Makefile.am +++ b/images/Makefile.am @@ -29,7 +29,9 @@ mklarge_LDADD = ../lib/libhivex.la noinst_DATA = large -large: mklarge - ./mklarge $(srcdir)/minimal large +large: minimal mklarge + cmp -s $(srcdir)/minimal $(builddir)/minimal || \ + cp $(srcdir)/minimal $(builddir)/minimal + ./mklarge $(builddir)/minimal $(builddir)/large CLEANFILES = $(noinst_DATA) diff --git a/lib/Makefile.am b/lib/Makefile.am index d54aaee..7e5b92b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -33,11 +33,11 @@ libhivex_la_SOURCES = \ libhivex_la_LIBADD = ../gnulib/lib/libgnu.la libhivex_la_LDFLAGS = \ -version-info 0:0:0 \ - $(VERSION_SCRIPT_FLAGS)hivex.syms \ + $(VERSION_SCRIPT_FLAGS)$(srcdir)/hivex.syms \ $(LTLIBINTL) \ $(LTLIBTHREAD) libhivex_la_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) -libhivex_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib +libhivex_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib -I$(srcdir) include_HEADERS = hivex.h @@ -56,10 +56,10 @@ noinst_DATA = \ $(top_builddir)/html/hivex.3.html: hivex.pod mkdir -p $(top_builddir)/html - cd $(top_builddir) && pod2html \ - --css 'pod.css' \ - --htmldir html \ - --outfile html/hivex.3.html \ - lib/hivex.pod + pod2html \ + --css $(top_srcdir)/css/pod.css \ + --htmldir $(top_builddir)/html \ + --outfile $(top_builddir)/html/hivex.3.html \ + $< CLEANFILES = $(man_MANS) diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index c688df0..89a59cd 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -64,7 +64,8 @@ TESTS = \ noinst_DATA += $(TESTS) # https://www.redhat.com/archives/libguestfs/2011-May/thread.html#00015 -t/%: t/%.cmo mlhivex.cma +t/%: $(srcdir)/t/%.cmo mlhivex.cma + mkdir -p t $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/lib/libhivex.la \ $(OCAMLFIND) ocamlc -dllpath $(abs_builddir) -package unix \ -linkpkg mlhivex.cma $< -o $@ diff --git a/ocaml/t/hivex_300_fold.ml b/ocaml/t/hivex_300_fold.ml index 0c7bc4f..c8de6e8 100644 --- a/ocaml/t/hivex_300_fold.ml +++ b/ocaml/t/hivex_300_fold.ml @@ -21,7 +21,6 @@ open Unix open Printf let (//) = Filename.concat -let srcdir = try Sys.getenv "srcdir" with Not_found -> "." (* This is a generic function to fold over hives. * fn : 'a -> node -> 'a is called for each node @@ -36,7 +35,7 @@ let hive_fold h fn fv a root = fold a root let () = - let h = Hivex.open_file (srcdir // "../images/large") [] in + let h = Hivex.open_file ("../images/large") [] in (* Count the number of nodes and values in the hive. *) let count_node (nodes, values) _ = (nodes+1, values) in diff --git a/python/run-python-tests b/python/run-python-tests.in similarity index 94% rename from python/run-python-tests rename to python/run-python-tests.in index e8c8c14..af51080 100755 --- a/python/run-python-tests +++ b/python/run-python-tests.in @@ -19,7 +19,7 @@ set -e shopt -s nullglob -for f in t/*.py; do +for f in $(srcdir)t/*.py; do basename "$f" - python "$f" + @PYTHON@ "$f" done -- 1.8.3.1