diff --git a/configure.ac b/configure.ac index df6508fcb8..35562882c6 100644 --- a/configure.ac +++ b/configure.ac @@ -197,9 +197,9 @@ AC_ARG_WITH(aterm, AC_HELP_STRING([--with-aterm=PATH], aterm=$withval, aterm=) AM_CONDITIONAL(HAVE_ATERM, test -n "$aterm") if test -z "$aterm"; then - aterm_lib='-L${top_builddir}/externals/inst-aterm/lib -lATerm' - aterm_include='-I${top_builddir}/externals/inst-aterm/include' - aterm_bin='${top_builddir}/externals/inst-aterm/bin' + aterm_lib='-L${top_builddir}/externals/aterm-2.5/aterm -lATerm' + aterm_include='-I${top_builddir}/externals/aterm-2.5/aterm' + aterm_bin='${top_builddir}/externals/aterm-2.5/utils' else aterm_lib="-L$aterm/lib -lATerm" aterm_include="-I$aterm/include" @@ -224,6 +224,8 @@ AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH], [prefix of bzip2]), bzip2=$withval, bzip2=) AM_CONDITIONAL(HAVE_BZIP2, test -n "$bzip2") +ATERM_VERSION=2.5 +AC_SUBST(ATERM_VERSION) if test -z "$bzip2"; then # Headers and libraries will be used from the temporary installation # in externals/inst-bzip2. @@ -248,10 +250,12 @@ AC_ARG_WITH(sqlite, AC_HELP_STRING([--with-sqlite=PATH], [prefix of SQLite]), sqlite=$withval, sqlite=) AM_CONDITIONAL(HAVE_SQLITE, test -n "$sqlite") +SQLITE_VERSION=3.6.22 +AC_SUBST(SQLITE_VERSION) if test -z "$sqlite"; then - sqlite_lib='-L${top_builddir}/externals/inst-sqlite/lib -lsqlite3' - sqlite_include='-I${top_builddir}/externals/inst-sqlite/include' - sqlite_bin='${top_builddir}/externals/inst-sqlite/bin' + sqlite_lib='${top_builddir}/externals/sqlite-$(SQLITE_VERSION)/libsqlite3.la' + sqlite_include='-I${top_builddir}/externals/sqlite-$(SQLITE_VERSION)' + sqlite_bin='${top_builddir}/externals/sqlite-$(SQLITE_VERSION)' else sqlite_lib="-L$sqlite/lib -lsqlite3" sqlite_include="-I$sqlite/include" diff --git a/externals/Makefile.am b/externals/Makefile.am index 3a0b776098..06ee9d590c 100644 --- a/externals/Makefile.am +++ b/externals/Makefile.am @@ -1,11 +1,11 @@ # CWI ATerm -ATERM = aterm-2.5 +ATERM = aterm-$(ATERM_VERSION) $(ATERM).tar.gz: @echo "Nix requires the CWI ATerm library to build." - @echo "Please download version 2.5 from" - @echo " http://nixos.org/tarballs/aterm-2.5.tar.gz" + @echo "Please download version $(ATERM_VERSION) from" + @echo " http://nixos.org/tarballs/aterm-$(ATERM_VERSION).tar.gz" @echo "and place it in the externals/ directory." false @@ -20,12 +20,13 @@ else build-aterm: $(ATERM) (pfx=`pwd` && \ cd $(ATERM) && \ - CC="$(CC)" ./configure --prefix=$$pfx/inst-aterm \ - --disable-shared --enable-static && \ + CC="$(CC)" ./configure --prefix=$$pfx/inst-aterm --libdir=${pkglibdir} && \ $(MAKE) && \ - $(MAKE) check && \ - $(MAKE) install) + $(MAKE) check) touch build-aterm + +install-exec-local:: + cd $(ATERM) && make install endif @@ -53,7 +54,7 @@ build-bzip2: $(BZIP2) $(MAKE) install PREFIX=$$pfx/inst-bzip2) touch build-bzip2 -install: +install-exec-local:: mkdir -p $(DESTDIR)${bzip2_bin} $(INSTALL_PROGRAM) $(bzip2_bin_test)/bzip2 $(bzip2_bin_test)/bunzip2 $(DESTDIR)${bzip2_bin} endif @@ -61,7 +62,6 @@ endif # SQLite -SQLITE_VERSION = 3.6.22 SQLITE = sqlite-$(SQLITE_VERSION) SQLITE_TAR = sqlite-amalgamation-$(SQLITE_VERSION).tar.gz @@ -81,12 +81,12 @@ else build-sqlite: $(SQLITE) (pfx=`pwd` && \ cd $(SQLITE) && \ - CC="$(CC)" ./configure --prefix=$$pfx/inst-sqlite \ - --disable-shared --enable-static && \ - $(MAKE) && \ - $(MAKE) check && \ - $(MAKE) install) + CC="$(CC)" ./configure --disable-static --prefix=$$pfx/inst-sqlite --libdir=${pkglibdir} && \ + $(MAKE) ) touch build-sqlite + +install-exec-local:: + cd $(SQLITE) && make install endif diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc index e8e4c050cc..092d9b1c28 100644 --- a/src/libexpr/attr-path.cc +++ b/src/libexpr/attr-path.cc @@ -1,6 +1,7 @@ #include "attr-path.hh" #include "nixexpr-ast.hh" #include "util.hh" +#include "aterm.hh" namespace nix { diff --git a/src/libexpr/common-opts.cc b/src/libexpr/common-opts.cc index 9e3f8f9614..0ef4883736 100644 --- a/src/libexpr/common-opts.cc +++ b/src/libexpr/common-opts.cc @@ -2,6 +2,7 @@ #include "../libmain/shared.hh" #include "util.hh" #include "parser.hh" +#include "aterm.hh" namespace nix { diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index cd9c645947..5a0e8bc274 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -6,6 +6,7 @@ #include "derivations.hh" #include "nixexpr-ast.hh" #include "globals.hh" +#include "aterm.hh" #define LocalNoInline(f) static f __attribute__((noinline)); f diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index fed6d34726..00d0e35645 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -3,9 +3,10 @@ #include -#include "aterm.hh" #include "nixexpr.hh" +typedef union _ATermList * ATermList; + namespace nix { diff --git a/src/libexpr/expr-to-xml.hh b/src/libexpr/expr-to-xml.hh index 36b8e40424..576a46fc36 100644 --- a/src/libexpr/expr-to-xml.hh +++ b/src/libexpr/expr-to-xml.hh @@ -5,7 +5,6 @@ #include #include "nixexpr.hh" -#include "aterm.hh" namespace nix { diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 1442d7988b..cd5a85e5b9 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -1,6 +1,7 @@ #include "get-drvs.hh" #include "nixexpr-ast.hh" #include "util.hh" +#include "aterm.hh" namespace nix { diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 7dddc91a86..bf2752d0d9 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -8,6 +8,7 @@ #include "nixexpr-ast.hh" #include "parser.hh" #include "names.hh" +#include "aterm.hh" #include #include diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am index dbfc1474e8..dd6760554a 100644 --- a/src/libstore/Makefile.am +++ b/src/libstore/Makefile.am @@ -10,14 +10,14 @@ pkginclude_HEADERS = \ globals.hh references.hh pathlocks.hh \ worker-protocol.hh -libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la +libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} BUILT_SOURCES = derivations-ast.cc derivations-ast.hh EXTRA_DIST = derivations-ast.def derivations-ast.cc schema.sql AM_CXXFLAGS = -Wall \ - -I$(srcdir)/.. ${aterm_include} ${sqlite_include} -I$(srcdir)/../libutil + -I$(srcdir)/.. ${aterm_include} ${sqlite_include} -I$(srcdir)/../libutil -I${top_srcdir}/externals/sqlite-3.6.22/ local-store.lo: schema.sql.hh diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index 042f4738d4..c3f579bee9 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -1,7 +1,7 @@ #ifndef __DERIVATIONS_H #define __DERIVATIONS_H -#include +typedef union _ATerm * ATerm; #include "hash.hh" diff --git a/src/libutil/Makefile.am b/src/libutil/Makefile.am index bd09965433..f17236d292 100644 --- a/src/libutil/Makefile.am +++ b/src/libutil/Makefile.am @@ -3,7 +3,7 @@ pkglib_LTLIBRARIES = libutil.la libutil_la_SOURCES = util.cc hash.cc serialise.cc \ archive.cc aterm.cc aterm-map.cc xml-writer.cc -libutil_la_LIBADD = ../boost/format/libformat.la +libutil_la_LIBADD = ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} pkginclude_HEADERS = util.hh hash.hh serialise.hh \ archive.hh aterm.hh aterm-map.hh xml-writer.hh types.hh diff --git a/src/libutil/aterm-map.hh b/src/libutil/aterm-map.hh index b732453a76..bcfefd9ee4 100644 --- a/src/libutil/aterm-map.hh +++ b/src/libutil/aterm-map.hh @@ -1,7 +1,8 @@ #ifndef __ATERM_MAP_H #define __ATERM_MAP_H -#include +typedef union _ATerm * ATerm; + #include diff --git a/src/nix-env/Makefile.am b/src/nix-env/Makefile.am index 07b29c1862..53fea3d9dd 100644 --- a/src/nix-env/Makefile.am +++ b/src/nix-env/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = nix-env nix_env_SOURCES = nix-env.cc profiles.cc profiles.hh help.txt nix_env_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \ ../libstore/libstore.la ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} + ../boost/format/libformat.la nix-env.o: help.txt.hh @@ -11,6 +11,7 @@ nix-env.o: help.txt.hh ../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1) AM_CXXFLAGS = \ - -I$(srcdir)/.. ${aterm_include} \ + ${aterm_include} \ + -I$(srcdir)/.. \ -I$(srcdir)/../libutil -I$(srcdir)/../libstore \ -I$(srcdir)/../libexpr -I$(srcdir)/../libmain -I../libexpr diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index d11be38084..d3f74c7ed1 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -14,6 +14,7 @@ #include "xml-writer.hh" #include "store-api.hh" #include "util.hh" +#include "aterm.hh" #include #include diff --git a/src/nix-hash/Makefile.am b/src/nix-hash/Makefile.am index d7c569b681..a4fdb32462 100644 --- a/src/nix-hash/Makefile.am +++ b/src/nix-hash/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = nix-hash nix_hash_SOURCES = nix-hash.cc help.txt nix_hash_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} + ../boost/format/libformat.la nix-hash.o: help.txt.hh diff --git a/src/nix-instantiate/Makefile.am b/src/nix-instantiate/Makefile.am index f393318053..1c6d30873e 100644 --- a/src/nix-instantiate/Makefile.am +++ b/src/nix-instantiate/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = nix-instantiate nix_instantiate_SOURCES = nix-instantiate.cc help.txt nix_instantiate_LDADD = ../libmain/libmain.la ../libexpr/libexpr.la \ ../libstore/libstore.la ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} + ../boost/format/libformat.la nix-instantiate.o: help.txt.hh diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index 22df2fbe5d..d8b39eca26 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -11,6 +11,7 @@ #include "util.hh" #include "store-api.hh" #include "common-opts.hh" +#include "aterm.hh" #include "help.txt.hh" diff --git a/src/nix-setuid-helper/Makefile.am b/src/nix-setuid-helper/Makefile.am index a0fbdf39d6..a04701636d 100644 --- a/src/nix-setuid-helper/Makefile.am +++ b/src/nix-setuid-helper/Makefile.am @@ -2,7 +2,6 @@ libexec_PROGRAMS = nix-setuid-helper nix_setuid_helper_SOURCES = nix-setuid-helper.cc nix_setuid_helper_LDADD = ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} + ../boost/format/libformat.la -AM_CXXFLAGS = \ - -I$(srcdir)/.. $(aterm_include) -I$(srcdir)/../libutil +AM_CXXFLAGS = -I$(srcdir)/.. -I$(srcdir)/../libutil diff --git a/src/nix-store/Makefile.am b/src/nix-store/Makefile.am index 0d0d0e0339..e0ba809dcb 100644 --- a/src/nix-store/Makefile.am +++ b/src/nix-store/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = nix-store nix_store_SOURCES = nix-store.cc dotgraph.cc dotgraph.hh help.txt nix_store_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} + ../boost/format/libformat.la nix-store.o: help.txt.hh @@ -10,5 +10,5 @@ nix-store.o: help.txt.hh ../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1) AM_CXXFLAGS = \ - -I$(srcdir)/.. $(aterm_include) -I$(srcdir)/../libutil \ + -I$(srcdir)/.. -I$(srcdir)/../libutil \ -I$(srcdir)/../libstore -I$(srcdir)/../libmain diff --git a/src/nix-worker/Makefile.am b/src/nix-worker/Makefile.am index 82bbaf1f76..b6094a2a03 100644 --- a/src/nix-worker/Makefile.am +++ b/src/nix-worker/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = nix-worker nix_worker_SOURCES = nix-worker.cc help.txt nix_worker_LDADD = ../libmain/libmain.la ../libstore/libstore.la ../libutil/libutil.la \ - ../boost/format/libformat.la ${aterm_lib} ${sqlite_lib} + ../boost/format/libformat.la nix-worker.o: help.txt.hh @@ -10,5 +10,5 @@ nix-worker.o: help.txt.hh ../bin2c/bin2c helpText < $< > $@ || (rm $@ && exit 1) AM_CXXFLAGS = \ - -I$(srcdir)/.. $(aterm_include) -I$(srcdir)/../libutil \ + -I$(srcdir)/.. -I$(srcdir)/../libutil \ -I$(srcdir)/../libstore -I$(srcdir)/../libmain