summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.am26
2 files changed, 17 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 110d8f0e12..77a5f1f1f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,12 +11,6 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_RANLIB
 
-# Unix shell scripting should die a slow and painful death.
-AC_DEFINE_UNQUOTED(NIX_STORE_DIR, "$(eval echo $prefix/store)", Nix store directory.)
-AC_DEFINE_UNQUOTED(NIX_DATA_DIR, "$(eval echo $datadir)", Nix data directory.)
-AC_DEFINE_UNQUOTED(NIX_STATE_DIR, "$(eval echo $localstatedir/nix)", Nix state directory.)
-AC_DEFINE_UNQUOTED(NIX_LOG_DIR, "$(eval echo $localstatedir/log/nix)", Nix log file directory.)
-
 AM_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile corepkgs/Makefile])
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 4b21f12b3a..d8ec50f0b6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,25 +3,33 @@ check_PROGRAMS = test
 
 AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I..
 
-nix_SOURCES = nix.cc shared.cc
-nix_LDADD = libnix.a -ldb_cxx-4 -lATerm
+nix_SOURCES = nix.cc
+nix_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-nix_hash_SOURCES = nix-hash.cc shared.cc
-nix_hash_LDADD = libnix.a -ldb_cxx-4 -lATerm
+nix_hash_SOURCES = nix-hash.cc
+nix_hash_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-fix_SOURCES = fix.cc shared.cc
-fix_LDADD = libnix.a -ldb_cxx-4 -lATerm
+fix_SOURCES = fix.cc
+fix_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
 TESTS = test
 
-test_SOURCES = test.cc shared.cc
-test_LDADD = libnix.a -ldb_cxx-4 -lATerm
+test_SOURCES = test.cc
+test_LDADD = libshared.a libnix.a -ldb_cxx-4 -lATerm
 
-noinst_LIBRARIES = libnix.a
+noinst_LIBRARIES = libnix.a libshared.a
 
 libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
  fstate.cc store.cc globals.cc db.cc
 
+libshared_a_SOURCES = shared.cc
+
+libshared_a_CXXFLAGS = \
+ -DNIX_STORE_DIR=\"$(prefix)/store\" \
+ -DNIX_DATA_DIR=\"$(datadir)\" \
+ -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
+ -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\"
+
 install-data-local:
 	$(INSTALL) -d $(localstatedir)/nix
 	$(INSTALL) -d $(localstatedir)/nix/links