This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] add --enable-snapshot for defining parsedir & objdocdir

This is my first step towards resolving PR10996, which is to make it possible to build from a Read Only source tree.

The basic problem is that since GCC does not require bison and flex to compile, snapshots and releases contain those bison and flex generated files within their source tarballs. Furthermore, releases come with there info and man files already made, so that the user will not need makeinfo to get manuals.

However having generated files within the source tree is directly opposed to having a read-only directory goal.

The recently added parsedir and objdocdir made a large stride towards resolving this problem, but require a manual edit of to change the default behavior.

This patch adds in an --enable-snapshot configure option, which defines parsedir and objdocdir to be in source. With --disable-snapshot, these two locations are switched to the build tree, thereby fixing the PR.

The status quo (--enable-snapshot) is currently enabled after this patch, because --disable-snapshot will not bootstrap a snapshot when Bison or Flex is not installed. I plan on flip-flopping the default behavior as soon as this is fixed and the gcc-release script is modified to configure with "--enable-snapshot".

In addition, for future patch enablement, it moves the definition of $(docdir) higher than the included front-end fragments in GCC's

Bootstrapped with i686-pc-cygwin with "--disable-snapshot", "--enable-snapshot" and nothing specified.


Kelley Cook
2003-10-16  Kelley Cook <>

	* Get parsedir and docobjdir from configure.  
	Define $(docdir) before including Make-lang frags. 
	* Add in support for --enable-snapshot.  Pass along
	parsedir and docobjdir.

diff -upr /home/kcook34/gcc-3.4-20031008/gcc/ /home/kcook34/gcc-snapshot/gcc/
--- /home/kcook34/gcc-3.4-20031008/gcc/	2003-10-13 23:41:41.000000000 -0400
+++ /home/kcook34/gcc-snapshot/gcc/	2003-10-16 13:09:32.909778500 -0400
@@ -75,19 +75,19 @@ program_transform_cross_name = @program_
 # Directory where sources are, from where we are.
 srcdir = @srcdir@
-# These directories contain files that are provided as part of a FSF tarball,
-# but not provided in CVS.  Some GCC integrators like to use the CVS sources
-# but keep them read-only during a build, and so change these variables
-# from these defaults.
-parsedir = $(srcdir)
-docobjdir = $(srcdir)/doc
 # Top build directory, relative to here.
 top_builddir = ..
 # objdir is set by configure.
 # It's normally the absolute path to the current directory.
 objdir = @objdir@
+# These directories contain files that are provided as part of a FSF tarball,
+# but not provided in CVS.  Unless --enable-snapshot is specified these files
+# will be put in the object directory.
+parsedir = @parsedir@
+docobjdir = @docobjdir@
+docdir = $(srcdir)/doc
 # --------
 # --------
@@ -2609,8 +2609,6 @@ stmp-fixproto: fixhdr.ready fixproto stm
 # Remake the info files.
-docdir = $(srcdir)/doc
 	-test -d $(docobjdir) || mkdir $(docobjdir)
 	$(STAMP) stmp-docobjdir
diff -upr /home/kcook34/gcc-3.4-20031008/gcc/ /home/kcook34/gcc-snapshot/gcc/
--- /home/kcook34/gcc-3.4-20031008/gcc/	2003-10-14 18:10:17.000000000 -0400
+++ /home/kcook34/gcc-snapshot/gcc/	2003-10-16 13:48:37.544576500 -0400
@@ -148,6 +148,23 @@ elif test x$withval != xno; then
+# We would like to our source tree to be readonly.  However when snapshots or
+# releases are generated, the flex/bison generated files as well as the 
+# various formats of manuals need to be included along with the rest of the
+# sources.  Therefore we have --enable-snapshot to do just that.
+# *** FIXME ** temporarily, the default is set to the same as --enable-snapshot
+# This will change as soon as some issues are worked out.
+# Until then --disable-snapshot will get the desired functionality.
+[  --enable-snapshot       put some generated files in source dir for snapshots],
+[case ${enableval} in
+  no)    parsedir='$(objdir)'; docobjdir='$(objdir)/doc';;
+  yes,*) parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';;
+[parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';])
 # -------------------
 # Find default linker
 # -------------------
@@ -2922,6 +2939,8 @@ AC_SUBST(objdir)
 # Substitute configuration variables

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]