From c6257185139bf5f298b19177867f3afa8e5472b7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Jan 2004 16:32:14 +0000 Subject: [PATCH] * Detect flex and bison; updated the manual. --- configure.ac | 2 ++ doc/manual/installation.xml | 49 +++++++++++++++++++++++++------------ doc/manual/overview.xml | 4 +-- externals/Makefile.am | 35 +++----------------------- src/libexpr/Makefile.am | 6 +++-- 5 files changed, 45 insertions(+), 51 deletions(-) diff --git a/configure.ac b/configure.ac index e04b9684b..c6cb782d8 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,8 @@ AC_LANG_POP(C++) AC_PATH_PROG(wget, wget) AC_PATH_PROG(xmllint, xmllint) AC_PATH_PROG(xsltproc, xsltproc) +AC_PATH_PROG(flex, flex, false) +AC_PATH_PROG(bison, bison, false) AC_ARG_WITH(docbook-catalog, AC_HELP_STRING([--with-docbook-catalog=PATH], [path of the DocBook XML DTD]), diff --git a/doc/manual/installation.xml b/doc/manual/installation.xml index 39f6654ef..1f45404e9 100644 --- a/doc/manual/installation.xml +++ b/doc/manual/installation.xml @@ -46,25 +46,42 @@ $ svn checkout https://svn.cs.uu.nl:12443/repos/trace/nix/trunk nix - To rebuild this manual and the man-pages you need the - xmllint and xsltproc, which are - part of the libxml2 and libxslt - packages, respectively. You also need the DocBook XSL - stylesheets and optionally the - DocBook XML 4.2 DTD. Note that these are only required if you - modify the manual sources or when you are building from the Subversion - repository. + To build this manual and the man-pages you need the + xmllint and xsltproc + programs, which are part of the libxml2 and + libxslt packages, respectively. You also + need the DocBook XSL + stylesheets and optionally the + DocBook XML 4.2 DTD. Note that these are only required + if you modify the manual sources or when you are building from + the Subversion repository. - Nix uses Sleepycat's Berkeley DB, CWI's ATerm library, and SDF parser - library. These are included in the Nix source distribution. If you - build from the Subversion repository, you must download them yourself and - place them in the externals/ directory. See - externals/Makefile.am for the precise URLs of these - packages. + To build the parser, very recent versions + of Bison and Flex are required. (This is because Nix needs GLR + support in Bison and reentrancy support in Flex.) For Bison, + you need version 1.875c or higher (1.875 does + not work), which can be obtained from the + GNU FTP + server. For Flex, you need version 2.5.31, which is + available on SourceForge. Slightly + older versions may also work, but ancient versions like the + ubiquitous 2.5.4a won't. Note that these are only required if + you modify the parser or when you are building from the + Subversion repository. + + + + Nix uses Sleepycat's Berkeley DB and CWI's ATerm library. These + are included in the Nix source distribution. If you build from + the Subversion repository, you must download them yourself and + place them in the externals/ directory. + See externals/Makefile.am for the precise + URLs of these packages. diff --git a/doc/manual/overview.xml b/doc/manual/overview.xml index 5525f4bc0..a5bcccd34 100644 --- a/doc/manual/overview.xml +++ b/doc/manual/overview.xml @@ -174,8 +174,8 @@ $ nix-env -if pkgs/system/i686-linux.nix pan $ nix-pull -http://catamaran.labs.cs.uu.nl/~eelco/nix/nixpkgs-version/ -obtaining list of Nix archives at http://catamaran.labs.cs.uu.nl/~eelco/nix/nixpkgs-version... +http://catamaran.labs.cs.uu.nl/dist/nix/nixpkgs-version/ +obtaining list of Nix archives at http://catamaran.labs.cs.uu.nl/dist/nix/nixpkgs-version... ... diff --git a/externals/Makefile.am b/externals/Makefile.am index c74cb227e..5f48a697d 100644 --- a/externals/Makefile.am +++ b/externals/Makefile.am @@ -56,37 +56,10 @@ build-aterm: have-aterm touch build-aterm -# SDF bundle +all: build-db build-aterm -SDF2 = sdf2-bundle-1.6 - -$(SDF2).tar.gz: - @echo "Nix requires the SDF2 bundle to build." - @echo "Please download version 1.6 from" - @echo " ftp://ftp.stratego-language.org/pub/stratego/sdf2/sdf2-bundle-1.6.tar.gz" - @echo "and place it in the externals/ directory." - false - -$(SDF2): $(SDF2).tar.gz - gunzip < $(SDF2).tar.gz | tar xvf - - -have-sdf2: - $(MAKE) $(SDF2) - touch have-sdf2 - -build-sdf2: have-sdf2 - (pfx=`pwd` && \ - cd $(SDF2) && \ - CC="$(CC) -pg" ./configure --prefix=$$pfx/inst --with-cflags="$(CFLAGS)" && \ - make && \ - make install) - touch build-sdf2 - - -all: build-db build-aterm build-sdf2 - -EXTRA_DIST = $(DB).tar.gz $(ATERM).tar.gz $(SDF2).tar.gz +EXTRA_DIST = $(DB).tar.gz $(ATERM).tar.gz ext-clean: - $(RM) -f have-db build-db have-aterm build-aterm have-sdf2 build-sdf2 - $(RM) -rf $(DB) $(ATERM) $(SDF2) + $(RM) -f have-db build-db have-aterm build-aterm + $(RM) -rf $(DB) $(ATERM) diff --git a/src/libexpr/Makefile.am b/src/libexpr/Makefile.am index 66a3008ed..7a361771e 100644 --- a/src/libexpr/Makefile.am +++ b/src/libexpr/Makefile.am @@ -12,11 +12,13 @@ AM_CFLAGS = \ # Parser generation. +parser.o: parser-tab.h lexer-tab.h + parser-tab.c parser-tab.h: parser.y - ../grammartest/inst/bin/bison -v -o parser-tab.c parser.y -d + $(bison) -v -o parser-tab.c parser.y -d lexer-tab.c lexer-tab.h: lexer.l - flex --outfile lexer-tab.c --header-file=lexer-tab.h lexer.l + $(flex) --outfile lexer-tab.c --header-file=lexer-tab.h lexer.l CLEANFILES =