diff options
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/bin2c/Makefile.am | 3 | ||||
-rw-r--r-- | src/bin2c/bin2c.c (renamed from src/nix-instantiate/bin2c.c) | 0 | ||||
-rw-r--r-- | src/nix-instantiate/Makefile.am | 12 | ||||
-rw-r--r-- | src/nix-instantiate/eval.hh | 2 | ||||
-rw-r--r-- | src/nix-instantiate/main.cc (renamed from src/nix-instantiate/fix.cc) | 4 | ||||
-rw-r--r-- | src/nix-instantiate/nix.sdf (renamed from src/nix-instantiate/fix.sdf) | 0 | ||||
-rw-r--r-- | src/nix-instantiate/nixexpr.cc (renamed from src/nix-instantiate/fixexpr.cc) | 2 | ||||
-rw-r--r-- | src/nix-instantiate/nixexpr.hh (renamed from src/nix-instantiate/fixexpr.hh) | 8 | ||||
-rw-r--r-- | src/nix-instantiate/parser.cc | 9 | ||||
-rw-r--r-- | src/nix-instantiate/parser.hh | 2 | ||||
-rw-r--r-- | src/nix-store/Makefile.am | 8 | ||||
-rw-r--r-- | src/nix-store/help.txt (renamed from src/nix-store/nix-help.txt) | 0 | ||||
-rw-r--r-- | src/nix-store/main.cc (renamed from src/nix-store/nix.cc) | 7 |
14 files changed, 27 insertions, 32 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index e35b82a88..1f2aafcdb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1 @@ -SUBDIRS = boost libutil libstore libmain nix-store nix-hash nix-instantiate +SUBDIRS = bin2c boost libutil libstore libmain nix-store nix-hash nix-instantiate diff --git a/src/bin2c/Makefile.am b/src/bin2c/Makefile.am new file mode 100644 index 000000000..bdd58808a --- /dev/null +++ b/src/bin2c/Makefile.am @@ -0,0 +1,3 @@ +noinst_PROGRAMS = bin2c + +bin2c_SOURCES = bin2c.c diff --git a/src/nix-instantiate/bin2c.c b/src/bin2c/bin2c.c index 18bf81d69..18bf81d69 100644 --- a/src/nix-instantiate/bin2c.c +++ b/src/bin2c/bin2c.c diff --git a/src/nix-instantiate/Makefile.am b/src/nix-instantiate/Makefile.am index cdaec1390..3a09add0c 100644 --- a/src/nix-instantiate/Makefile.am +++ b/src/nix-instantiate/Makefile.am @@ -1,6 +1,6 @@ bin_PROGRAMS = nix-instantiate -nix_instantiate_SOURCES = fixexpr.cc parser.cc eval.cc primops.cc fix.cc +nix_instantiate_SOURCES = nixexpr.cc parser.cc eval.cc primops.cc main.cc nix_instantiate_LDADD = ../libmain/libmain.a ../libstore/libstore.a ../libutil/libutil.a \ ../boost/format/libformat.a -L../../externals/inst/lib -ldb_cxx \ -lsglr -lATB -lconversion -lasfix2 -lmept -lATerm @@ -13,14 +13,10 @@ AM_CXXFLAGS = \ parser.o: parse-table.h -parse-table.h: fix.tbl bin2c - ./bin2c fixParseTable < $< > $@ || (rm $@ && exit 1) - -noinst_PROGRAMS = bin2c - -bin2c_SOURCES = bin2c.c +parse-table.h: nix.tbl + ../bin2c/bin2c nixParseTable < $< > $@ || (rm $@ && exit 1) %.tbl: %.sdf ../../externals/inst/bin/sdf2table -i $< -o $@ -CLEANFILES = parse-table.h fix.tbl +CLEANFILES = parse-table.h nix.tbl diff --git a/src/nix-instantiate/eval.hh b/src/nix-instantiate/eval.hh index 061c840a7..0bc052676 100644 --- a/src/nix-instantiate/eval.hh +++ b/src/nix-instantiate/eval.hh @@ -5,7 +5,7 @@ #include "aterm.hh" #include "hash.hh" -#include "fixexpr.hh" +#include "nixexpr.hh" typedef map<Path, PathSet> DrvPaths; diff --git a/src/nix-instantiate/fix.cc b/src/nix-instantiate/main.cc index e407aaf44..aa6883ff8 100644 --- a/src/nix-instantiate/fix.cc +++ b/src/nix-instantiate/main.cc @@ -70,7 +70,7 @@ void run(Strings args) #if 0 state.searchDirs.push_back("."); - state.searchDirs.push_back(nixDataDir + "/fix"); + state.searchDirs.push_back(nixDataDir + "/nix"); #endif for (Strings::iterator it = args.begin(); @@ -114,4 +114,4 @@ void run(Strings args) } -string programId = "fix"; +string programId = "nix-instantiate"; diff --git a/src/nix-instantiate/fix.sdf b/src/nix-instantiate/nix.sdf index 54f5d5266..54f5d5266 100644 --- a/src/nix-instantiate/fix.sdf +++ b/src/nix-instantiate/nix.sdf diff --git a/src/nix-instantiate/fixexpr.cc b/src/nix-instantiate/nixexpr.cc index 721fa8afa..816b39dc1 100644 --- a/src/nix-instantiate/fixexpr.cc +++ b/src/nix-instantiate/nixexpr.cc @@ -1,4 +1,4 @@ -#include "fixexpr.hh" +#include "nixexpr.hh" #include "storeexpr.hh" diff --git a/src/nix-instantiate/fixexpr.hh b/src/nix-instantiate/nixexpr.hh index 6c1e51d9c..011c2900e 100644 --- a/src/nix-instantiate/fixexpr.hh +++ b/src/nix-instantiate/nixexpr.hh @@ -1,5 +1,5 @@ -#ifndef __FIXEXPR_H -#define __FIXEXPR_H +#ifndef __NIXEXPR_H +#define __NIXEXPR_H #include <map> @@ -8,7 +8,7 @@ #include "util.hh" -/* Fix expressions are represented as ATerms. The maximal sharing +/* Nix expressions are represented as ATerms. The maximal sharing property of the ATerm library allows us to implement caching of normals forms efficiently. */ typedef ATerm Expr; @@ -72,4 +72,4 @@ Expr substitute(const ATermMap & subs, Expr e); Expr makeBool(bool b); -#endif /* !__FIXEXPR_H */ +#endif /* !__NIXEXPR_H */ diff --git a/src/nix-instantiate/parser.cc b/src/nix-instantiate/parser.cc index eaa41b396..f950a51f6 100644 --- a/src/nix-instantiate/parser.cc +++ b/src/nix-instantiate/parser.cc @@ -13,7 +13,6 @@ extern "C" { #include "aterm.hh" #include "parser.hh" #include "shared.hh" -#include "fixexpr.hh" #include "parse-table.h" @@ -76,12 +75,12 @@ Expr parseExprFromFile(Path path) if (e) return e; #endif - /* If `path' refers to a directory, append `/default.fix'. */ + /* If `path' refers to a directory, append `/default.nix'. */ struct stat st; if (stat(path.c_str(), &st)) throw SysError(format("getting status of `%1%'") % path); if (S_ISDIR(st.st_mode)) - path = canonPath(path + "/default.fix"); + path = canonPath(path + "/default.nix"); /* Initialise the SDF libraries. */ static bool initialised = false; @@ -95,12 +94,12 @@ Expr parseExprFromFile(Path path) ATprotect(&parseTable); parseTable = ATreadFromBinaryString( - (char *) fixParseTable, sizeof fixParseTable); + (char *) nixParseTable, sizeof nixParseTable); if (!parseTable) throw Error(format("cannot construct parse table term")); ATprotect(&lang); - lang = ATmake("Fix"); + lang = ATmake("Nix"); if (!SGopenLanguageFromTerm( (char *) programId.c_str(), lang, parseTable)) throw Error(format("cannot open language")); diff --git a/src/nix-instantiate/parser.hh b/src/nix-instantiate/parser.hh index e44987dd0..5983ec562 100644 --- a/src/nix-instantiate/parser.hh +++ b/src/nix-instantiate/parser.hh @@ -1,7 +1,7 @@ #ifndef __PARSER_H #define __PARSER_H -#include "fixexpr.hh" +#include "nixexpr.hh" Expr parseExprFromFile(Path path); diff --git a/src/nix-store/Makefile.am b/src/nix-store/Makefile.am index a39d1e2ad..516d78efc 100644 --- a/src/nix-store/Makefile.am +++ b/src/nix-store/Makefile.am @@ -1,15 +1,13 @@ bin_PROGRAMS = nix-store -nix_store_SOURCES = nix.cc dotgraph.cc +nix_store_SOURCES = main.cc dotgraph.cc nix_store_LDADD = ../libmain/libmain.a ../libstore/libstore.a ../libutil/libutil.a \ ../boost/format/libformat.a -L../../externals/inst/lib -ldb_cxx -lATerm -nix.o: nix-help.txt.hh +main.o: help.txt.hh %.hh: % - echo -n '"' > $@ - sed 's|\(.*\)|\1\\n\\|' < $< >> $@ - echo '"' >> $@ + ../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1) AM_CXXFLAGS = \ -I.. -I../../externals/inst/include -I../libutil -I../libstore -I../libmain diff --git a/src/nix-store/nix-help.txt b/src/nix-store/help.txt index d7f977025..d7f977025 100644 --- a/src/nix-store/nix-help.txt +++ b/src/nix-store/help.txt diff --git a/src/nix-store/nix.cc b/src/nix-store/main.cc index d1766de39..0d87db9df 100644 --- a/src/nix-store/nix.cc +++ b/src/nix-store/main.cc @@ -6,6 +6,7 @@ #include "archive.hh" #include "shared.hh" #include "dotgraph.hh" +#include "help.txt.hh" typedef void (* Operation) (Strings opFlags, Strings opArgs); @@ -13,9 +14,7 @@ typedef void (* Operation) (Strings opFlags, Strings opArgs); static void printHelp() { - cout << -#include "nix-help.txt.hh" - ; + cout << string((char *) helpText, sizeof helpText); exit(0); } @@ -301,4 +300,4 @@ void run(Strings args) } -string programId = "nix"; +string programId = "nix-store"; |