about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am16
2 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 1aa1a66568f4..9b36f90a9b44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,7 @@ AC_CANONICAL_HOST
 
 AC_PROG_CC
 AC_PROG_CXX
+AC_PROG_RANLIB
 
 # Unix shell scripting should die a slow and painful death.
 AC_DEFINE_UNQUOTED(NIX_VALUES_DIR, "$(eval echo $prefix/values)", Nix values directory.)
diff --git a/src/Makefile.am b/src/Makefile.am
index 20f172819f41..afe34ba5ff5d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,16 +1,22 @@
 bin_PROGRAMS = nix # fix
-noinst_PROGRAMS = test
+check_PROGRAMS = test
 
 AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I..
 
-nix_SOURCES = nix.cc util.cc hash.cc archive.cc md5.c eval.cc values.cc globals.cc db.cc
-nix_LDADD = -ldb_cxx-4 -lATerm
+nix_SOURCES = nix.cc
+nix_LDADD = libnix.a -ldb_cxx-4 -lATerm
 
 #fix_SOURCES = fix.cc util.cc hash.cc md5.c
 #fix_LDADD = -lATerm
 
-test_SOURCES = test.cc util.cc hash.cc archive.cc md5.c eval.cc values.cc globals.cc db.cc
-test_LDADD = -ldb_cxx-4 -lATerm
+TESTS = test
+
+test_SOURCES = test.cc
+test_LDADD = libnix.a -ldb_cxx-4 -lATerm
+
+noinst_LIBRARIES = libnix.a
+
+libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c eval.cc values.cc globals.cc db.cc
 
 install-data-local:
 	$(INSTALL) -d $(localstatedir)/nix