* Finished refactoring the tree.

This commit is contained in:
Eelco Dolstra 2003-10-20 10:05:01 +00:00
parent 53e376d836
commit c62433751d
10 changed files with 86 additions and 65 deletions

View file

@ -1,3 +1,3 @@
SUBDIRS = externals boost src scripts corepkgs doc SUBDIRS = externals src scripts corepkgs doc
EXTRA_DIST = substitute.mk EXTRA_DIST = substitute.mk

View file

@ -1,5 +1,5 @@
AC_INIT(nix, "0.4") AC_INIT(nix, "0.4")
AC_CONFIG_SRCDIR(src/nix.cc) AC_CONFIG_SRCDIR(README)
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
@ -23,12 +23,21 @@ AC_PATH_PROG(wget, wget)
AC_CHECK_LIB(pthread, pthread_mutex_init) AC_CHECK_LIB(pthread, pthread_mutex_init)
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
externals/Makefile externals/Makefile
boost/Makefile boost/format/Makefile
src/Makefile src/Makefile
src/boost/Makefile
src/boost/format/Makefile
src/libnix/Makefile
src/libmain/Makefile
src/nix/Makefile
src/nix-hash/Makefile
src/fix/Makefile
scripts/Makefile scripts/Makefile
corepkgs/Makefile corepkgs/fetchurl/Makefile corepkgs/nar/Makefile corepkgs/Makefile
doc/Makefile doc/manual/Makefile corepkgs/fetchurl/Makefile
corepkgs/nar/Makefile
doc/Makefile
doc/manual/Makefile
]) ])
AC_OUTPUT AC_OUTPUT

View file

@ -1,55 +1 @@
bin_PROGRAMS = nix nix-hash fix SUBDIRS = boost libnix libmain nix nix-hash fix
check_PROGRAMS = test
AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../externals/inst/include $(CXXFLAGS)
LDADD = -L../externals/inst/lib -ldb_cxx -lATerm -L../boost/format -lformat
nix_SOURCES = nix.cc dotgraph.cc
nix_LDADD = libshared.a libnix.a $(LDADD)
nix_hash_SOURCES = nix-hash.cc
nix_hash_LDADD = libshared.a libnix.a $(LDADD)
fix_SOURCES = fix.cc
fix_LDADD = libshared.a libnix.a $(LDADD)
TESTS = test
test_SOURCES = test.cc
test_LDADD = libshared.a libnix.a $(LDADD)
noinst_LIBRARIES = libnix.a libshared.a
libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
store.cc expr.cc normalise.cc exec.cc \
globals.cc db.cc references.cc pathlocks.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\" \
$(AM_CXXFLAGS)
nix.o: nix-help.txt.hh
%.hh: %
echo -n '"' > $@
sed 's|\(.*\)|\1\\n\\|' < $< >> $@
echo '"' >> $@
install-data-local:
$(INSTALL) -d $(localstatedir)/nix
$(INSTALL) -d $(localstatedir)/nix/db
$(INSTALL) -d $(localstatedir)/nix/links
rm -f $(prefix)/current
ln -sf $(localstatedir)/nix/links/current $(prefix)/current
$(INSTALL) -d $(localstatedir)/log/nix
$(INSTALL) -d $(prefix)/store
$(bindir)/nix --init
EXTRA_DIST = *.hh *.h test-builder-*.sh

View file

@ -2,5 +2,7 @@ noinst_LIBRARIES = libformat.a
libformat_a_SOURCES = format_implementation.cc free_funcs.cc parsing.cc libformat_a_SOURCES = format_implementation.cc free_funcs.cc parsing.cc
AM_CXXFLAGS = -Wall -I../..
EXTRA_DIST = exceptions.hpp feed_args.hpp format_class.hpp format_fwd.hpp \ EXTRA_DIST = exceptions.hpp feed_args.hpp format_class.hpp format_fwd.hpp \
group.hpp internals.hpp internals_fwd.hpp macros_default.hpp group.hpp internals.hpp internals_fwd.hpp macros_default.hpp

8
src/fix/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
bin_PROGRAMS = fix
fix_SOURCES = fix.cc
fix_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
-L../../externals/inst/lib -ldb_cxx -lATerm
AM_CXXFLAGS = \
-I.. -I../../externals/inst/include -I../libnix -I../libmain

View file

@ -249,7 +249,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
/* Platform constant. */ /* Platform constant. */
if (ATmatch(e, "Platform")) { if (ATmatch(e, "Platform")) {
return ATmake("<str>", SYSTEM); return ATmake("<str>", thisSystem.c_str());
} }
/* Fix inclusion. */ /* Fix inclusion. */
@ -284,7 +284,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
/* Evaluate the bindings and put them in a map. */ /* Evaluate the bindings and put them in a map. */
map<string, ATerm> bndMap; map<string, ATerm> bndMap;
bndMap["platform"] = ATmake("<str>", SYSTEM); bndMap["platform"] = ATmake("<str>", thisSystem.c_str());
while (!ATisEmpty(bnds)) { while (!ATisEmpty(bnds)) {
ATerm bnd = ATgetFirst(bnds); ATerm bnd = ATgetFirst(bnds);
if (!ATmatch(bnd, "(<str>, <term>)", &s1, &e1)) if (!ATmatch(bnd, "(<str>, <term>)", &s1, &e1))
@ -297,7 +297,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
expression. */ expression. */
NixExpr ne; NixExpr ne;
ne.type = NixExpr::neDerivation; ne.type = NixExpr::neDerivation;
ne.derivation.platform = SYSTEM; ne.derivation.platform = thisSystem;
string name; string name;
Path outPath; Path outPath;
Hash outHash; Hash outHash;
@ -320,7 +320,7 @@ static Expr evalExpr2(EvalState & state, Expr e)
ne.derivation.args.push_back(processBinding(state, arg, ne)); ne.derivation.args.push_back(processBinding(state, arg, ne));
args = ATgetNext(args); args = ATgetNext(args);
} }
} }
else { else {
string s = processBinding(state, value, ne); string s = processBinding(state, value, ne);

12
src/libmain/Makefile.am Normal file
View file

@ -0,0 +1,12 @@
noinst_LIBRARIES = libmain.a
libmain_a_SOURCES = shared.cc
AM_CXXFLAGS = \
-DNIX_STORE_DIR=\"$(prefix)/store\" \
-DNIX_DATA_DIR=\"$(datadir)\" \
-DNIX_STATE_DIR=\"$(localstatedir)/nix\" \
-DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
-I.. -I../../externals/inst/include -I../libnix
EXTRA_DIST = *.hh

9
src/libnix/Makefile.am Normal file
View file

@ -0,0 +1,9 @@
noinst_LIBRARIES = libnix.a
libnix_a_SOURCES = util.cc hash.cc archive.cc md5.c \
store.cc expr.cc normalise.cc exec.cc \
globals.cc db.cc references.cc pathlocks.cc
AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../../externals/inst/include
EXTRA_DIST = *.hh *.h test-builder-*.sh

8
src/nix-hash/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
bin_PROGRAMS = nix-hash
nix_hash_SOURCES = nix-hash.cc
nix_hash_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
-L../../externals/inst/lib -ldb_cxx -lATerm
AM_CXXFLAGS = \
-I.. -I../../externals/inst/include -I../libnix -I../libmain

27
src/nix/Makefile.am Normal file
View file

@ -0,0 +1,27 @@
bin_PROGRAMS = nix
nix_SOURCES = nix.cc dotgraph.cc
nix_LDADD = ../libmain/libmain.a ../libnix/libnix.a ../boost/format/libformat.a \
-L../../externals/inst/lib -ldb_cxx -lATerm
nix.o: nix-help.txt.hh
%.hh: %
echo -n '"' > $@
sed 's|\(.*\)|\1\\n\\|' < $< >> $@
echo '"' >> $@
AM_CXXFLAGS = \
-I.. -I../../externals/inst/include -I../libnix -I../libmain
install-data-local:
$(INSTALL) -d $(localstatedir)/nix
$(INSTALL) -d $(localstatedir)/nix/db
$(INSTALL) -d $(localstatedir)/nix/links
rm -f $(prefix)/current
ln -sf $(localstatedir)/nix/links/current $(prefix)/current
$(INSTALL) -d $(localstatedir)/log/nix
$(INSTALL) -d $(prefix)/store
$(bindir)/nix --init
EXTRA_DIST = *.hh